-
Notifications
You must be signed in to change notification settings - Fork 330
Add BuildAll target, CodeQL update, and build cleanup #4290
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Changes from 3 commits
b65a820
65910f5
8aa59ca
0e8a05e
88bb64f
b24e6ac
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,5 +1,5 @@ | ||
| <?xml version="1.0" encoding="utf-8"?> | ||
| <Project ToolsVersion="Current" xmlns="http://schemas.microsoft.com/developer/msbuild/2003"> | ||
| <Project DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003"> | ||
| <!-- Imports ========================================================= --> | ||
| <Import Project="src/Directory.Build.props" /> | ||
|
|
||
|
|
@@ -329,11 +329,14 @@ | |
| <!-- Top Level/Miscellaneous Targets --> | ||
|
|
||
| <!-- | ||
| Build: Builds all packages | ||
| Build: Builds all driver projects. This is the default target. | ||
| Note: These have been ordered in a vague attempt to minimize multiple rebuilds of dependencies. | ||
| --> | ||
| <Target Name="Build" DependsOnTargets="BuildLogging;BuildAbstractions;BuildSqlClient;BuildAzure;BuildAkvProvider;BuildSqlServer" /> | ||
|
|
||
| <!-- Build all projects in the repo, for all supported OS and TargetFramework combinations.--> | ||
| <Target Name="BuildAll" DependsOnTargets="Build;BuildTests;BuildSamples;BuildTools" /> | ||
|
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Devs can use this with local changes to be pretty confident they didn't break compilation, regardless of their host OS.
paulmedynski marked this conversation as resolved.
Outdated
|
||
|
|
||
|
paulmedynski marked this conversation as resolved.
|
||
| <!-- Clean: Convenience target to remove build/test output --> | ||
| <Target Name="Clean"> | ||
| <!-- Remove known build output paths --> | ||
|
|
@@ -346,16 +349,18 @@ | |
| </Target> | ||
|
|
||
| <!-- | ||
| Pack: Packages all packages | ||
| Pack: Packages all driver projects. | ||
| Note: These have been ordered in a vague attempt to minimize multiple rebuilds of dependencies. | ||
| --> | ||
| <Target Name="Pack" DependsOnTargets="PackLogging;PackAbstractions;PackSqlClient;PackAzure;PackAkvProvider;PackSqlServer" /> | ||
|
|
||
| <!-- | ||
| Test: Run all test targets for all packages. | ||
| Note: This will run for a *very* long time and it is not recommended, even in automated test | ||
| environments. Please consider running project specific test targets or specific test sets | ||
| within the project. | ||
| Test: Run all test targets for all driver projects. | ||
|
|
||
| Note: This requires local and remote SQL Server setups with corresponding JSON configuration | ||
| files. It will run for a *very* long time and it is not recommended, even in automated test | ||
| environments. Please consider running project specific test targets or specific test sets within | ||
| the project. | ||
| --> | ||
| <Target Name="Test" DependsOnTargets="TestAbstractions;TestAzure;TestSqlClient" /> | ||
|
|
||
|
|
@@ -618,7 +623,7 @@ | |
| <DotnetCommand>$([System.Text.RegularExpressions.Regex]::Replace($(DotnetCommand), "\s+", " "))</DotnetCommand> | ||
| </PropertyGroup> | ||
| <Message Text=">>> Running manual tests for SqlClient via command: $(DotnetCommand)" /> | ||
| <Exec ConsoleToMsBuild="true" Command="$(DotnetCommand)" /> | ||
|
Check failure on line 626 in build.proj
|
||
| </Target> | ||
|
|
||
| <!-- TestSqlClientUnit: Runs unit tests for SqlClient --> | ||
|
|
@@ -646,7 +651,7 @@ | |
| <DotnetCommand>$([System.Text.RegularExpressions.Regex]::Replace($(DotnetCommand), "\s+", " "))</DotnetCommand> | ||
| </PropertyGroup> | ||
| <Message Text=">>> Running unit tests for SqlClient via command: $(DotnetCommand)" /> | ||
| <Exec ConsoleToMsBuild="true" Command="$(DotnetCommand)" /> | ||
|
Check failure on line 654 in build.proj
|
||
| </Target> | ||
|
|
||
| <!-- ================================================================= --> | ||
|
|
@@ -985,4 +990,118 @@ | |
| <Message Text=">>> Packaging Microsoft.SqlServer.Server via command: $(DotnetCommand)" /> | ||
| <Exec ConsoleToMsBuild="true" Command="$(DotnetCommand)" /> | ||
| </Target> | ||
|
|
||
| <!-- ================================================================= --> | ||
| <!-- Ancillary Targets --> | ||
|
|
||
| <!-- Set up the list of supported OSes. --> | ||
| <PropertyGroup> | ||
| <_OsList>Windows_NT;Unix</_OsList> | ||
| </PropertyGroup> | ||
| <ItemGroup> | ||
| <_OsValues Include="$(_OsList)" /> | ||
| </ItemGroup> | ||
|
|
||
| <!-- Supply a common set of arguments to dotnet build. --> | ||
| <PropertyGroup> | ||
| <_DotnetArguments> | ||
| -p:Configuration=$(Configuration) | ||
|
|
||
| <!-- Versioning arguments --> | ||
| $(BuildNumberArgument) | ||
| $(BuildSuffixArgument) | ||
|
|
||
| <!-- Reference Type Arguments --> | ||
| $(ReferenceTypeArgument) | ||
| $(PackageVersionAbstractionsArgument) | ||
| $(PackageVersionAkvProviderArgument) | ||
| $(PackageVersionAzureArgument) | ||
| $(PackageVersionLoggingArgument) | ||
| $(PackageVersionSqlClientArgument) | ||
| $(PackageVersionSqlServerArgument) | ||
| </_DotnetArguments> | ||
| <!-- Convert more than one whitespace character into one space --> | ||
| <_DotnetArguments>$([System.Text.RegularExpressions.Regex]::Replace($(_DotnetArguments), "\s+", " "))</_DotnetArguments> | ||
| </PropertyGroup> | ||
|
|
||
| <!-- | ||
| Define all of the ancillary project file paths. | ||
|
|
||
| These aren't all of the possible projects - only the top-level ones that, in turn, will | ||
| transitively build all ancillary projects. | ||
| --> | ||
| <PropertyGroup> | ||
| <AbstractionsTestsProjectPath>$(RepoRoot)src/Microsoft.Data.SqlClient.Extensions/Abstractions/test/Abstractions.Test.csproj</AbstractionsTestsProjectPath> | ||
| <UnitTestsProjectPath>$(RepoRoot)src/Microsoft.Data.SqlClient/tests/UnitTests/Microsoft.Data.SqlClient.UnitTests.csproj</UnitTestsProjectPath> | ||
| <FunctionalTestsProjectPath>$(RepoRoot)src/Microsoft.Data.SqlClient/tests/FunctionalTests/Microsoft.Data.SqlClient.FunctionalTests.csproj</FunctionalTestsProjectPath> | ||
| <ManualTestsProjectPath>$(RepoRoot)src/Microsoft.Data.SqlClient/tests/ManualTests/Microsoft.Data.SqlClient.ManualTests.csproj</ManualTestsProjectPath> | ||
| <PerformanceTestsProjectPath>$(RepoRoot)src/Microsoft.Data.SqlClient/tests/PerformanceTests/Microsoft.Data.SqlClient.PerformanceTests.csproj</PerformanceTestsProjectPath> | ||
| <StressTestsProjectPath>$(RepoRoot)src/Microsoft.Data.SqlClient/tests/StressTests/SqlClient.Stress.Runner/SqlClient.Stress.Runner.csproj</StressTestsProjectPath> | ||
| <AzureTestsProjectPath>$(RepoRoot)src/Microsoft.Data.SqlClient.Extensions/Azure/test/Azure.Test.csproj</AzureTestsProjectPath> | ||
|
|
||
| <SamplesProjectPath>$(RepoRoot)doc/samples/Microsoft.Data.SqlClient.Samples.csproj</SamplesProjectPath> | ||
|
|
||
| <GenApiProjectPath>$(RepoRoot)tools/GenAPI/Microsoft.DotNet.GenAPI/Microsoft.DotNet.GenAPI.csproj</GenApiProjectPath> | ||
| </PropertyGroup> | ||
|
|
||
| <!-- Build all test projects. --> | ||
| <Target Name="BuildTests"> | ||
|
|
||
| <!-- SqlServer has no tests to build. --> | ||
|
|
||
| <!-- Logging has no tests to build. --> | ||
|
|
||
| <!-- Build Abstractions tests, which don't have conditional TFMs. --> | ||
| <Message Text=">>> Building Abstractions.Tests with arguments: $(_DotnetArguments)"/> | ||
| <Exec ConsoleToMsBuild="true" | ||
| Command=""$(DotnetPath)dotnet" build "$(AbstractionsTestsProjectPath)" $(_DotnetArguments)" /> | ||
|
|
||
| <!-- Build SqlClient UnitTests (project references only, no ReferenceType). --> | ||
| <Message Text=">>> Building SqlClient UnitTests for %(_OsValues.Identity)"/> | ||
| <Exec ConsoleToMsBuild="true" | ||
| Command=""$(DotnetPath)dotnet" build "$(UnitTestsProjectPath)" -p:Configuration=$(Configuration) -p:OS=%(_OsValues.Identity)" /> | ||
|
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. MSBuild performs one exec for each element in |
||
|
|
||
|
paulmedynski marked this conversation as resolved.
|
||
| <!-- Build SqlClient FunctionalTests. --> | ||
| <Message Text=">>> Building SqlClient FunctionalTests for %(_OsValues.Identity) with arguments: $(_DotnetArguments)"/> | ||
| <Exec ConsoleToMsBuild="true" | ||
| Command=""$(DotnetPath)dotnet" build "$(FunctionalTestsProjectPath)" $(_DotnetArguments) -p:OS=%(_OsValues.Identity)" /> | ||
|
|
||
| <!-- Build SqlClient ManualTests. --> | ||
| <Message Text=">>> Building SqlClient ManualTests for %(_OsValues.Identity) with arguments: $(_DotnetArguments)"/> | ||
| <Exec ConsoleToMsBuild="true" | ||
| Command=""$(DotnetPath)dotnet" build "$(ManualTestsProjectPath)" $(_DotnetArguments) -p:OS=%(_OsValues.Identity)" /> | ||
|
|
||
| <!-- Build SqlClient PerformanceTests. --> | ||
| <Message Text=">>> Building SqlClient PerformanceTests for %(_OsValues.Identity) with arguments: $(_DotnetArguments)"/> | ||
| <Exec ConsoleToMsBuild="true" | ||
| Command=""$(DotnetPath)dotnet" build "$(PerformanceTestsProjectPath)" $(_DotnetArguments) -p:OS=%(_OsValues.Identity)" /> | ||
|
|
||
| <!-- Build SqlClient StressTests. --> | ||
| <Message Text=">>> Building SqlClient StressTests for %(_OsValues.Identity) with arguments: $(_DotnetArguments)"/> | ||
| <Exec ConsoleToMsBuild="true" | ||
| Command=""$(DotnetPath)dotnet" build "$(StressTestsProjectPath)" $(_DotnetArguments) -p:OS=%(_OsValues.Identity)" /> | ||
|
|
||
| <!-- Build Azure tests. --> | ||
| <Message Text=">>> Building Azure.Tests for %(_OsValues.Identity) with arguments: $(_DotnetArguments)"/> | ||
| <Exec ConsoleToMsBuild="true" | ||
| Command=""$(DotnetPath)dotnet" build "$(AzureTestsProjectPath)" $(_DotnetArguments) -p:OS=%(_OsValues.Identity)" /> | ||
|
|
||
| <!-- AKV Provider has no tests to build. --> | ||
|
|
||
|
paulmedynski marked this conversation as resolved.
|
||
| </Target> | ||
|
|
||
| <!-- Build all sample projects. --> | ||
| <Target Name="BuildSamples"> | ||
| <Message Text=">>> Building Samples with arguments: $(_DotnetArguments)"/> | ||
| <Exec ConsoleToMsBuild="true" | ||
| Command=""$(DotnetPath)dotnet" build "$(SamplesProjectPath)" $(_DotnetArguments)" /> | ||
|
paulmedynski marked this conversation as resolved.
Outdated
|
||
| </Target> | ||
|
|
||
| <!-- Build all tools projects. --> | ||
| <Target Name="BuildTools"> | ||
| <Message Text=">>> Building GenAPI with arguments: $(_DotnetArguments)"/> | ||
| <Exec ConsoleToMsBuild="true" | ||
| Command=""$(DotnetPath)dotnet" build "$(GenApiProjectPath)" $(_DotnetArguments)" /> | ||
| </Target> | ||
|
|
||
| </Project> | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,5 +1,5 @@ | ||
| <?xml version="1.0" encoding="utf-8"?> | ||
| <Project ToolsVersion="Current" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003"> | ||
|
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Only |
||
| <Project xmlns="http://schemas.microsoft.com/developer/msbuild/2003"> | ||
| <PropertyGroup> | ||
| <!-- | ||
| "ReferenceType" property supports below options: | ||
|
|
@@ -35,7 +35,11 @@ | |
| <!-- Versioning ====================================================== --> | ||
| <!-- | ||
| Versions for packages are assigned in the project's Versions.props file. Below, we provide | ||
| defaults for components of versions that are shared across all projects | ||
| defaults for components of versions that are shared across all projects. | ||
|
|
||
| Directory.Build.props evaluates before Directory.Packages.props, so defining these here | ||
| ensures FileVersionBuildNumber is set before any Versions.props runs (including those | ||
| imported by Directory.Packages.props in Package mode). | ||
| --> | ||
| <PropertyGroup> | ||
| <!-- | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -54,8 +54,8 @@ | |
| Condition="'$(IsCrossTargetingBuild)' != 'true' AND '$(GenerateDocumentationFile)' == 'true'"> | ||
|
|
||
| <PropertyGroup> | ||
| <PowerShellCommand Condition="'$(OS)' == 'Windows_NT'">powershell.exe</PowerShellCommand> | ||
| <PowerShellCommand Condition="'$(OS)' != 'Windows_NT'">pwsh</PowerShellCommand> | ||
| <PowerShellCommand Condition="$([MSBuild]::IsOSPlatform('Windows'))">powershell.exe</PowerShellCommand> | ||
|
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
|
||
| <PowerShellCommand Condition="!$([MSBuild]::IsOSPlatform('Windows'))">pwsh</PowerShellCommand> | ||
| <PowerShellCommand> | ||
| $(PowerShellCommand) | ||
| -NonInteractive | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -2,6 +2,8 @@ | |
| <PropertyGroup> | ||
| <AssemblyName>Microsoft.Data.SqlClient.TestCommon</AssemblyName> | ||
| <RootNamespace>Microsoft.Data.SqlClient.TestCommon</RootNamespace> | ||
|
|
||
| <ImplicitUsings>enable</ImplicitUsings> | ||
|
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Reduces 'using' noise. |
||
| <Nullable>enable</Nullable> | ||
|
|
||
| <!-- | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,5 +1,5 @@ | ||
| <?xml version="1.0" encoding="utf-8"?> | ||
| <RuleSet Name="Microsoft Managed Recommended Rules" Description="These rules focus on the most critical problems in your code, including potential security holes, application crashes, and other important logic and design errors. It is recommended to include this rule set in any custom rule set you create for your projects." ToolsVersion="Latest"> | ||
|
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
|
||
| <RuleSet Name="Microsoft Managed Recommended Rules" Description="These rules focus on the most critical problems in your code, including potential security holes, application crashes, and other important logic and design errors. It is recommended to include this rule set in any custom rule set you create for your projects."> | ||
| <Localization ResourceAssembly="Microsoft.VisualStudio.CodeAnalysis.RuleSets.Strings.dll" ResourceBaseName="Microsoft.VisualStudio.CodeAnalysis.RuleSets.Strings.Localized"> | ||
| <Name Resource="MinimumRecommendedRules_Name" /> | ||
| <Description Resource="MinimumRecommendedRules_Description" /> | ||
|
|
@@ -71,4 +71,4 @@ | |
| <Rules AnalyzerId="xunit.analyzers" RuleNamespace="xunit.analyzers"> | ||
| <Rule Id="xUnit1024" Action="Info" /> | ||
| </Rules> | ||
| </RuleSet> | ||
| </RuleSet> | ||
Uh oh!
There was an error while loading. Please reload this page.