-
Notifications
You must be signed in to change notification settings - Fork 1.4k
Migrate FormatUrl to multithreaded execution model #13573
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from 3 commits
2444827
e99e32f
961a23b
1028667
9c12783
cc6c718
2cb2fe9
3b0ae62
8035137
9f35539
25f6bc6
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -12,16 +12,22 @@ namespace Microsoft.Build.Tasks | |
| /// <summary> | ||
| /// Formats a url by canonicalizing it (i.e. " " -> "%20") and transforming "localhost" to "machinename". | ||
| /// </summary> | ||
| public sealed class FormatUrl : TaskExtension | ||
| [MSBuildMultiThreadableTask] | ||
| public sealed class FormatUrl : TaskExtension, IMultiThreadableTask | ||
| { | ||
| /// <summary> | ||
| /// Gets or sets the task execution environment for thread-safe path resolution. | ||
| /// </summary> | ||
| public TaskEnvironment TaskEnvironment { get; set; } = TaskEnvironment.Fallback; | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. nit: Use here comment / |
||
|
|
||
| public string InputUrl { get; set; } | ||
|
|
||
| [Output] | ||
| public string OutputUrl { get; set; } | ||
|
|
||
| public override bool Execute() | ||
| { | ||
| OutputUrl = InputUrl != null ? PathUtil.Format(InputUrl) : String.Empty; | ||
| OutputUrl = InputUrl != null ? PathUtil.Format(InputUrl, TaskEnvironment.ProjectDirectory) : String.Empty; | ||
| return true; | ||
| } | ||
| } | ||
|
|
||
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Uh oh!
There was an error while loading. Please reload this page.