-
Notifications
You must be signed in to change notification settings - Fork 1.4k
[automated] Merge branch 'vs17.14' => 'main' #11667
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
Merged
Merged
Changes from all commits
Commits
Show all changes
5 commits
Select commit
Hold shift + click to select a range
7195db6
[17.14] Final branding (#11652)
maridematte 026c880
Revert "Update assembly versions to latest for packages that recently…
YuliiaKovalova e436966
Update the logic of custom culture support (#11607)
YuliiaKovalova 1415f11
Merge branch 'main' into merge/vs17.14-to-main
YuliiaKovalova 248a82e
Disable job CheckVersionBumpOnReleaseBranches conditionally
JaynieBai File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,42 @@ | ||
| # MSBuild Custom Cultures Support | ||
|
|
||
| ## Overview | ||
|
|
||
| The `EnableCustomCulture` property provides an opt-in mechanism for handling custom culture-specific resources in MSBuild projects. This feature allows for greater control over which directories are treated as culture-specific resources during the build process. | ||
|
|
||
| ## Purpose | ||
|
|
||
| In some projects, directory names that match culture name patterns might not actually be culture resources. This can cause issues with resource compilation and deployment. This feature flag enables: | ||
|
|
||
| 1. Control over whether custom culture detection is enabled | ||
| 2. Fine-grained configuration of which directories should be excluded from culture-specific resource processing | ||
|
|
||
| ## Usage | ||
|
|
||
| ### Enabling the Feature | ||
|
|
||
| To enable the custom cultures feature, set the `EnableCustomCulture` property `true`. | ||
|
|
||
| ```xml | ||
| <PropertyGroup> | ||
| <EnableCustomCulture>true</EnableCustomCulture> | ||
| </PropertyGroup> | ||
| ``` | ||
|
|
||
| ### Excluding Specific Directories | ||
|
|
||
| When the feature is enabled, you can specify directories that should not be treated as culture-specific resources using the `NonCultureResourceDirectories` property: | ||
|
|
||
| ```xml | ||
| <PropertyGroup> | ||
| <NonCultureResourceDirectories>long;hash;temp</NonCultureResourceDirectories> | ||
| </PropertyGroup> | ||
| ``` | ||
|
|
||
| In this example, directories named "long", "hash", or "temp" will not be processed as culture-specific resources and the assemblied inside of them will be skipped, even if their names match culture naming patterns. Globbing is not supported. | ||
|
|
||
| ## Additional Notes | ||
|
|
||
| - This feature does not affect the standard resource handling for well-known cultures. | ||
| - The feature is designed to be backward compatible - existing projects without the feature flag will behave the same as before. | ||
| - Performance impact is minimal, as the exclusion check happens only during the resource discovery phase of the build. |
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
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
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
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
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
62 changes: 62 additions & 0 deletions
62
src/MSBuild.Bootstrap.Utils/Tasks/LocateVisualStudioTask.cs
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,62 @@ | ||
| // Licensed to the .NET Foundation under one or more agreements. | ||
| // The .NET Foundation licenses this file to you under the MIT license. | ||
|
|
||
| using System; | ||
| using System.IO; | ||
| using System.Runtime.InteropServices; | ||
| using System.Text; | ||
| using Microsoft.Build.Framework; | ||
| using Microsoft.Build.Utilities; | ||
|
|
||
| namespace MSBuild.Bootstrap.Utils.Tasks | ||
| { | ||
| public class LocateVisualStudioTask : ToolTask | ||
| { | ||
| private readonly StringBuilder _standardOutput = new(); | ||
|
|
||
| [Output] | ||
| public string VsInstallPath { get; set; } | ||
|
|
||
| protected override string ToolName => "vswhere.exe"; | ||
|
|
||
| protected override string GenerateFullPathToTool() | ||
| { | ||
| string programFilesX86 = Environment.GetFolderPath(Environment.SpecialFolder.ProgramFilesX86); | ||
| string vsWherePath = Path.Combine(programFilesX86, "Microsoft Visual Studio", "Installer", ToolName); | ||
|
|
||
|
|
||
| return vsWherePath; | ||
| } | ||
|
|
||
| protected override string GenerateCommandLineCommands() => "-latest -prerelease -property installationPath"; | ||
|
|
||
| public override bool Execute() | ||
| { | ||
| if (!RuntimeInformation.IsOSPlatform(OSPlatform.Windows)) | ||
| { | ||
| Log.LogMessage(MessageImportance.High, "Not running on Windows. Skipping Visual Studio detection."); | ||
| return true; | ||
| } | ||
|
|
||
| _ = ExecuteTool(GenerateFullPathToTool(), string.Empty, GenerateCommandLineCommands()); | ||
|
|
||
| if (!Log.HasLoggedErrors) | ||
| { | ||
| VsInstallPath = _standardOutput.ToString().Trim(); | ||
| } | ||
|
|
||
| return true; | ||
| } | ||
|
|
||
| // Override to capture standard output | ||
| protected override void LogEventsFromTextOutput(string singleLine, MessageImportance messageImportance) | ||
| { | ||
| if (!string.IsNullOrWhiteSpace(singleLine)) | ||
| { | ||
| _ = _standardOutput.AppendLine(singleLine); | ||
| } | ||
|
|
||
| base.LogEventsFromTextOutput(singleLine, messageImportance); | ||
| } | ||
| } | ||
| } |
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
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
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
Oops, something went wrong.
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.
Uh oh!
There was an error while loading. Please reload this page.