Skip to content

Migrate xml tasks to TaskEnvironment API#13246

Merged
AR-May merged 6 commits intodotnet:mainfrom
AR-May:enlighten-more-tasks-5
Feb 18, 2026
Merged

Migrate xml tasks to TaskEnvironment API#13246
AR-May merged 6 commits intodotnet:mainfrom
AR-May:enlighten-more-tasks-5

Conversation

@AR-May
Copy link
Copy Markdown
Member

@AR-May AR-May commented Feb 12, 2026

Context

Migrating XmlPeek, XmlPoke and XslTransformation

Testing

Unit tests

Copilot AI review requested due to automatic review settings February 12, 2026 14:18
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR migrates three XML-related tasks (XmlPeek, XmlPoke, and XslTransformation) to use the TaskEnvironment API for thread-safe execution in MSBuild's multithreaded builds. This migration enables these tasks to safely execute in parallel with other tasks within a single MSBuild process.

Changes:

  • Added IMultiThreadableTask interface implementation and MSBuildMultiThreadableTask attribute to XmlPeek, XmlPoke, and XslTransformation tasks
  • Modified all file path resolution to use TaskEnvironment.GetAbsolutePath() instead of directly using ITaskItem.ItemSpec
  • Refactored internal helper classes (XmlInput, XsltInput) to work with AbsolutePath instead of raw strings
  • Updated all unit tests to initialize TaskEnvironment using TaskEnvironmentHelper.CreateForTest()

Reviewed changes

Copilot reviewed 6 out of 6 changed files in this pull request and generated no comments.

Show a summary per file
File Description
src/Tasks/XslTransformation.cs Implemented IMultiThreadableTask, added TaskEnvironment property, converted XmlInput and XsltInput classes to use AbsolutePath, including compiled XSLT DLL path resolution
src/Tasks/XmlPoke.cs Implemented IMultiThreadableTask, added TaskEnvironment property, converted file path resolution to use TaskEnvironment.GetAbsolutePath()
src/Tasks/XmlPeek.cs Implemented IMultiThreadableTask, added TaskEnvironment property, refactored XmlInput class to use AbsolutePath
src/Tasks.UnitTests/XslTransformation_Tests.cs Updated all test instantiations to initialize TaskEnvironment property using TaskEnvironmentHelper.CreateForTest()
src/Tasks.UnitTests/XmlPoke_Tests.cs Updated all test instantiations to initialize TaskEnvironment property using TaskEnvironmentHelper.CreateForTest()
src/Tasks.UnitTests/XmlPeek_Tests.cs Updated all test instantiations to initialize TaskEnvironment property using TaskEnvironmentHelper.CreateForTest()

AR-May and others added 2 commits February 12, 2026 18:12
Co-authored-by: Jan Provazník <janpro@janpro.dev>
@AR-May AR-May self-assigned this Feb 16, 2026
@AR-May AR-May requested a review from JanProvaznik February 17, 2026 08:42
@AR-May AR-May merged commit 89e3ec4 into dotnet:main Feb 18, 2026
10 checks passed
JanProvaznik added a commit to JanProvaznik/msbuild that referenced this pull request Feb 25, 2026
### Context
Migrating XmlPeek, XmlPoke and XslTransformation

### Testing
Unit tests

---------

Co-authored-by: Jan Provazník <janpro@janpro.dev>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants