Add BuildAll target#4290
Conversation
There was a problem hiding this comment.
Pull request overview
Adds a new BuildAll orchestration target in build.proj and updates the CodeQL workflow to build more of the repository during analysis, alongside a handful of MSBuild/props cleanup and minor project tweaks.
Changes:
- Introduces
BuildAll(and supportingBuildTests/BuildSamples/BuildTools) and switches CodeQL to call it. - Adds a
TrimDocsopt-out for ref-doc trimming to better support cross-build scenarios. - Cleans up legacy MSBuild
ToolsVersion/DefaultTargetsusage and reduces build log noise.
Reviewed changes
Copilot reviewed 9 out of 9 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
| tools/targets/RepositoryInfo.targets | Lowers message verbosity for translated repo URL logging. |
| tools/props/AssemblyRef.props | Removes legacy <Project> attributes. |
| tools/props/AssemblyInfo.props | Removes legacy <Project> attributes. |
| src/Microsoft.Data.SqlClient/tests/ManualTests/Microsoft.Data.SqlClient.ManualTesting.Tests.ruleset | Removes obsolete ToolsVersion and normalizes file ending. |
| src/Microsoft.Data.SqlClient/tests/Common/Microsoft.Data.SqlClient.TestCommon.csproj | Enables implicit usings for the shared test helper project. |
| src/Microsoft.Data.SqlClient/ref/Microsoft.Data.SqlClient.csproj | Adds TrimDocs switch to optionally skip IntelliSense XML trimming. |
| src/Directory.Build.props | Removes legacy <Project> attributes; clarifies versioning evaluation order. |
| build.proj | Adds BuildAll + ancillary build targets and shared arg handling. |
| .github/workflows/codeql.yml | Switches manual CodeQL build step to BuildAll. |
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #4290 +/- ##
==========================================
- Coverage 66.50% 64.10% -2.40%
==========================================
Files 285 280 -5
Lines 43311 66160 +22849
==========================================
+ Hits 28806 42415 +13609
- Misses 14505 23745 +9240
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
benrr101
left a comment
There was a problem hiding this comment.
Few issues here.
1
wouldn't be compiled due to their host OS.
I think there's still a fundamental misunderstanding of the build(2).proj behavior. You can build any version on any OS. BuildSqlClient is dependent on BuildSqlClientWindows and BuildSqlClientUnix. The old build.proj would skip Windows on non-windows by default but that's not the case anymore.
2
There's already a "Build" target that builds all projects.
3
There's a lot of microscopic cleanup changes here. The important changes are getting lost in them. Can these be omitted from this PR?
b24e6ac to
6209ca7
Compare
Pull request was converted to draft
6209ca7 to
c86538c
Compare
Test projects previously used the built-in $(OS) property to gate net462 inclusion. This meant passing -p:TargetOs=Windows_NT from build.proj had no effect on test TFM selection. Migrate all test csproj files and Directory.Build.props to define TargetOs (defaulting to $(OS)) and condition on it, matching the pattern already used by the driver project. This allows BuildAll to build all TFMs regardless of host OS.
| <DotnetCommand> | ||
| "$(DotnetPath)dotnet" build "$(SqlClientUnitTestProjectPath)" | ||
| -p:Configuration=$(Configuration) | ||
| -p:TargetOs=Unix | ||
| </DotnetCommand> |
| $(ReferenceTypeArgument) | ||
| $(PackageVersionAbstractionsArgument) | ||
| $(PackageVersionLoggingArgument) | ||
| $(PackageVersionSqlClientArgument) | ||
| </DotnetCommand> |
| <DotnetCommand> | ||
| "$(DotnetPath)dotnet" build "$(SqlClientUnitTestProjectPath)" | ||
| -p:Configuration=$(Configuration) | ||
| -p:TargetOs=Windows_NT | ||
| </DotnetCommand> |
| $(ReferenceTypeArgument) | ||
| $(PackageVersionAbstractionsArgument) | ||
| $(PackageVersionLoggingArgument) | ||
| $(PackageVersionSqlClientArgument) | ||
| </DotnetCommand> |
Description
Add BuildAll target that builds all projects for all OS+TFM combinations. This makes it easy for devs to compile local changes and avoid surprises for the code that otherwise wouldn't be compiled due to their host OS.
Changes
BuildAlltarget inbuild.projthat builds all projects (tests, samples, tools) across OS+TFM combos.BuildAllfor broader code coverage.build.projmessaging.Split from #4259.