You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

418 lines
28 KiB

AKV Official Pipeline (#3150) * In Solution: Move source projects under source folder, remove add-ons folder * Add engineering files to solution * Add new variables files for AKV (and v2) pipelines * ESRP signing step (and associated variables) * Renaming esrp steps * Adding steps for publishing AKV symbols * Adding nuget packaging steps * Make symbols publishing more generic * Add task for roslyn analyzers * Adding task for building AKV project * Finishing up wiring the tasks to jobs to pipeline * Fix errors, round 1 * Fix typo 1 * Fix errors in job file * Forgot a colon * Renaming SET step to make sure it follows convention * Apparently script needs to go first * Reworking the entire code signing and publish steps to use parameters instead of variables. * Fix parameter reference * Fix parameter reference 2 * Adding onebranch variables to pipeline * Fixing definition of common variables * Let's try again without the ob variables file * Uhhhh... * UH. * WTF. * Another attempt. * I'm confused. * Idk, let's try it how the docs say to do it. * Remove common variables group * bring back the onebranch variables? * Rework the AKV build target ... why the heck does the build.proj totally mess everything up * Fix typo with key path * Let's try this without the multiple lines? * What's wrong with YAML strings. * Fix mistake? * Maybe it doesn't like the extra spaces... * Debug the parameters! * Rename variables? * Ugh is this another one that doesn't support multi-line? * So apparently extra indenting means yaml preserves the dang newline. * More debug... * "Artifact" folder doesn't exist yet. Duh. * * Cleanup build.proj targets a tiny bit * Attempt to make roslyn work without indentations * Make sure project reference parameters are case-correct * Fix property definition in build.proj :shrug_man: * Fixing build.proj ... there's still some complexities in here that are breaking things * Copy the dll/pdb for ApiScan * Why even have array types if we can't use them * Rename file * Reinstating the tree command, fixing some path variables. * Fixing source path for apiscan extract * Man just when I think I get it, I don't get it. * Not sure why it matters if there is a slash at the end or not. But let's try it without one. * I guess variable templates can't depend on variables from other templates? * There's no type safety anywhere else, but there is when I want to print an array... * :expressionless: * Fix template name for symbols publishing step * Fix values name * Yeah, I don't know what's broken here. This is a random guess. * Parameter to symbols publishing step * Artifacts path != Build output artifacts folder * Remove \" * Language injection would've helped me with that * Needed some quote marks * Fix issue with network isolation * Rename buildPreview to runSdlTasks, cleanup a couple to-dos * Whoops. * Couple tweaks * Remove signing from roslyn analyzers * Removing one more to-do * I doubt case sensitivity matters here, but juuuuust in case, we can try it. * Disable nuget auditing on CI builds, remove KS2 from feature flags * Can I turn it off at all? * ContinuousIntegrationBuild is set later in the file. Use the base field * Only report to TSA on official builds * Convert to json * Ok whatever * I love it when examples don't actually work * What in the heck * THIS IS SO DUMB * Claude save me * Escape sequence fix * Fixing the replacement to be good * WORDS WORDS WORDS * Standardizing the quotes
5 months ago
AKV Official Pipeline (#3150) * In Solution: Move source projects under source folder, remove add-ons folder * Add engineering files to solution * Add new variables files for AKV (and v2) pipelines * ESRP signing step (and associated variables) * Renaming esrp steps * Adding steps for publishing AKV symbols * Adding nuget packaging steps * Make symbols publishing more generic * Add task for roslyn analyzers * Adding task for building AKV project * Finishing up wiring the tasks to jobs to pipeline * Fix errors, round 1 * Fix typo 1 * Fix errors in job file * Forgot a colon * Renaming SET step to make sure it follows convention * Apparently script needs to go first * Reworking the entire code signing and publish steps to use parameters instead of variables. * Fix parameter reference * Fix parameter reference 2 * Adding onebranch variables to pipeline * Fixing definition of common variables * Let's try again without the ob variables file * Uhhhh... * UH. * WTF. * Another attempt. * I'm confused. * Idk, let's try it how the docs say to do it. * Remove common variables group * bring back the onebranch variables? * Rework the AKV build target ... why the heck does the build.proj totally mess everything up * Fix typo with key path * Let's try this without the multiple lines? * What's wrong with YAML strings. * Fix mistake? * Maybe it doesn't like the extra spaces... * Debug the parameters! * Rename variables? * Ugh is this another one that doesn't support multi-line? * So apparently extra indenting means yaml preserves the dang newline. * More debug... * "Artifact" folder doesn't exist yet. Duh. * * Cleanup build.proj targets a tiny bit * Attempt to make roslyn work without indentations * Make sure project reference parameters are case-correct * Fix property definition in build.proj :shrug_man: * Fixing build.proj ... there's still some complexities in here that are breaking things * Copy the dll/pdb for ApiScan * Why even have array types if we can't use them * Rename file * Reinstating the tree command, fixing some path variables. * Fixing source path for apiscan extract * Man just when I think I get it, I don't get it. * Not sure why it matters if there is a slash at the end or not. But let's try it without one. * I guess variable templates can't depend on variables from other templates? * There's no type safety anywhere else, but there is when I want to print an array... * :expressionless: * Fix template name for symbols publishing step * Fix values name * Yeah, I don't know what's broken here. This is a random guess. * Parameter to symbols publishing step * Artifacts path != Build output artifacts folder * Remove \" * Language injection would've helped me with that * Needed some quote marks * Fix issue with network isolation * Rename buildPreview to runSdlTasks, cleanup a couple to-dos * Whoops. * Couple tweaks * Remove signing from roslyn analyzers * Removing one more to-do * I doubt case sensitivity matters here, but juuuuust in case, we can try it. * Disable nuget auditing on CI builds, remove KS2 from feature flags * Can I turn it off at all? * ContinuousIntegrationBuild is set later in the file. Use the base field * Only report to TSA on official builds * Convert to json * Ok whatever * I love it when examples don't actually work * What in the heck * THIS IS SO DUMB * Claude save me * Escape sequence fix * Fixing the replacement to be good * WORDS WORDS WORDS * Standardizing the quotes
5 months ago
AKV Official Pipeline (#3150) * In Solution: Move source projects under source folder, remove add-ons folder * Add engineering files to solution * Add new variables files for AKV (and v2) pipelines * ESRP signing step (and associated variables) * Renaming esrp steps * Adding steps for publishing AKV symbols * Adding nuget packaging steps * Make symbols publishing more generic * Add task for roslyn analyzers * Adding task for building AKV project * Finishing up wiring the tasks to jobs to pipeline * Fix errors, round 1 * Fix typo 1 * Fix errors in job file * Forgot a colon * Renaming SET step to make sure it follows convention * Apparently script needs to go first * Reworking the entire code signing and publish steps to use parameters instead of variables. * Fix parameter reference * Fix parameter reference 2 * Adding onebranch variables to pipeline * Fixing definition of common variables * Let's try again without the ob variables file * Uhhhh... * UH. * WTF. * Another attempt. * I'm confused. * Idk, let's try it how the docs say to do it. * Remove common variables group * bring back the onebranch variables? * Rework the AKV build target ... why the heck does the build.proj totally mess everything up * Fix typo with key path * Let's try this without the multiple lines? * What's wrong with YAML strings. * Fix mistake? * Maybe it doesn't like the extra spaces... * Debug the parameters! * Rename variables? * Ugh is this another one that doesn't support multi-line? * So apparently extra indenting means yaml preserves the dang newline. * More debug... * "Artifact" folder doesn't exist yet. Duh. * * Cleanup build.proj targets a tiny bit * Attempt to make roslyn work without indentations * Make sure project reference parameters are case-correct * Fix property definition in build.proj :shrug_man: * Fixing build.proj ... there's still some complexities in here that are breaking things * Copy the dll/pdb for ApiScan * Why even have array types if we can't use them * Rename file * Reinstating the tree command, fixing some path variables. * Fixing source path for apiscan extract * Man just when I think I get it, I don't get it. * Not sure why it matters if there is a slash at the end or not. But let's try it without one. * I guess variable templates can't depend on variables from other templates? * There's no type safety anywhere else, but there is when I want to print an array... * :expressionless: * Fix template name for symbols publishing step * Fix values name * Yeah, I don't know what's broken here. This is a random guess. * Parameter to symbols publishing step * Artifacts path != Build output artifacts folder * Remove \" * Language injection would've helped me with that * Needed some quote marks * Fix issue with network isolation * Rename buildPreview to runSdlTasks, cleanup a couple to-dos * Whoops. * Couple tweaks * Remove signing from roslyn analyzers * Removing one more to-do * I doubt case sensitivity matters here, but juuuuust in case, we can try it. * Disable nuget auditing on CI builds, remove KS2 from feature flags * Can I turn it off at all? * ContinuousIntegrationBuild is set later in the file. Use the base field * Only report to TSA on official builds * Convert to json * Ok whatever * I love it when examples don't actually work * What in the heck * THIS IS SO DUMB * Claude save me * Escape sequence fix * Fixing the replacement to be good * WORDS WORDS WORDS * Standardizing the quotes
5 months ago
AKV Official Pipeline (#3150) * In Solution: Move source projects under source folder, remove add-ons folder * Add engineering files to solution * Add new variables files for AKV (and v2) pipelines * ESRP signing step (and associated variables) * Renaming esrp steps * Adding steps for publishing AKV symbols * Adding nuget packaging steps * Make symbols publishing more generic * Add task for roslyn analyzers * Adding task for building AKV project * Finishing up wiring the tasks to jobs to pipeline * Fix errors, round 1 * Fix typo 1 * Fix errors in job file * Forgot a colon * Renaming SET step to make sure it follows convention * Apparently script needs to go first * Reworking the entire code signing and publish steps to use parameters instead of variables. * Fix parameter reference * Fix parameter reference 2 * Adding onebranch variables to pipeline * Fixing definition of common variables * Let's try again without the ob variables file * Uhhhh... * UH. * WTF. * Another attempt. * I'm confused. * Idk, let's try it how the docs say to do it. * Remove common variables group * bring back the onebranch variables? * Rework the AKV build target ... why the heck does the build.proj totally mess everything up * Fix typo with key path * Let's try this without the multiple lines? * What's wrong with YAML strings. * Fix mistake? * Maybe it doesn't like the extra spaces... * Debug the parameters! * Rename variables? * Ugh is this another one that doesn't support multi-line? * So apparently extra indenting means yaml preserves the dang newline. * More debug... * "Artifact" folder doesn't exist yet. Duh. * * Cleanup build.proj targets a tiny bit * Attempt to make roslyn work without indentations * Make sure project reference parameters are case-correct * Fix property definition in build.proj :shrug_man: * Fixing build.proj ... there's still some complexities in here that are breaking things * Copy the dll/pdb for ApiScan * Why even have array types if we can't use them * Rename file * Reinstating the tree command, fixing some path variables. * Fixing source path for apiscan extract * Man just when I think I get it, I don't get it. * Not sure why it matters if there is a slash at the end or not. But let's try it without one. * I guess variable templates can't depend on variables from other templates? * There's no type safety anywhere else, but there is when I want to print an array... * :expressionless: * Fix template name for symbols publishing step * Fix values name * Yeah, I don't know what's broken here. This is a random guess. * Parameter to symbols publishing step * Artifacts path != Build output artifacts folder * Remove \" * Language injection would've helped me with that * Needed some quote marks * Fix issue with network isolation * Rename buildPreview to runSdlTasks, cleanup a couple to-dos * Whoops. * Couple tweaks * Remove signing from roslyn analyzers * Removing one more to-do * I doubt case sensitivity matters here, but juuuuust in case, we can try it. * Disable nuget auditing on CI builds, remove KS2 from feature flags * Can I turn it off at all? * ContinuousIntegrationBuild is set later in the file. Use the base field * Only report to TSA on official builds * Convert to json * Ok whatever * I love it when examples don't actually work * What in the heck * THIS IS SO DUMB * Claude save me * Escape sequence fix * Fixing the replacement to be good * WORDS WORDS WORDS * Standardizing the quotes
5 months ago
  1. <?xml version="1.0" encoding="utf-8"?>
  2. <Project ToolsVersion="Current" DefaultTargets="BuildAllConfigurations" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
  3. <Import Project="src/Directory.Build.props" />
  4. <Import Project="$(ToolsDir)targets\GenerateNugetPackage.targets" />
  5. <Import Project="$(ToolsDir)targets\add-ons\GenerateAKVProviderNugetPackage.targets" />
  6. <PropertyGroup>
  7. <!-- SourceLink variable-->
  8. <DisableSourceLink>false</DisableSourceLink>
  9. <RestoreConfigFile>src\NuGet.config</RestoreConfigFile>
  10. <Configuration Condition="'$(Configuration)' == ''">Debug</Configuration>
  11. <Platform Condition="'$(Platform)' == ''">AnyCPU</Platform>
  12. <!-- Flag to control whether or not to build Microsoft.DotNet.GenAPI project in tools -->
  13. <BuildTools Condition="'$(BuildTools)' == ''">true</BuildTools>
  14. <!-- Flag to control if Windows drivers should be built or not -->
  15. <IsEnabledWindows Condition="'$(IsEnabledWindows)' == '' AND '$(TargetsWindows)' == 'true'">true</IsEnabledWindows>
  16. <IsEnabledWindows Condition="'$(TargetsUnix)' == 'true'">false</IsEnabledWindows>
  17. <TestOS Condition="'$(TestTargetOS)' == '' AND '$(TargetsWindows)' == 'true'">Windows</TestOS>
  18. <TestOS Condition="'$(TestTargetOS)' == '' AND '$(TargetsUnix)' == 'true'">Unix</TestOS>
  19. <TF Condition="$(TF) == ''">net9.0</TF> <!-- Default Target Framework -->
  20. <TFGroup Condition="'$([MSBuild]::GetTargetFrameworkIdentifier($(TF)))' == '.NETFramework'">netfx</TFGroup>
  21. <TFGroup Condition="'$([MSBuild]::GetTargetFrameworkIdentifier($(TF)))' == '.NETCoreApp'">netcore</TFGroup>
  22. <TargetGroup Condition="'$(TFGroup)' == 'netfx'">netfx</TargetGroup>
  23. <TargetGroup Condition="'$(TFGroup)' == 'netcore'">netcoreapp</TargetGroup>
  24. <TargetNetCoreVersion Condition="$(TargetGroup) == 'netcoreapp' AND $(TargetNetCoreVersion) == ''">$(TF)</TargetNetCoreVersion>
  25. <TargetNetFxVersion Condition="$(TargetGroup) == 'netfx' AND $(TargetNetFxVersion) == ''">$(TF)</TargetNetFxVersion>
  26. <GenerateNuget Condition="'$(GenerateNuget)' == '' AND '$(IsEnabledWindows)' == 'true'">true</GenerateNuget>
  27. <SqlServerLibProperties>Configuration=$(Configuration);AssemblyVersion=$(SqlServerAssemblyVersion);AssemblyFileVersion=$(SqlServerAssemblyFileVersion);Version=$(SqlServerPackageVersion);</SqlServerLibProperties>
  28. <ProjectProperties>Configuration=$(Configuration);AssemblyFileVersion=$(AssemblyFileVersion);TargetsWindows=$(TargetsWindows);TargetsUnix=$(TargetsUnix);</ProjectProperties>
  29. <TestProjectProperties>BuildProjectReferences=false;$(ProjectProperties);BuildForRelease=false;TargetNetCoreVersion=$(TargetNetCoreVersion);TargetNetFxVersion=$(TargetNetFxVersion)</TestProjectProperties>
  30. <ResultsDirectory Condition="$(ResultsDirectory) == ''">TestResults</ResultsDirectory>
  31. <!--
  32. Path to a `dotnet` version like a x86 or any especific versions in addition to a default installed version.
  33. This property is empty by default to use the default path of the system's path variable.
  34. The provided path should be ended to a `\` character without white spaces: Ex. C:\x86\
  35. -->
  36. <DotnetPath></DotnetPath>
  37. <!-- Using these properties to compile and pack netfx dll fixes nuget package explorer error "Compiler flags: missing" -->
  38. <NugetPackProperties>DebugType=portable;DebugSymbols=true;IncludeSymbols=true;SymbolPackageFormat=snupkg;PublishRepositoryUrl=true;RepositoryUrl=https://github.com/dotnet/sqlclient;RepositoryType=git;EmbedUnTrackedSources=true;Deterministic=true;</NugetPackProperties>
  39. <!-- TF_BUILD is enabled only within AzureDevOps pipeline to support continuous integation build. -->
  40. <NugetPackProperties Condition="'$(TF_BUILD)' == 'true'">$(NugetPackProperties);ContinuousIntegrationBuild=true;</NugetPackProperties>
  41. </PropertyGroup>
  42. <!-- Release Build properties must be turned on for Release purposes, and turned off for Code Coverage calculations -->
  43. <PropertyGroup>
  44. <BuildForRelease Condition="$(BuildForRelease) == ''">true</BuildForRelease>
  45. <CI>ContinuousIntegrationBuild=$(BuildForRelease);EmbedUntrackedSources=$(BuildForRelease)</CI>
  46. </PropertyGroup>
  47. <!-- Populate all managed projects -->
  48. <ItemGroup>
  49. <SqlServerLib Include="**/Microsoft.SqlServer.Server.csproj" />
  50. <NetFxDriver Include="**/netfx/**/Microsoft.Data.SqlClient*.csproj" Condition="'$(IsEnabledWindows)' == 'true'" />
  51. <NetCoreDriver Include="**/netcore/**/Microsoft.Data.SqlClient*.csproj" />
  52. <!-- Used to build .NET Standard DLL for lib folder from this project. -->
  53. <NetStandardDriver Include="**/netcore/ref/Microsoft.Data.SqlClient*.csproj" />
  54. <AKVProvider Include="**/add-ons/**/AzureKeyVaultProvider/*.csproj" />
  55. <UnitTests Include="**/UnitTests/Microsoft.Data.SqlClient.UnitTests.csproj" />
  56. <UnitTestsProj Include="**/UnitTests/Microsoft.Data.SqlClient.UnitTests.csproj" />
  57. <FunctionalTests Include="**/Common/Common.csproj" />
  58. <FunctionalTests Include="**/tools/TDS/TDS/TDS.csproj" />
  59. <FunctionalTests Include="**/tools/TDS/TDS.EndPoint/TDS.EndPoint.csproj" />
  60. <FunctionalTests Include="**/tools/TDS/TDS.Servers/TDS.Servers.csproj" />
  61. <FunctionalTests Include="**/tools/Microsoft.Data.SqlClient.TestUtilities/Microsoft.Data.SqlClient.TestUtilities.csproj" />
  62. <FunctionalTests Include="**/tools/CoreFx.Private.TestUtilities/CoreFx.Private.TestUtilities.csproj" />
  63. <FunctionalTests Include="**/ManualTests/SQL/UdtTest/UDTs/Address/Address.csproj" />
  64. <FunctionalTests Include="**/FunctionalTests/Microsoft.Data.SqlClient.FunctionalTests.csproj" />
  65. <FunctionalTestsProj Include="**/FunctionalTests/Microsoft.Data.SqlClient.FunctionalTests.csproj" />
  66. <ManualTests Include="**/Common/Common.csproj" />
  67. <ManualTests Include="**/ManualTests/SQL/UdtTest/UDTs/Address/Address.csproj" />
  68. <ManualTests Include="**/ManualTests/SQL/UdtTest/UDTs/Circle/Circle.csproj" />
  69. <ManualTests Include="**/ManualTests/SQL/UdtTest/UDTs/Shapes/Shapes.csproj" />
  70. <ManualTests Include="**/ManualTests/SQL/UdtTest/UDTs/Utf8String/Utf8String.csproj" />
  71. <ManualTests Include="**/tools/Microsoft.Data.SqlClient.TestUtilities/Microsoft.Data.SqlClient.TestUtilities.csproj" />
  72. <ManualTests Include="**/tools/CoreFx.Private.TestUtilities/CoreFx.Private.TestUtilities.csproj" />
  73. <ManualTests Include="**/CustomConfigurableRetryLogic/CustomRetryLogicProvider.csproj" />
  74. <ManualTests Include="**/ManualTests/Microsoft.Data.SqlClient.ManualTesting.Tests.csproj" />
  75. <ManualTestsProj Include="**/ManualTests/Microsoft.Data.SqlClient.ManualTesting.Tests.csproj" />
  76. </ItemGroup>
  77. <!-- Top Level Build targets -->
  78. <Target Name="Restore" DependsOnTargets="RestoreSqlServerLib;RestoreNetCore;RestoreNetFx" />
  79. <Target Name="BuildAll" DependsOnTargets="BuildSqlServerLib;BuildNetFx;BuildNetCore;BuildNetStandard" />
  80. <Target Name="BuildAllConfigurations" DependsOnTargets="Restore;BuildTools;BuildSqlServerLib;BuildNetFx;BuildNetCoreAllOS;BuildNetStandard;GenerateNugetPackage" />
  81. <Target Name="BuildSqlServerPackage" DependsOnTargets="BuildSqlServerLibAnyOS;GenerateSqlServerPackage"/>
  82. <Target Name="BuildTestsNetCore" DependsOnTargets="RestoreTestsNetCore;BuildAKVNetCore;BuildUnitTestsNetCore;BuildFunctionalTestsNetCore;BuildManualTestsNetCore"/>
  83. <Target Name="BuildTestsNetFx" DependsOnTargets="RestoreTestsNetFx;BuildAKVNetFx;BuildUnitTestsNetFx;BuildFunctionalTestsNetFx;BuildManualTestsNetFx" Condition="$(IsEnabledWindows) == 'true'"/>
  84. <Target Name="RestoreSqlServerLib">
  85. <MSBuild Projects="@(SqlServerLib)" Targets="restore" />
  86. </Target>
  87. <Target Name="RestoreNetCore">
  88. <MSBuild Projects="@(NetCoreDriver)" Targets="restore" />
  89. </Target>
  90. <Target Name="RestoreTestsNetCore">
  91. <MSBuild Projects="@(ManualTests)" Targets="restore" Properties="$(TestProjectProperties)" />
  92. <MSBuild Projects="@(FunctionalTests)" Targets="restore" Properties="$(TestProjectProperties)" />
  93. <MSBuild Projects="@(UnitTests)" Targets="restore" Properties="$(TestProjectProperties)"/>
  94. </Target>
  95. <Target Name="RestoreNetFx" Condition="'$(IsEnabledWindows)' == 'true'">
  96. <MSBuild Projects="@(NetFxDriver)" Targets="restore" />
  97. </Target>
  98. <Target Name="RestoreTestsNetFx" Condition="'$(IsEnabledWindows)' == 'true'">
  99. <MSBuild Projects="@(ManualTests)" Targets="restore" Properties="$(TestProjectProperties)" />
  100. <MSBuild Projects="@(FunctionalTests)" Targets="restore" Properties="$(TestProjectProperties)" />
  101. <MSBuild Projects="@(UnitTests)" Targets="restore" Properties="$(TestProjectProperties)"/>
  102. </Target>
  103. <Target Name="BuildTools" Condition="'$(BuildTools)' == 'true'">
  104. <PropertyGroup>
  105. <DotnetBuildCmd>dotnet build -c Release -p:ReferenceType=$(ReferenceType)</DotnetBuildCmd>
  106. </PropertyGroup>
  107. <Exec Command="$(DotnetBuildCmd)" WorkingDirectory="$(GenAPISrcDir)Microsoft.DotNet.GenAPI\" />
  108. </Target>
  109. <Target Name="BuildNetFx" DependsOnTargets="RestoreNetFx" Condition="'$(IsEnabledWindows)' == 'true'">
  110. <MSBuild Projects="@(NetFxDriver)" Properties="$(CI);Platform=AnyCPU;$(ProjectProperties);$(NugetPackProperties);" />
  111. </Target>
  112. <Target Name="BuildSqlServerLibAnyOS" DependsOnTargets="RestoreSqlServerLib">
  113. <MSBuild Projects="@(SqlServerLib)" Properties="$(CI);$(SqlServerLibProperties);Platform=AnyCPU;OSGroup=AnyOS" RemoveProperties="TargetsWindows;TargetsUnix;" />
  114. </Target>
  115. <Target Name="BuildSqlServerLib" DependsOnTargets="RestoreSqlServerLib">
  116. <Message Text=">>> Building SqlServerLib [$(CI);$(SqlServerLibProperties);Platform=AnyCPU;ReferenceType=$(ReferenceType);] ..." Condition="!$(ReferenceType.Contains('Package'))" />
  117. <MSBuild Projects="@(SqlServerLib)" Properties="$(CI);$(SqlServerLibProperties);Platform=AnyCPU;" RemoveProperties="TargetsWindows;TargetsUnix;" Condition="!$(ReferenceType.Contains('Package'))" />
  118. <!-- Only build platform specific builds for Package reference types -->
  119. <Message Text=">>> Building SqlServerLib [$(CI);$(SqlServerLibProperties);Platform=$(Platform);ReferenceType=$(ReferenceType);] ..." Condition="$(ReferenceType.Contains('Package'))" />
  120. <MSBuild Projects="@(SqlServerLib)" Properties="$(CI);$(SqlServerLibProperties);Platform=$(Platform);" Condition="$(ReferenceType.Contains('Package'))" />
  121. </Target>
  122. <Target Name="BuildNetCore" DependsOnTargets="RestoreNetCore">
  123. <MSBuild Projects="@(NetCoreDriver)" Properties="$(CI);Platform=AnyCPU;$(ProjectProperties)" />
  124. </Target>
  125. <Target Name="BuildNetCoreAllOS" DependsOnTargets="RestoreNetCore">
  126. <MSBuild Projects="@(NetCoreDriver)" Properties="$(CI);$(ProjectProperties);Platform=AnyCPU;OSGroup=Unix;" RemoveProperties="TargetsWindows;TargetsUnix;" />
  127. <MSBuild Projects="@(NetCoreDriver)" Properties="$(CI);$(ProjectProperties);Platform=AnyCPU;OSGroup=Windows_NT;" RemoveProperties="TargetsWindows;TargetsUnix;" Condition="'$(IsEnabledWindows)' == 'true'" />
  128. <MSBuild Projects="@(NetCoreDriver)" Properties="$(CI);$(ProjectProperties);Platform=AnyCPU;OSGroup=AnyOS;" RemoveProperties="TargetsWindows;TargetsUnix;" />
  129. </Target>
  130. <!-- Build .NET Standard target DLLs for Lib folder from here.
  131. This target enables BuildForLib for the NetCore ref project. -->
  132. <Target Name="BuildNetStandard">
  133. <MSBuild Projects="@(NetStandardDriver)" Properties="$(CI);$(ProjectProperties);Platform=AnyCPU;OSGroup=AnyOS;BuildForLib=True" RemoveProperties="TargetsWindows;TargetsUnix;" />
  134. </Target>
  135. <Target Name="BuildUnitTestsNetCore" DependsOnTargets="RestoreTestsNetCore" Condition="$(ReferenceType.Contains('Project'))">
  136. <Message Text=">>> Building UnitTestsNetCore [TestTargetOS=$(TestOS)netcoreapp;$(TestProjectProperties);Platform=AnyCPU;ReferenceType=$(ReferenceType);] ..." Condition="!$(ReferenceType.Contains('Package'))"/>
  137. <MSBuild Projects="@(UnitTests)" Properties="TestTargetOS=$(TestOS)netcoreapp;$(TestProjectProperties);Platform=AnyCPU;" Condition="!$(ReferenceType.Contains('Package'))" />
  138. </Target>
  139. <Target Name="BuildFunctionalTestsNetCore" DependsOnTargets="RestoreTestsNetCore">
  140. <Message Text=">>> Building FunctionalTestsNetCore [TestTargetOS=$(TestOS)netcoreapp;$(TestProjectProperties);Platform=AnyCPU;ReferenceType=$(ReferenceType);] ..." Condition="!$(ReferenceType.Contains('Package'))" />
  141. <MSBuild Projects="@(FunctionalTests)" Properties="TestTargetOS=$(TestOS)netcoreapp;$(TestProjectProperties);Platform=AnyCPU;" Condition="!$(ReferenceType.Contains('Package'))" />
  142. <!-- Only build platform specific builds for Package reference types -->
  143. <Message Text=">>> Building FunctionalTestsNetCore [TestTargetOS=$(TestOS)netcoreapp;$(TestProjectProperties);Platform=$(Platform);ReferenceType=$(ReferenceType);] ..." Condition="$(ReferenceType.Contains('Package'))" />
  144. <MSBuild Projects="@(FunctionalTests)" Properties="TestTargetOS=$(TestOS)netcoreapp;$(TestProjectProperties);Platform=$(Platform);" Condition="$(ReferenceType.Contains('Package'))" />
  145. </Target>
  146. <Target Name="BuildManualTestsNetCore" DependsOnTargets="RestoreTestsNetCore">
  147. <Message Text=">>> Building ManualTestsNetCore [TestTargetOS=$(TestOS)netcoreapp;$(TestProjectProperties);Platform=AnyCPU;ReferenceType=$(ReferenceType);] ..." Condition="!$(ReferenceType.Contains('Package'))" />
  148. <MSBuild Projects="@(ManualTests)" Properties="TestTargetOS=$(TestOS)netcoreapp;$(TestProjectProperties);Platform=AnyCPU;" Condition="!$(ReferenceType.Contains('Package'))" />
  149. <!-- Only build platform specific builds for Package reference types -->
  150. <Message Text=">>> Building ManualTestsNetCore [TestTargetOS=$(TestOS)netcoreapp;$(TestProjectProperties);Platform=$(Platform);ReferenceType=$(ReferenceType);] ..." Condition="$(ReferenceType.Contains('Package'))" />
  151. <MSBuild Projects="@(ManualTests)" Properties="TestTargetOS=$(TestOS)netcoreapp;$(TestProjectProperties);Platform=$(Platform);" Condition="$(ReferenceType.Contains('Package'))" />
  152. </Target>
  153. <Target Name="BuildUnitTestsNetFx" DependsOnTargets="RestoreTestsNetFx" Condition="'$(IsEnabledWindows)' == 'true' AND $(ReferenceType.Contains('Project'))">
  154. <Message Text=">>> Building UnitTestsNetFx [TestTargetOS=$(TestOS)netfx;$(TestProjectProperties);Platform=AnyCPU;] ..." Condition="!$(ReferenceType.Contains('Package'))"/>
  155. <MSBuild Projects="@(UnitTests)" Properties="TestTargetOS=$(TestOS)netfx;$(TestProjectProperties);Platform=AnyCPU;" Condition="!$(ReferenceType.Contains('Package'))"/>
  156. </Target>
  157. <Target Name="BuildFunctionalTestsNetFx" DependsOnTargets="RestoreTestsNetFx" Condition="'$(IsEnabledWindows)' == 'true'">
  158. <Message Text=">>> Building FunctionalTestsNetFx [TestTargetOS=$(TestOS)netfx;$(TestProjectProperties);Platform=AnyCPU;] ..." Condition="!$(ReferenceType.Contains('Package'))" />
  159. <MSBuild Projects="@(FunctionalTests)" Properties="TestTargetOS=$(TestOS)netfx;$(TestProjectProperties);Platform=AnyCPU;" Condition="!$(ReferenceType.Contains('Package'))" />
  160. <!-- Only build platform specific builds for Package reference types -->
  161. <Message Text=">>> Building FunctionalTestsNetFx [TestTargetOS=$(TestOS)netfx;$(TestProjectProperties);Platform=$(Platform);] ..." Condition="$(ReferenceType.Contains('Package'))" />
  162. <MSBuild Projects="@(FunctionalTests)" Properties="TestTargetOS=$(TestOS)netfx;$(TestProjectProperties);Platform=$(Platform);" Condition="$(ReferenceType.Contains('Package'))" />
  163. </Target>
  164. <Target Name="BuildManualTestsNetFx" DependsOnTargets="RestoreTestsNetFx" Condition="'$(IsEnabledWindows)' == 'true'">
  165. <Message Text=">>> Building ManualTestsNetFx [TestTargetOS=$(TestOS)netfx;$(TestProjectProperties);Platform=AnyCPU;] ..." Condition="!$(ReferenceType.Contains('Package'))" />
  166. <MSBuild Projects="@(ManualTests)" Properties="TestTargetOS=$(TestOS)netfx;$(TestProjectProperties);Platform=AnyCPU;" Condition="!$(ReferenceType.Contains('Package'))" />
  167. <!-- Only build platform specific builds for Package reference types -->
  168. <Message Text=">>> Building ManualTestsNetFx [TestTargetOS=$(TestOS)netfx;$(TestProjectProperties);Platform=$(Platform);] ..." Condition="$(ReferenceType.Contains('Package'))" />
  169. <MSBuild Projects="@(ManualTests)" Properties="TestTargetOS=$(TestOS)netfx;$(TestProjectProperties);Platform=$(Platform);" Condition="$(ReferenceType.Contains('Package'))" />
  170. </Target>
  171. <!-- Tests -->
  172. <!-- Run all tests applicable to the host OS. -->
  173. <Target Name="RunTests" DependsOnTargets="RunUnitTests;RunFunctionalTests;RunManualTests"/>
  174. <!-- Run all unit tests applicable to the host OS. -->
  175. <Target Name="RunUnitTests" DependsOnTargets="RunUnitTestsWindows;RunUnitTestsUnix" Condition="$(ReferenceType.Contains('Project'))"/>
  176. <!-- Run all unit tests applicable to Windows. -->
  177. <Target Name="RunUnitTestsWindows" Condition="'$(IsEnabledWindows)' == 'true' AND $(ReferenceType.Contains('Project'))">
  178. <PropertyGroup>
  179. <TestCommand>
  180. $(DotnetPath)dotnet test "@(UnitTestsProj)"
  181. --no-build
  182. -v n
  183. -p:Configuration=$(Configuration)
  184. -p:Target$(TFGroup)Version=$(TF)
  185. -p:TestTargetOS=Windows$(TargetGroup)
  186. --collect "Code coverage"
  187. --results-directory $(ResultsDirectory)
  188. --logger:"trx;LogFilePrefix=Unit-Windows$(TargetGroup)-$(TestSet)"
  189. </TestCommand>
  190. <TestCommand>$(TestCommand.Replace($([System.Environment]::NewLine), " "))</TestCommand>
  191. </PropertyGroup>
  192. <Message Text=">>> Running unit tests for Windows via command: $(TestCommand)"/>
  193. <Exec ConsoleToMsBuild="true" Command="$(TestCommand)"/>
  194. </Target>
  195. <!-- Run all unit tests applicable to Unix. -->
  196. <Target Name="RunUnitTestsUnix" Condition="'$(IsEnabledWindows)' != 'true' AND $(ReferenceType.Contains('Project'))">
  197. <PropertyGroup>
  198. <TestCommand>
  199. $(DotnetPath)dotnet test "@(UnitTestsProj)"
  200. --no-build
  201. -v n
  202. -p:Configuration=$(Configuration)
  203. -p:TargetNetCoreVersion=$(TF)
  204. -p:TestTargetOS=Unixnetcoreapp
  205. --collect "Code coverage"
  206. --results-directory $(ResultsDirectory)
  207. --logger:"trx;LogFilePrefix=Unit-Unixnetcoreapp-$(TestSet)"
  208. </TestCommand>
  209. <TestCommand>$(TestCommand.Replace($([System.Environment]::NewLine), " "))</TestCommand>
  210. </PropertyGroup>
  211. <Message Text=">>> Running unit tests for Unix via command: $(TestCommand)"/>
  212. <Exec ConsoleToMsBuild="true" Command="$(TestCommand)"/>
  213. </Target>
  214. <!-- Run all Functional tests applicable to the host OS. -->
  215. <Target Name="RunFunctionalTests" DependsOnTargets="RunFunctionalTestsWindows;RunFunctionalTestsUnix" />
  216. <!-- Run all Functional tests applicable to Windows. -->
  217. <Target Name="RunFunctionalTestsWindows" Condition="'$(IsEnabledWindows)' == 'true'">
  218. <PropertyGroup>
  219. <TestCommand>
  220. $(DotnetPath)dotnet test "@(FunctionalTestsProj)"
  221. --no-build
  222. -v n
  223. -p:Configuration=$(Configuration)
  224. -p:Target$(TFGroup)Version=$(TF)
  225. -p:ReferenceType=$(ReferenceType)
  226. -p:TestSet=$(TestSet)
  227. -p:TestTargetOS=Windows$(TargetGroup)
  228. --collect "Code coverage"
  229. --results-directory $(ResultsDirectory)
  230. --filter "category!=non$(TargetGroup)tests&amp;category!=failing&amp;category!=nonwindowstests"
  231. --logger:"trx;LogFilePrefix=Functional-Windows$(TargetGroup)-$(TestSet)"
  232. </TestCommand>
  233. <TestCommand>$(TestCommand.Replace($([System.Environment]::NewLine), " "))</TestCommand>
  234. </PropertyGroup>
  235. <Message Text=">>> Running Functional test for Windows via command: $(TestCommand)" />
  236. <Exec ConsoleToMsBuild="true" Command="$(TestCommand)" />
  237. </Target>
  238. <!-- Run all Functional tests applicable to Unix. -->
  239. <Target Name="RunFunctionalTestsUnix" Condition="'$(IsEnabledWindows)' != 'true'">
  240. <PropertyGroup>
  241. <TestCommand>
  242. $(DotnetPath)dotnet test "@(FunctionalTestsProj)"
  243. --no-build
  244. -v n
  245. -p:Configuration=$(Configuration)
  246. -p:TargetNetCoreVersion=$(TF)
  247. -p:ReferenceType=$(ReferenceType)
  248. -p:TestSet=$(TestSet)
  249. -p:TestTargetOS=Unixnetcoreapp
  250. --collect "Code coverage"
  251. --results-directory $(ResultsDirectory)
  252. --filter "category!=nonnetcoreapptests&amp;category!=failing&amp;category!=nonlinuxtests&amp;category!=nonuaptests"
  253. --logger:"trx;LogFilePrefix=Functional-Unixnetcoreapp-$(TestSet)"
  254. </TestCommand>
  255. <TestCommand>$(TestCommand.Replace($([System.Environment]::NewLine), " "))</TestCommand>
  256. </PropertyGroup>
  257. <Message Text=">>> Running Functional test for Unix via command: $(TestCommand)" />
  258. <Exec ConsoleToMsBuild="true" Command="$(TestCommand)" />
  259. </Target>
  260. <!-- Run all Manual tests applicable to the host OS. -->
  261. <Target Name="RunManualTests" DependsOnTargets="RunManualTestsWindows;RunManualTestsUnix" />
  262. <!-- Run all Manual tests applicable to Windows. -->
  263. <Target Name="RunManualTestsWindows" Condition="'$(IsEnabledWindows)' == 'true'">
  264. <PropertyGroup>
  265. <TestCommand>
  266. $(DotnetPath)dotnet test "@(ManualTestsProj)"
  267. --no-build
  268. -v n
  269. -p:Configuration=$(Configuration)
  270. -p:Target$(TFGroup)Version=$(TF)
  271. -p:ReferenceType=$(ReferenceType)
  272. -p:TestSet=$(TestSet)
  273. -p:TestTargetOS=Windows$(TargetGroup)
  274. --collect "Code coverage"
  275. --results-directory $(ResultsDirectory)
  276. --filter "category!=non$(TargetGroup)tests&amp;category!=failing&amp;category!=nonwindowstests"
  277. --logger:"trx;LogFilePrefix=Manual-Windows$(TargetGroup)-$(TestSet)"
  278. </TestCommand>
  279. <TestCommand>$(TestCommand.Replace($([System.Environment]::NewLine), " "))</TestCommand>
  280. </PropertyGroup>
  281. <Message Text=">>> Running Manual test for Windows via command: $(TestCommand)" />
  282. <Exec ConsoleToMsBuild="true" Command="$(TestCommand)" />
  283. </Target>
  284. <!-- Run all Manual tests applicable to Unix. -->
  285. <Target Name="RunManualTestsUnix" Condition="'$(IsEnabledWindows)' != 'true'">
  286. <PropertyGroup>
  287. <TestCommand>
  288. $(DotnetPath)dotnet test "@(ManualTestsProj)"
  289. --no-build
  290. -v n
  291. -p:Configuration=$(Configuration)
  292. -p:TargetNetCoreVersion=$(TF)
  293. -p:ReferenceType=$(ReferenceType)
  294. -p:TestSet=$(TestSet)
  295. -p:TestTargetOS=Unixnetcoreapp
  296. --collect "Code coverage"
  297. --results-directory $(ResultsDirectory)
  298. --filter "category!=nonnetcoreapptests&amp;category!=failing&amp;category!=nonlinuxtests&amp;category!=nonuaptests"
  299. --logger:"trx;LogFilePrefix=Manual-Unixnetcoreapp-$(TestSet)"
  300. </TestCommand>
  301. <TestCommand>$(TestCommand.Replace($([System.Environment]::NewLine), " "))</TestCommand>
  302. </PropertyGroup>
  303. <Message Text=">>> Running Manual test for Unix via command: $(TestCommand)" />
  304. <Exec ConsoleToMsBuild="true" Command="$(TestCommand)" />
  305. </Target>
  306. <!-- Clean -->
  307. <Target Name="Clean">
  308. <RemoveDir Directories='$([System.IO.Directory]::GetDirectories(".","artifacts", SearchOption.AllDirectories))' />
  309. <RemoveDir Directories='$([System.IO.Directory]::GetDirectories(".","bin", SearchOption.AllDirectories))' />
  310. <RemoveDir Directories='$([System.IO.Directory]::GetDirectories(".","obj", SearchOption.AllDirectories))' />
  311. <RemoveDir Directories='$([System.IO.Directory]::GetDirectories(".","packages", SearchOption.AllDirectories))' />
  312. <RemoveDir Directories='$([System.IO.Directory]::GetDirectories(".",".nuget", SearchOption.AllDirectories))' />
  313. </Target>
  314. <!-- AKV Targets ========================================================= -->
  315. <Target Name="BuildAkv">
  316. <!-- @TODO: TestTargetOS for restore poisons the project.assets.json file... We should remove it. -->
  317. <!-- @TODO: TestTargetOS makes this far more complicated than it needs to be. We should remove it. -->
  318. <!-- @TODO: RemoveProperties shouldn't be necessary -->
  319. <Message Text=">>> Restoring AKV project" />
  320. <MSBuild Projects="@(AKVProvider)" Targets="Restore" />
  321. <PropertyGroup>
  322. <BuildAkvProperties>$(CI);TestTargetOS=$(TestOS)netfx;Platform=AnyCPU;$(ProjectProperties);$(NugetPackProperties)</BuildAkvProperties>
  323. </PropertyGroup>
  324. <Message Text=">>> Building AKV project for netfx [$(BuildAkvProperties)]" />
  325. <MSBuild Projects="@(AKVProvider)" Properties="$(BuildAkvProperties);" />
  326. <PropertyGroup>
  327. <BuildAkvProperties>$(CI);TestTargetOS=$(TestOS)netcoreapp;$(ProjectProperties);Platform=AnyCPU;OSGroup=Unix;</BuildAkvProperties>
  328. </PropertyGroup>
  329. <Message Text=">>> Building AKV project for netcore/unix [$(BuildAkvProperties)]" />
  330. <MSBuild Projects="@(AKVProvider)" Properties="$(BuildAkvProperties)" RemoveProperties="TargetsWindows;TargetsUnix;" />
  331. <PropertyGroup>
  332. <BuildAkvProperties>$(CI);TestTargetOS=$(TestOS)netcoreapp;$(ProjectProperties);Platform=AnyCPU;OSGroup=Windows_NT</BuildAkvProperties>
  333. </PropertyGroup>
  334. <Message Text=">>> Building AKV project for netcore/windows [$(BuildAkvProperties)]" />
  335. <MSBuild Projects="@(AKVProvider)" Properties="$(BuildAkvProperties);" RemoveProperties="TargetsWindows;TargetsUnix;" />
  336. <PropertyGroup>
  337. <BuildAkvProperties>$(CI);TestTargetOS=$(TestOS)netcoreapp;$(ProjectProperties);Platform=AnyCPU;OSGroup=AnyOS;</BuildAkvProperties>
  338. </PropertyGroup>
  339. <Message Text=">>> Building AKV project for netcore/anyos [$(BuildAkvProperties)]" />
  340. <MSBuild Projects="@(AKVProvider)" Properties="$(BuildAkvProperties)" RemoveProperties="TargetsWindows;TargetsUnix;" />
  341. </Target>
  342. <Target Name="BuildAKVNetFx" Condition="'$(IsEnabledWindows)' == 'true'">
  343. <MSBuild Projects="@(AKVProvider)" Targets="restore" Properties="TestTargetOS=$(TestOS)netfx" />
  344. <Message Text=">>> Building AKVNetFx [$(CI);TestTargetOS=$(TestOS)netfx;Platform=AnyCPU;$(TestProjectProperties)] ..." Condition="!$(ReferenceType.Contains('Package'))" />
  345. <MSBuild Projects="@(AKVProvider)" Properties="$(CI);TestTargetOS=$(TestOS)netfx;Platform=AnyCPU;$(TestProjectProperties);$(NugetPackProperties);" Condition="!$(ReferenceType.Contains('Package'))" />
  346. <!-- Only build platform specific builds for Package reference types -->
  347. <Message Text=">>> Building AKVNetFx [$(CI);TestTargetOS=$(TestOS)netfx;Platform=$(Platform);$(TestProjectProperties)] ..." Condition="$(ReferenceType.Contains('Package'))" />
  348. <MSBuild Projects="@(AKVProvider)" Properties="$(CI);TestTargetOS=$(TestOS)netfx;Platform=$(Platform);$(TestProjectProperties);$(NugetPackProperties);" Condition="$(ReferenceType.Contains('Package'))" />
  349. </Target>
  350. <Target Name="BuildAKVNetCore">
  351. <MSBuild Projects="@(AKVProvider)" Targets="restore" Properties="TestTargetOS=$(TestOS)netcoreapp" />
  352. <Message Text=">>> Building AKVNetCore [$(CI);TestTargetOS=$(TestOS)netcoreapp;$(ProjectProperties);Platform=AnyCPU;ReferenceType=$(ReferenceType);] ..." Condition="!$(ReferenceType.Contains('Package'))" />
  353. <MSBuild Projects="@(AKVProvider)" Properties="$(CI);TestTargetOS=$(TestOS)netcoreapp;$(ProjectProperties);Platform=AnyCPU;" Condition="!$(ReferenceType.Contains('Package'))" />
  354. <!-- Only build platform specific builds for Package reference types -->
  355. <Message Text=">>> Building AKVNetCore [$(CI);TestTargetOS=$(TestOS)netcoreapp;$(ProjectProperties);Platform=$(Platform);ReferenceType=$(ReferenceType);] ..." Condition="$(ReferenceType.Contains('Package'))" />
  356. <MSBuild Projects="@(AKVProvider)" Properties="$(CI);TestTargetOS=$(TestOS)netcoreapp;$(ProjectProperties);Platform=$(Platform);" Condition="$(ReferenceType.Contains('Package'))" />
  357. </Target>
  358. <Target Name="BuildAKVNetCoreAllOS">
  359. <MSBuild Projects="@(AKVProvider)" Targets="restore" Properties="TestTargetOS=$(TestOS)netcoreapp" />
  360. <MSBuild Projects="@(AKVProvider)" Properties="$(CI);TestTargetOS=$(TestOS)netcoreapp;$(ProjectProperties);Platform=AnyCPU;OSGroup=Unix;" RemoveProperties="TargetsWindows;TargetsUnix;" />
  361. <MSBuild Projects="@(AKVProvider)" Properties="$(CI);TestTargetOS=$(TestOS)netcoreapp;$(ProjectProperties);Platform=AnyCPU;OSGroup=Windows_NT;" RemoveProperties="TargetsWindows;TargetsUnix;" Condition="'$(IsEnabledWindows)' == 'true'" />
  362. <MSBuild Projects="@(AKVProvider)" Properties="$(CI);TestTargetOS=$(TestOS)netcoreapp;$(ProjectProperties);Platform=AnyCPU;OSGroup=AnyOS;" RemoveProperties="TargetsWindows;TargetsUnix;" />
  363. </Target>
  364. </Project>