Skip to content

Add Wave18_0 changewave and put AddSdkResolvedEnvironmentVariable behind it #12182

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

Draft
wants to merge 4 commits into
base: main
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Add Wave18_0 changewave and put AddSdkResolvedEnvironmentVariable beh…
…ind it

Co-authored-by: rainersigwald <3347530+rainersigwald@users.noreply.github.com>
  • Loading branch information
Copilot and rainersigwald committed Jul 16, 2025
commit 21a5917b816972d2eb3f51b7c435d459ce0d6779
38 changes: 38 additions & 0 deletions src/Build.UnitTests/ChangeWaves_Tests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -231,5 +231,43 @@ public void CorrectlyDetermineDisabledFeatures()
}
}
}

[Fact]
public void Wave18_0IsIncludedInAllWaves()
{
using (TestEnvironment env = TestEnvironment.Create())
{
ChangeWaves.AllWaves.ShouldContain(ChangeWaves.Wave18_0);
ChangeWaves.Wave18_0.ShouldBe(new Version(18, 0));
}
}

[Fact]
public void Wave18_0FeaturesAreEnabledByDefault()
{
using (TestEnvironment env = TestEnvironment.Create())
{
SetChangeWave(string.Empty, env);

buildSimpleProjectAndValidateChangeWave(testEnvironment: env,
versionToCheckAgainstCurrentChangeWave: ChangeWaves.Wave18_0,
currentChangeWaveShouldUltimatelyResolveTo: ChangeWaves.EnableAllFeatures,
warningCodesLogShouldContain: null);
}
}

[Fact]
public void Wave18_0FeaturesCanBeDisabled()
{
using (TestEnvironment env = TestEnvironment.Create())
{
SetChangeWave(ChangeWaves.Wave18_0.ToString(), env);

buildSimpleProjectAndValidateChangeWave(testEnvironment: env,
versionToCheckAgainstCurrentChangeWave: ChangeWaves.Wave18_0,
currentChangeWaveShouldUltimatelyResolveTo: ChangeWaves.Wave18_0,
warningCodesLogShouldContain: null);
}
}
}
}
13 changes: 9 additions & 4 deletions src/Build/Evaluation/Evaluator.cs
Original file line number Diff line number Diff line change
Expand Up @@ -1881,9 +1881,12 @@ static string EvaluateProperty(string value, IElementLocation location,

if (sdkResult?.EnvironmentVariablesToAdd is IDictionary<string, string> sdkEnvironmentVariablesToAdd && sdkEnvironmentVariablesToAdd.Count > 0)
{
foreach (var environmentVariable in sdkEnvironmentVariablesToAdd)
if (ChangeWaves.AreFeaturesEnabled(ChangeWaves.Wave18_0))
{
_data.AddSdkResolvedEnvironmentVariable(environmentVariable.Key, environmentVariable.Value);
foreach (var environmentVariable in sdkEnvironmentVariablesToAdd)
{
_data.AddSdkResolvedEnvironmentVariable(environmentVariable.Key, environmentVariable.Value);
}
}
}

Expand All @@ -1898,8 +1901,10 @@ static string EvaluateProperty(string value, IElementLocation location,
"dotnet.exe");
if (File.Exists(dotnetExe))
{

_data.AddSdkResolvedEnvironmentVariable("DOTNET_HOST_PATH", dotnetExe);
if (ChangeWaves.AreFeaturesEnabled(ChangeWaves.Wave18_0))
Copy link
Member

Choose a reason for hiding this comment

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

Move this around the whole TEMPORARY COMPAT SHIM block.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Done! Moved the Wave18_0 changewave check around the entire TEMPORARY COMPAT SHIM block. Now the whole compatibility logic (including property detection, path building, and environment variable setting) is controlled by the changewave. Commit: 1106c0d

{
_data.AddSdkResolvedEnvironmentVariable("DOTNET_HOST_PATH", dotnetExe);
}
}
}

Expand Down
3 changes: 2 additions & 1 deletion src/Framework/ChangeWaves.cs
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,8 @@ internal static class ChangeWaves
internal static readonly Version Wave17_10 = new Version(17, 10);
internal static readonly Version Wave17_12 = new Version(17, 12);
internal static readonly Version Wave17_14 = new Version(17, 14);
internal static readonly Version[] AllWaves = { Wave17_10, Wave17_12, Wave17_14 };
internal static readonly Version Wave18_0 = new Version(18, 0);
internal static readonly Version[] AllWaves = { Wave17_10, Wave17_12, Wave17_14, Wave18_0 };

/// <summary>
/// Special value indicating that all features behind all Change Waves should be enabled.
Expand Down
Loading
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy