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 65.39% 63.40% -2.00%
==========================================
Files 285 280 -5
Lines 43331 66193 +22862
==========================================
+ Hits 28337 41968 +13631
- Misses 14994 24225 +9231
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?
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.
…est build targets BuildSqlClientTestsUnitUnix/Windows now forward $(ReferenceTypeArgument), $(PackageVersionSqlClientArgument), and $(PackageVersionSqlServerArgument) to align with the TestSqlClientUnit target. BuildSqlClientTestsManualUnix/Windows now also forward $(PackageVersionSqlServerArgument) for consistent Package-mode restore. Addresses PR #4290 review feedback.
BuildSqlClientTestsUnitUnix/Windows now forward $(TestSigningKeyPathArgument) so that signed-driver builds pass the correct InternalsVisibleTo key to the unit test project, matching the TestSqlClientUnit target. Addresses PR #4290 review feedback.
apoorvdeshmukh
left a comment
There was a problem hiding this comment.
Looks Good. Can you also update BUILDGUIDE.md to reflect this new target?
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.