Skip to content

Commit 6e78837

Browse files
authored
[3.1] Fix | Enable pdb link translation (#2781) (#2799)
1 parent b2f2742 commit 6e78837

File tree

6 files changed

+61
-4
lines changed

6 files changed

+61
-4
lines changed

src/Directory.Build.props

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -65,11 +65,26 @@
6565
<DefineConstants>$(DefineConstants);ENCLAVE_SIMULATOR</DefineConstants>
6666
</PropertyGroup>
6767

68+
<!-- Packaging for source link-->
69+
<PropertyGroup>
70+
<DebugType>portable</DebugType>
71+
<DebugSymbols>true</DebugSymbols>
72+
<GeneratePackageOnBuild>false</GeneratePackageOnBuild>
73+
<PublishRepositoryUrl>true</PublishRepositoryUrl>
74+
<EmbedUnTrackedSources>true</EmbedUnTrackedSources>
75+
<DisableSourceLinkTranslation Condition="'$(DisableSourceLinkTranslation)' == ''">false</DisableSourceLinkTranslation>
76+
</PropertyGroup>
77+
<PropertyGroup Condition="'$(TF_BUILD)' == 'true'">
78+
<ContinuousIntegrationBuild>true</ContinuousIntegrationBuild>
79+
</PropertyGroup>
80+
6881
<!-- Provides Version properties -->
6982
<Import Project="$(ToolsDir)props\Versions.props" />
7083
<!-- Provides Tool properties -->
7184
<Import Project="$(ToolsDir)props\Tools.props" />
7285
<!-- Provides Build properties -->
7386
<Import Project="$(ToolsDir)props\AssemblyInfo.props" />
7487
<Import Project="$(ToolsDir)props\AssemblyRef.props" />
88+
<Import Project="$(ToolsDir)targets\RepositoryInfo.targets" />
89+
7590
</Project>

src/Microsoft.Data.SqlClient/add-ons/AzureKeyVaultProvider/Microsoft.Data.SqlClient.AlwaysEncrypted.AzureKeyVaultProvider.csproj

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,13 +16,15 @@
1616
<PackageLicenseExpression>MIT</PackageLicenseExpression>
1717
<PackageRequireLicenseAcceptance>true</PackageRequireLicenseAcceptance>
1818
</PropertyGroup>
19+
<PropertyGroup>
20+
<TargetFrameworkMonikerAssemblyAttributesPath>$([System.IO.Path]::Combine('$(IntermediateOutputPath)','$(TargetFramework)','$(TargetFrameworkMoniker).AssemblyAttributes$(DefaultLanguageSourceExtension)'))</TargetFrameworkMonikerAssemblyAttributesPath>
21+
</PropertyGroup>
1922
<ItemGroup>
2023
<ProjectReference Condition="'$(TargetGroup)'=='netcoreapp' AND !$(ReferenceType.Contains('Package'))" Include="$(NetCoreSource)src\Microsoft.Data.SqlClient.csproj" />
2124
<ProjectReference Condition="'$(TargetGroup)'=='netfx' AND !$(ReferenceType.Contains('Package'))" Include="$(NetFxSource)src\Microsoft.Data.SqlClient.csproj" />
2225
<PackageReference Condition="$(ReferenceType)=='Package'" Include="Microsoft.Data.SqlClient" Version="$(TestMicrosoftDataSqlClientVersion)" />
2326
</ItemGroup>
2427
<ItemGroup>
25-
<PackageReference Include="Microsoft.SourceLink.GitHub" Version="$(MicrosoftSourceLinkGitHubVersion)" PrivateAssets="All" />
2628
<PackageReference Include="Azure.Core" Version="$(AzureCoreVersion)" />
2729
<PackageReference Include="System.Text.Encodings.Web" Version="$(SystemTextEncodingsWebVersion)" />
2830
<PackageReference Include="Azure.Security.KeyVault.Keys" Version="$(AzureSecurityKeyVaultKeysVersion)" />

src/Microsoft.Data.SqlClient/netcore/src/Microsoft.Data.SqlClient.csproj

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,9 @@
3333
<KeyFile>$(SigningKeyPath)</KeyFile>
3434
<AssemblyOriginatorKeyFile>$(SigningKeyPath)</AssemblyOriginatorKeyFile>
3535
</PropertyGroup>
36+
<PropertyGroup>
37+
<TargetFrameworkMonikerAssemblyAttributesPath>$([System.IO.Path]::Combine('$(IntermediateOutputPath)','$(TargetFramework)','$(TargetFrameworkMoniker).AssemblyAttributes$(DefaultLanguageSourceExtension)'))</TargetFrameworkMonikerAssemblyAttributesPath>
38+
</PropertyGroup>
3639
<PropertyGroup Condition="$(CDP_BUILD_TYPE)!=Official">
3740
<AssemblyOriginatorKeyFile>$(SigningKeyPath)</AssemblyOriginatorKeyFile>
3841
</PropertyGroup>
@@ -867,7 +870,6 @@
867870
<PackageReference Include="System.Runtime.Caching" Version="$(SystemRuntimeCachingVersion)" />
868871
<PackageReference Condition="$(TargetGroup) == 'netstandard'" Include="System.Runtime.Loader" Version="$(SystemRuntimeLoaderVersion)" />
869872
<PackageReference Include="System.Security.Cryptography.Cng" Version="$(SystemSecurityCryptographyCngVersion)" />
870-
<PackageReference Include="Microsoft.SourceLink.GitHub" Version="$(MicrosoftSourceLinkGitHubVersion)" PrivateAssets="All" />
871873
</ItemGroup>
872874
<ItemGroup>
873875
<EmbeddedResource Update="Resources\Strings.resx">

src/Microsoft.Data.SqlClient/netfx/src/Microsoft.Data.SqlClient.csproj

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -590,7 +590,6 @@
590590
</COMReference>
591591
</ItemGroup>
592592
<ItemGroup>
593-
<PackageReference Include="Microsoft.SourceLink.GitHub" Version="$(MicrosoftSourceLinkGitHubVersion)" PrivateAssets="All" />
594593
<PackageReference Include="System.Text.Encodings.Web">
595594
<Version>$(SystemTextEncodingsWebVersion)</Version>
596595
</PackageReference>

tools/props/Versions.props

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,6 @@
2727
<SystemBuffersVersion>4.5.1</SystemBuffersVersion>
2828
<SystemIOVersion>4.3.0</SystemIOVersion>
2929
<SystemTextEncodingsWebVersion>4.7.2</SystemTextEncodingsWebVersion>
30-
<MicrosoftSourceLinkGitHubVersion>1.0.0</MicrosoftSourceLinkGitHubVersion>
3130
</PropertyGroup>
3231
<!-- NetCore project dependencies -->
3332
<PropertyGroup>
Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
<!-- Licensed to the .NET Foundation under one or more agreements. The .NET Foundation licenses this
2+
file to you under the MIT license. -->
3+
<Project>
4+
5+
<!-- Opt-in switch to disable source link (i.e. for local builds). -->
6+
<PropertyGroup Condition="'$(DisableSourceLink)' == 'true'">
7+
<EnableSourceLink>false</EnableSourceLink>
8+
<EnableSourceControlManagerQueries>false</EnableSourceControlManagerQueries>
9+
<DeterministicSourcePaths>false</DeterministicSourcePaths>
10+
</PropertyGroup>
11+
12+
<ItemGroup>
13+
<SourceRoot Include="$(RepoRoot)" />
14+
</ItemGroup>
15+
16+
<PropertyGroup>
17+
<_TranslateUrlPattern>https://[^/]+/ADO.Net/_git/([^/-]+)-(.+)</_TranslateUrlPattern>
18+
<_TranslateUrlReplacement>https://github.com/dotnet/SqlClient</_TranslateUrlReplacement>
19+
</PropertyGroup>
20+
21+
<Target Name="_TranslateAzureDevOpsUrlToGitHubUrl"
22+
Condition="'$(DisableSourceLinkTranslation)' == 'false'"
23+
DependsOnTargets="$(SourceControlManagerUrlTranslationTargets)"
24+
BeforeTargets="SourceControlManagerPublishTranslatedUrls">
25+
26+
<PropertyGroup>
27+
<ScmRepositoryUrl>$([System.Text.RegularExpressions.Regex]::Replace($(ScmRepositoryUrl), $(_TranslateUrlPattern), $(_TranslateUrlReplacement)))</ScmRepositoryUrl>
28+
</PropertyGroup>
29+
30+
<ItemGroup>
31+
<SourceRoot Update="@(SourceRoot)">
32+
</SourceRoot>
33+
<SourceRoot Update="@(SourceRoot)">
34+
<ScmRepositoryUrl>$([System.Text.RegularExpressions.Regex]::Replace(%(SourceRoot.ScmRepositoryUrl),
35+
$(_TranslateUrlPattern), $(_TranslateUrlReplacement)))</ScmRepositoryUrl>
36+
</SourceRoot>
37+
</ItemGroup>
38+
<Message Text="Final Translated ScmRepositoryUrl to $(ScmRepositoryUrl)" Importance="high" />
39+
</Target>
40+
</Project>

0 commit comments

Comments
 (0)