Repository navigation
Parse and retain task and target operation phases - #15768
Draft
JohnSchmeichel wants to merge 1 commit into
Draft
JohnSchmeichel wants to merge 1 commit into
JohnSchmeichel wants to merge 1 commit into
Conversation
Relates to dotnet#15656 Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
|
Azure Pipelines: Successfully started running 2 pipeline(s). Some pipeline(s) encountered errors during trigger evaluation. |
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Related issue(s):
Relates to #15656.
Context
Establish parser and object-model support for task, target property, and target item phase declarations without implementing phase resolution or execution. This upstream PR carries the changes staged in gim-home/msbuild-precompute#169.
Changes Made
DefaultPhaseonUsingTaskand retain its unevaluated value in task registrations and project-state translation.MSBuildPhaseexpressions and locations on construction elements and task, target property, and target item instances, including translation.MSBuildPhaseon task invocations and item attributes behind Change Wave 18.14, including reserved-attribute casing rules; retain legacy parameter and metadata behavior when opted out.MSBuildPhaseon properties inside targets independently of the wave.Compatibility
MSBUILDDISABLEFEATURESFROMVERSION=18.14restoresMSBuildPhaseas an ordinary task parameter or item attribute metadata, including case variants. With the wave enabled, project-level item attributes are reserved and ignored during evaluation, and item definitions reject the attribute; child-element metadata remains available.DefaultPhaseand target property attributes are accepted independently of the wave. Project-level properties rejectMSBuildPhase.Phase expressions are not expanded or validated by this change. Ordinary task, property, and item execution is unchanged apart from the wave-gated reservation. New construction/instance APIs and internal project-state translation fields retain the declarations; task registrations do not retain the
DefaultPhasesource location. Older MSBuild versions do not recognize the newUsingTaskattribute, and mixed-version translation compatibility has not been validated. The shared schema property types also permitMSBuildPhaseon project-level properties although the runtime parser rejects it.Testing
Focused upstream-main checks on macOS, run serially, passed:
dotnet test src/Build.UnitTests/Microsoft.Build.Engine.UnitTests.csproj --no-restore -f net11.0 -v quiet -p:CreateBootstrap=false -- --filter-method '*Phase*'— passed, 10/10.dotnet test src/Build.OM.UnitTests/Microsoft.Build.Engine.OM.UnitTests.csproj --no-restore -f net11.0 -v quiet -p:CreateBootstrap=false -- --filter-method '*Phase*'— passed, 27/27.dotnet test src/Build.OM.UnitTests/Microsoft.Build.Engine.OM.UnitTests.csproj --no-restore -f net11.0 -v quiet -p:CreateBootstrap=false -- --filter-class '*ProjectItemElement_Tests'— passed, 100/100.dotnet test src/Build.OM.UnitTests/Microsoft.Build.Engine.OM.UnitTests.csproj --no-restore -f net11.0 -v quiet -p:CreateBootstrap=false -- --filter-class '*ProjectItemDefinitionElement_Tests'— passed, 14/14.dotnet test src/MSBuild.UnitTests/Microsoft.Build.CommandLine.UnitTests.csproj --no-restore -f net11.0 -v quiet -p:CreateBootstrap=false -- --filter-class '*ProjectSchema_Tests'— passed, 1/1.On the release staging branch,
./eng/build.sh --build -v quietpassed with zero warnings and errors; the sample build and CLI help also succeeded. The full test suite, Windows/.NET Framework runs, and mixed-version hosts were not tested.Dependencies and Follow-up
No new dependencies. Phase resolution and validation (
PrecomputeorCompute), graph construction, and precompute/compute execution remain follow-up work. Target property and item phases default toPrecomputewhen absent; tasks require a phase from their invocation or registration.