Skip to content
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

delete tfm constants #79219

Merged
merged 1 commit into from
Dec 5, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
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
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ public void FrameworkHiveSelection_CurrentDirectoryIsIgnored()
{
RunTest(new TestSettings()
.WithRuntimeConfigCustomizer(runtimeConfig => runtimeConfig
.WithTfm(Constants.Tfm.Net6)
.WithTfm("net6.0")
.WithFramework(MicrosoftNETCoreApp, "5.0.0"))
.WithWorkingDirectory(SharedState.DotNetCurrentHive.BinPath),
multiLevelLookup: true)
Expand Down
8 changes: 0 additions & 8 deletions src/installer/tests/TestUtils/Constants.cs
Original file line number Diff line number Diff line change
Expand Up @@ -33,14 +33,6 @@ public static class RollForwardSetting
public const string Disable = "Disable";
}

public static class Tfm
{
public const string RuntimeConfigPropertyName = "tfm";
public const string Net6 = "net6.0";
public const string Net7 = "net7.0";
public const string Net8 = "net8.0";
}

public static class FxVersion
{
public const string CommandLineArgument = "--fx-version";
Expand Down
4 changes: 1 addition & 3 deletions src/installer/tests/TestUtils/RuntimeConfig.cs
Original file line number Diff line number Diff line change
Expand Up @@ -279,9 +279,7 @@ public void Save()

if (_tfm is not null)
{
runtimeOptions.Add(
Constants.Tfm.RuntimeConfigPropertyName,
_tfm);
runtimeOptions.Add("tfm", _tfm);
}

if (_properties.Count > 0)
Expand Down

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ private void ValidateParameters()

private RuntimeFlavor GetRuntimeFlavor(string tfm)
{
if (Tfm.Matches(Tfm.Net462, tfm))
if (tfm.ToLowerInvariant() == "net462")
{
return RuntimeFlavor.Clr;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -83,8 +83,9 @@ protected async Task<CancellationToken> StartSelfHostAsync()
{
// Core+Standalone always publishes. This must be Clr+Standalone or Core+Portable.
// Run from the pre-built bin/{config}/{tfm} directory.
Version version = Environment.Version;
var targetFramework = DeploymentParameters.TargetFramework
?? (DeploymentParameters.RuntimeFlavor == RuntimeFlavor.Clr ? Tfm.Net462 : Tfm.NetCoreApp22);
?? (DeploymentParameters.RuntimeFlavor == RuntimeFlavor.Clr ? "net462" : $"net{version.Major}.{version.Minor}");
workingDirectory = Path.Combine(DeploymentParameters.ApplicationPath, "bin", DeploymentParameters.Configuration, targetFramework);
// CurrentDirectory will point to bin/{config}/{tfm}, but the config and static files aren't copied, point to the app base instead.
DeploymentParameters.EnvironmentVariables["DOTNET_CONTENTROOT"] = DeploymentParameters.ApplicationPath;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -58,12 +58,13 @@ private async Task ExecuteShutdownTest(string testName, string shutdownMechanic)
var applicationPath = string.Empty; // disabled for now
#pragma warning restore 0618

Version version = Environment.Version;
var deploymentParameters = new DeploymentParameters(
applicationPath,
RuntimeFlavor.CoreClr,
RuntimeArchitecture.x64)
{
TargetFramework = Tfm.NetCoreApp50,
TargetFramework = $"Environment{version.Major}.{version.Minor}",
Copy link
Contributor

Choose a reason for hiding this comment

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

@kasperk81 Shouldn't this read $"net{version.Major}.{version.Minor}" (or null)?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

ooops, #79230. thanks for catching it

ApplicationType = ApplicationType.Portable,
PublishApplicationBeforeDeployment = true,
StatusMessagesEnabled = false
Expand Down