Skip to content

Commit f0572f3

Browse files
Source link PDBs for supporting debugging package directly (#789)
* Source link PDBs for supporting debugging package directly * Enable CI only for build packages via build.proj * attempt to ix sourceroot error * Improve
1 parent f19cc8f commit f0572f3

15 files changed

+52
-23
lines changed

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,7 @@ bld/
3838

3939
# Visual Studio 2017 auto generated files
4040
Generated\ Files/
41+
**/.AssemblyAttributes
4142

4243
# Visual Studio Code settings
4344
.vscode/

build.proj

Lines changed: 13 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
<?xml version="1.0" encoding="utf-8" ?>
2-
<Project ToolsVersion="Latest" DefaultTargets="BuildAllConfigurations" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
2+
<Project ToolsVersion="Current" DefaultTargets="BuildAllConfigurations" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
33

44
<Import Project="src/Directory.Build.props" />
55
<Import Project="$(ToolsDir)targets\GenerateNugetPackage.targets" />
@@ -17,6 +17,7 @@
1717
<GenerateNuget Condition="'$(GenerateNuget)' == ''">true</GenerateNuget>
1818
<ProjectProperties>Configuration=$(Configuration);AssemblyFileVersion=$(AssemblyFileVersion);TargetsWindows=$(TargetsWindows);TargetsUnix=$(TargetsUnix);</ProjectProperties>
1919
<TestProjectProperties>BuildProjectReferences=false;$(ProjectProperties);</TestProjectProperties>
20+
<CI>ContinuousIntegrationBuild=true</CI>
2021
</PropertyGroup>
2122

2223
<!-- Populate all managed projects -->
@@ -71,17 +72,17 @@
7172
</Target>
7273

7374
<Target Name="BuildNetFx" DependsOnTargets="RestoreNetFx" Condition="'$(IsEnabledWindows)' == 'true'">
74-
<MSBuild Projects="@(NetFxDriver)" Properties="Platform=AnyCPU;$(ProjectProperties)" />
75+
<MSBuild Projects="@(NetFxDriver)" Properties="$(CI);Platform=AnyCPU;$(ProjectProperties)" />
7576
</Target>
7677

7778
<Target Name="BuildNetCore" DependsOnTargets="RestoreNetCore">
78-
<MSBuild Projects="@(NetCoreDriver)" Properties="Platform=AnyCPU;$(ProjectProperties)" />
79+
<MSBuild Projects="@(NetCoreDriver)" Properties="$(CI);Platform=AnyCPU;$(ProjectProperties)" />
7980
</Target>
8081

8182
<Target Name="BuildNetCoreAllOS" DependsOnTargets="RestoreNetCore">
82-
<MSBuild Projects="@(NetCoreDriver)" Properties="$(ProjectProperties);Platform=AnyCPU;OSGroup=Unix;" RemoveProperties="TargetsWindows;TargetsUnix;" />
83-
<MSBuild Projects="@(NetCoreDriver)" Properties="$(ProjectProperties);Platform=AnyCPU;OSGroup=Windows_NT;" RemoveProperties="TargetsWindows;TargetsUnix;" Condition="'$(IsEnabledWindows)' == 'true'" />
84-
<MSBuild Projects="@(NetCoreDriver)" Properties="$(ProjectProperties);Platform=AnyCPU;OSGroup=AnyOS;" RemoveProperties="TargetsWindows;TargetsUnix;" />
83+
<MSBuild Projects="@(NetCoreDriver)" Properties="$(CI);$(ProjectProperties);Platform=AnyCPU;OSGroup=Unix;" RemoveProperties="TargetsWindows;TargetsUnix;" />
84+
<MSBuild Projects="@(NetCoreDriver)" Properties="$(CI);$(ProjectProperties);Platform=AnyCPU;OSGroup=Windows_NT;" RemoveProperties="TargetsWindows;TargetsUnix;" Condition="'$(IsEnabledWindows)' == 'true'" />
85+
<MSBuild Projects="@(NetCoreDriver)" Properties="$(CI);$(ProjectProperties);Platform=AnyCPU;OSGroup=AnyOS;" RemoveProperties="TargetsWindows;TargetsUnix;" />
8586
</Target>
8687

8788
<Target Name="BuildFunctionalTestsNetCore" DependsOnTargets="RestoreTestsNetCore">
@@ -114,21 +115,21 @@
114115

115116
<Target Name="BuildAKVNetFx" Condition="'$(IsEnabledWindows)' == 'true' AND !$(ReferenceType.Contains('NetStandard'))">
116117
<MSBuild Projects="@(AKVProvider)" Targets="restore" Properties="TestTargetOS=$(TestOS)netfx" />
117-
<MSBuild Projects="@(AKVProvider)" Properties="TestTargetOS=$(TestOS)netfx;Platform=$(Platform);$(TestProjectProperties)" />
118+
<MSBuild Projects="@(AKVProvider)" Properties="$(CI);TestTargetOS=$(TestOS)netfx;Platform=$(Platform);$(TestProjectProperties)" />
118119
</Target>
119120

120121
<Target Name="BuildAKVNetCore">
121122
<MSBuild Projects="@(AKVProvider)" Targets="restore" Properties="TestTargetOS=$(TestOS)netcoreapp" />
122123
<!-- Only build platform specific builds for Package reference types -->
123-
<MSBuild Projects="@(AKVProvider)" Properties="TestTargetOS=$(TestOS)netcoreapp;$(ProjectProperties);Platform=AnyCPU;" Condition="!$(ReferenceType.Contains('Package'))"/>
124-
<MSBuild Projects="@(AKVProvider)" Properties="TestTargetOS=$(TestOS)netcoreapp;$(ProjectProperties);Platform=$(Platform);" Condition="$(ReferenceType.Contains('Package'))"/>
124+
<MSBuild Projects="@(AKVProvider)" Properties="$(CI);TestTargetOS=$(TestOS)netcoreapp;$(ProjectProperties);Platform=AnyCPU;" Condition="!$(ReferenceType.Contains('Package'))"/>
125+
<MSBuild Projects="@(AKVProvider)" Properties="$(CI);TestTargetOS=$(TestOS)netcoreapp;$(ProjectProperties);Platform=$(Platform);" Condition="$(ReferenceType.Contains('Package'))"/>
125126
</Target>
126127

127128
<Target Name="BuildAKVNetCoreAllOS">
128129
<MSBuild Projects="@(AKVProvider)" Targets="restore" Properties="TestTargetOS=$(TestOS)netcoreapp" />
129-
<MSBuild Projects="@(AKVProvider)" Properties="TestTargetOS=$(TestOS)netcoreapp;$(ProjectProperties);Platform=AnyCPU;OSGroup=Unix;" RemoveProperties="TargetsWindows;TargetsUnix;" />
130-
<MSBuild Projects="@(AKVProvider)" Properties="TestTargetOS=$(TestOS)netcoreapp;$(ProjectProperties);Platform=AnyCPU;OSGroup=Windows_NT;" RemoveProperties="TargetsWindows;TargetsUnix;" Condition="'$(IsEnabledWindows)' == 'true'" />
131-
<MSBuild Projects="@(AKVProvider)" Properties="TestTargetOS=$(TestOS)netcoreapp;$(ProjectProperties);Platform=AnyCPU;OSGroup=AnyOS;" RemoveProperties="TargetsWindows;TargetsUnix;" />
130+
<MSBuild Projects="@(AKVProvider)" Properties="$(CI);TestTargetOS=$(TestOS)netcoreapp;$(ProjectProperties);Platform=AnyCPU;OSGroup=Unix;" RemoveProperties="TargetsWindows;TargetsUnix;" />
131+
<MSBuild Projects="@(AKVProvider)" Properties="$(CI);TestTargetOS=$(TestOS)netcoreapp;$(ProjectProperties);Platform=AnyCPU;OSGroup=Windows_NT;" RemoveProperties="TargetsWindows;TargetsUnix;" Condition="'$(IsEnabledWindows)' == 'true'" />
132+
<MSBuild Projects="@(AKVProvider)" Properties="$(CI);TestTargetOS=$(TestOS)netcoreapp;$(ProjectProperties);Platform=AnyCPU;OSGroup=AnyOS;" RemoveProperties="TargetsWindows;TargetsUnix;" />
132133
</Target>
133134

134135
</Project>

src/Directory.Build.props

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
<?xml version="1.0" encoding="utf-8"?>
2-
<Project ToolsVersion="Latest" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
2+
<Project ToolsVersion="Current" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
33
<PropertyGroup>
44
<TargetsWindows Condition="'$(OS)' == 'Windows_NT' AND '$(OSGroup)' == ''">true</TargetsWindows>
55
<TargetsWindows Condition="'$(OS)' != 'Windows_NT' AND '$(OSGroup)' == ''">false</TargetsWindows>
@@ -22,7 +22,16 @@
2222
> msbuild /p:configuration=Release
2323
-->
2424
<ReferenceType Condition="$(ReferenceType) == ''">Project</ReferenceType>
25+
<AllowedOutputExtensionsInPackageBuildOutputFolder>$(AllowedOutputExtensionsInPackageBuildOutputFolder);.pdb</AllowedOutputExtensionsInPackageBuildOutputFolder>
26+
<EmbedUntrackedSources>true</EmbedUntrackedSources>
2527
</PropertyGroup>
28+
<PropertyGroup>
29+
<TargetFrameworkMonikerAssemblyAttributesPath>$([System.IO.Path]::Combine('$(IntermediateOutputPath)','$(TargetFrameworkMoniker).AssemblyAttributes$(DefaultLanguageSourceExtension)'))</TargetFrameworkMonikerAssemblyAttributesPath>
30+
</PropertyGroup>
31+
<ItemGroup>
32+
<SourceRoot Include="$(MSBuildThisFileDirectory)/"/>
33+
<EmbeddedFiles Include="$(GeneratedAssemblyInfoFile)"/>
34+
</ItemGroup>
2635
<PropertyGroup Condition="$(Configuration.Contains('Debug'))">
2736
<DefineConstants>$(DefineConstants);DEBUG</DefineConstants>
2837
</PropertyGroup>

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

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,5 +26,6 @@
2626
<PackageReference Include="Microsoft.Azure.KeyVault.WebKey" Version="$(MicrosoftAzureKeyVaultWebKeyVersion)" />
2727
<PackageReference Include="Microsoft.Rest.ClientRuntime" Version="$(MicrosoftRestClientRuntimeVersion)" />
2828
<PackageReference Include="Microsoft.Rest.ClientRuntime.Azure" Version="$(MicrosoftRestClientRuntimeAzureVersion)" />
29+
<PackageReference Include="Microsoft.SourceLink.GitHub" Version="$(MicrosoftSourceLinkGitHubVersion)" PrivateAssets="All"/>
2930
</ItemGroup>
3031
</Project>

src/Microsoft.Data.SqlClient/add-ons/Directory.Build.props

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,22 @@
11
<?xml version="1.0" encoding="utf-8"?>
2-
<Project ToolsVersion="Latest" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
2+
<Project ToolsVersion="Current" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
33

44
<!-- Import parent Directory.build.props -->
55
<Import Project="..\..\Directory.Build.props" />
66

77
<PropertyGroup>
88
<ReferenceType Condition="'$(ReferenceType)'==''">Project</ReferenceType>
9+
<AllowedOutputExtensionsInPackageBuildOutputFolder>$(AllowedOutputExtensionsInPackageBuildOutputFolder);.pdb</AllowedOutputExtensionsInPackageBuildOutputFolder>
10+
<EmbedUntrackedSources>true</EmbedUntrackedSources>
11+
<ContinuousIntegrationBuild>true</ContinuousIntegrationBuild>
912
</PropertyGroup>
13+
14+
<PropertyGroup>
15+
<TargetFrameworkMonikerAssemblyAttributesPath>$([System.IO.Path]::Combine('$(IntermediateOutputPath)','$(TargetFrameworkMoniker).AssemblyAttributes$(DefaultLanguageSourceExtension)'))</TargetFrameworkMonikerAssemblyAttributesPath>
16+
</PropertyGroup>
17+
<ItemGroup>
18+
<EmbeddedFiles Include="$(GeneratedAssemblyInfoFile)"/>
19+
</ItemGroup>
1020

1121
<Choose>
1222
<!-- Set Default Target Framework when building for Debug and Release configurations. (Visual Studio) -->

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

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -771,6 +771,7 @@
771771
<PackageReference Include="System.Buffers" Version="$(SystemBuffersVersion)" />
772772
<PackageReference Include="System.Runtime.Caching" Version="$(SystemRuntimeCachingVersion)" />
773773
<PackageReference Include="System.Security.Cryptography.Cng" Version="$(SystemSecurityCryptographyCngVersion)" />
774+
<PackageReference Include="Microsoft.SourceLink.GitHub" Version="$(MicrosoftSourceLinkGitHubVersion)" PrivateAssets="All"/>
774775
</ItemGroup>
775776
<ItemGroup>
776777
<EmbeddedResource Update="Resources\Strings.resx">

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

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
<?xml version="1.0" encoding="utf-8"?>
2-
<Project ToolsVersion="Latest" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
2+
<Project ToolsVersion="Current" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
33
<Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" />
44
<PropertyGroup>
55
<ProjectGuid>{407890AC-9876-4FEF-A6F1-F36A876BAADE}</ProjectGuid>
@@ -22,6 +22,9 @@
2222
<ResolveComReferenceSilent>True</ResolveComReferenceSilent>
2323
<DefineConstants>$(DefineConstants);NETFRAMEWORK;</DefineConstants>
2424
</PropertyGroup>
25+
<PropertyGroup>
26+
<TargetFrameworkMonikerAssemblyAttributesPath>$([System.IO.Path]::Combine('$(IntermediateOutputPath)','$(GeneratedSourceFileName)'))</TargetFrameworkMonikerAssemblyAttributesPath>
27+
</PropertyGroup>
2528
<PropertyGroup>
2629
<!-- CSC Compiler Options -->
2730
<NoConfig>True</NoConfig>
@@ -499,6 +502,7 @@
499502
</COMReference>
500503
</ItemGroup>
501504
<ItemGroup>
505+
<PackageReference Include="Microsoft.SourceLink.GitHub" Version="$(MicrosoftSourceLinkGitHubVersion)" PrivateAssets="All" />
502506
<PackageReference Include="System.Security.Cryptography.Algorithms">
503507
<Version>$(SystemSecurityCryptographyAlgorithmsVersion)</Version>
504508
</PackageReference>
@@ -531,4 +535,4 @@
531535
<Import Project="$(NetFxSource)tools\targets\GenerateThisAssemblyCs.targets" />
532536
<Import Project="$(NetFxSource)tools\targets\GenerateAssemblyRef.targets" />
533537
<Import Project="$(NetFxSource)tools\targets\GenerateAssemblyInfo.targets" />
534-
</Project>
538+
</Project>

src/Microsoft.Data.SqlClient/tests/Directory.Build.props

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
<?xml version="1.0" encoding="utf-8"?>
2-
<Project ToolsVersion="Latest" DefaultTargets="Build"
2+
<Project ToolsVersion="Current" DefaultTargets="Build"
33
xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
44

55
<!-- Import parent Directory.build.props -->

src/Microsoft.Data.SqlClient/tests/tools/Directory.Build.props

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
<?xml version="1.0" encoding="utf-8"?>
2-
<Project ToolsVersion="Latest" DefaultTargets="Build"
2+
<Project ToolsVersion="Current" DefaultTargets="Build"
33
xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
44

55
<!-- Import parent Directory.build.props -->

tools/props/AssemblyInfo.props

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
<?xml version="1.0" encoding="utf-8"?>
2-
<Project ToolsVersion="Latest" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
2+
<Project ToolsVersion="Current" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
33
<PropertyGroup>
44
<Description>Microsoft.Data.SqlClient</Description>
55
<Authors>Microsoft</Authors>

0 commit comments

Comments
 (0)