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.45% 63.45% -2.00%
==========================================
Files 285 280 -5
Lines 43373 66265 +22892
==========================================
+ Hits 28388 42047 +13659
- Misses 14985 24218 +9233
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?
|
Conditionally updating SourceRoot may solve this error on this line: |
Change the default target from Build to BuildAll so a bare 'dotnet build' builds all projects, tests, and samples. Update BUILDGUIDE.md to document the new default and how to build driver-only with -t:Build. All CI/PR/ OneBranch pipelines pass explicit targets and are unaffected.
Rename the driver-only build target from Build to BuildDriver and update BuildAll's dependency and the BUILDGUIDE references. Pipelines reference only Build<package> targets (e.g. BuildSqlClient), so they are unaffected.
Add a BuildTools target that builds the auxiliary tool/app projects: AzureSqlConnector (doc/apps) and PackageCompatibility (tools). Document the new target in BUILDGUIDE.md.
BuildAll now also builds the auxiliary tool/app projects. Update BUILDGUIDE wording to reflect that the default build includes tools.
2dfcb52
@cheenamalhotra - I have no problems using |
Couldn't reproduce the msbuild errors.
cheenamalhotra
left a comment
There was a problem hiding this comment.
Tested and msbuild works seamlessly!
Thanks!
* Add BuildAll target, CodeQL update, and ref csproj cleanup * Replace ancillary BuildTests with first-class per-project targets * Use TargetOs instead of OS in test projects for TFM selection 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.


Description
Add a
BuildAlltarget that builds every project in the repo — driver libraries, tests, samples, and auxiliary tools — across all supported OS + TargetFramework combinations. This makes it easy for developers to compile all local changes and avoid surprises for code that otherwise wouldn't be compiled on their host OS (for example,net462-only or OS-specific code paths).BuildAllis now the defaultbuild.projtarget, so a baredotnet buildcompiles the whole repo.Split from #4259.
Changes
build.projDefaultTargets="BuildAll"soBuildAllruns by default.BuildAll, which depends onBuildDriver,BuildTests,BuildSamples, andBuildTools.Buildtarget toBuildDriver(builds only the driver projects).BuildTestswith per-project, per-OS (Unix + Windows) build targets for Abstractions, SqlClient Unit/Functional/Manual/Performance/Stress, and Azure test projects. Each forwards the relevantReferenceType, signing key, and package-version arguments.BuildSamplesto build thedoc/samples/projects.BuildToolsto build auxiliary tool/app projects (AzureSqlConnector,PackageCompatibility).PackandTestare documented as operating on the driver projects.Test/tool project files
OSproperty to the build-controlledTargetOsproperty in the test, TestUdts, StressTests, and TDS.EndPoint project files.net462is now added whenTargetOs == Windows_NT, allowing per-OS builds to be driven explicitly frombuild.projrather than being implicitly tied to the host OS.CodeQL workflow
dotnet build build.proj -t:BuildAllfor broader code-analysis coverage.Documentation
BUILDGUIDE.mdto describe the new defaultBuildAllbehavior, theBuildDriver/BuildTests/BuildSamples/BuildToolstargets, and refreshed examples and target tables.