From 4e6e5a181f3d901d02504aafb5816911872efabc Mon Sep 17 00:00:00 2001 From: "Anatolii Bolshakov (Akvelon INC)" Date: Wed, 6 Oct 2021 13:33:24 +0300 Subject: [PATCH 1/6] Added warning message for Net 2.1 --- Tasks/UseDotNetV2/task.json | 2 +- Tasks/UseDotNetV2/task.loc.json | 2 +- Tasks/UseDotNetV2/usedotnet.ts | 12 ++++++++++++ 3 files changed, 14 insertions(+), 2 deletions(-) diff --git a/Tasks/UseDotNetV2/task.json b/Tasks/UseDotNetV2/task.json index 2b8a2a99c343..1a024e7dbbda 100644 --- a/Tasks/UseDotNetV2/task.json +++ b/Tasks/UseDotNetV2/task.json @@ -13,7 +13,7 @@ "author": "Microsoft Corporation", "version": { "Major": 2, - "Minor": 191, + "Minor": 194, "Patch": 0 }, "satisfies": [ diff --git a/Tasks/UseDotNetV2/task.loc.json b/Tasks/UseDotNetV2/task.loc.json index c5bab768295e..f8c8662f9f40 100644 --- a/Tasks/UseDotNetV2/task.loc.json +++ b/Tasks/UseDotNetV2/task.loc.json @@ -13,7 +13,7 @@ "author": "Microsoft Corporation", "version": { "Major": 2, - "Minor": 191, + "Minor": 194, "Patch": 0 }, "satisfies": [ diff --git a/Tasks/UseDotNetV2/usedotnet.ts b/Tasks/UseDotNetV2/usedotnet.ts index 27f4a593fd17..492e97cd108b 100644 --- a/Tasks/UseDotNetV2/usedotnet.ts +++ b/Tasks/UseDotNetV2/usedotnet.ts @@ -10,6 +10,13 @@ import { VersionInfo, VersionParts } from "./models" import { NuGetInstaller } from "./nugetinstaller"; import { error } from 'util'; + +function checkVersionForDeprecationAndNotify(versionSpec: string | null): void { + if (versionSpec != null && versionSpec.startsWith("2.1")) { + console.log(`NET Core version you specfied (${versionSpec}) is out of support and will be removed from hosted agents soon. Please refer to https://aka.ms/dotnet-core-support for more information about the .NET support policy.`); + } +} + async function run() { let useGlobalJson: boolean = tl.getBoolInput('useGlobalJson'); let packageType = (tl.getInput('packageType') || "sdk").toLowerCase();; @@ -34,6 +41,7 @@ async function run() { // By default disable Multi Level Lookup unless user wants it enabled. tl.setVariable("DOTNET_MULTILEVEL_LOOKUP", !performMultiLevelLookup ? "0" : "1"); } + // Add dot net tools path to "PATH" environment variables, so that tools can be used directly. addDotNetCoreToolPath(); // Install NuGet version specified by user or 4.4.1 in case none is specified @@ -70,6 +78,8 @@ async function installDotNet( let url = versionFetcher.getDownloadUrl(version); if (!dotNetCoreInstaller.isVersionInstalled(version.getVersion())) { await dotNetCoreInstaller.downloadAndInstall(version, url); + } else { + checkVersionForDeprecationAndNotify(versionSpec); } } } else if (versionSpec) { @@ -82,6 +92,8 @@ async function installDotNet( } if (!dotNetCoreInstaller.isVersionInstalled(versionInfo.getVersion())) { await dotNetCoreInstaller.downloadAndInstall(versionInfo, versionFetcher.getDownloadUrl(versionInfo)); + } else { + checkVersionForDeprecationAndNotify(versionSpec); } } else { throw new error("Hey developer you have called the method `installDotNet` without a `versionSpec` or without `useGlobalJson`. that is impossible."); From ae4fcee947d2540b9fca4eaff79e35225bdf0af7 Mon Sep 17 00:00:00 2001 From: "Anatolii Bolshakov (Akvelon INC)" Date: Wed, 6 Oct 2021 13:49:20 +0300 Subject: [PATCH 2/6] Amended warning --- Tasks/UseDotNetV2/usedotnet.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Tasks/UseDotNetV2/usedotnet.ts b/Tasks/UseDotNetV2/usedotnet.ts index 492e97cd108b..c962d708629d 100644 --- a/Tasks/UseDotNetV2/usedotnet.ts +++ b/Tasks/UseDotNetV2/usedotnet.ts @@ -13,7 +13,7 @@ import { error } from 'util'; function checkVersionForDeprecationAndNotify(versionSpec: string | null): void { if (versionSpec != null && versionSpec.startsWith("2.1")) { - console.log(`NET Core version you specfied (${versionSpec}) is out of support and will be removed from hosted agents soon. Please refer to https://aka.ms/dotnet-core-support for more information about the .NET support policy.`); + tl.warning(`NET Core version you specfied (${versionSpec}) is out of support and will be removed from hosted agents soon. Please refer to https://aka.ms/dotnet-core-support for more information about the .NET support policy.`); } } From 3798d61fbdeb84b23bcf975c0367679641dd3c39 Mon Sep 17 00:00:00 2001 From: AnnaOpareva <84513972+AnnaOpareva@users.noreply.github.com> Date: Fri, 8 Oct 2021 12:32:57 +0300 Subject: [PATCH 3/6] bump version --- Tasks/UseDotNetV2/task.json | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Tasks/UseDotNetV2/task.json b/Tasks/UseDotNetV2/task.json index 1a024e7dbbda..ebdcc63c94d3 100644 --- a/Tasks/UseDotNetV2/task.json +++ b/Tasks/UseDotNetV2/task.json @@ -13,7 +13,7 @@ "author": "Microsoft Corporation", "version": { "Major": 2, - "Minor": 194, + "Minor": 195, "Patch": 0 }, "satisfies": [ @@ -189,4 +189,4 @@ "OnlyExplicitVersionAllowed": "Only explicit versions and accepted, such as: 2.2.301. Version: %s is not valid.", "SupportPhaseNotPresentInChannel": "support-phase is not present in the channel with channel-version %s." } -} \ No newline at end of file +} From 50484cd4640cc7abfe4b948ba2e7c37e86467736 Mon Sep 17 00:00:00 2001 From: AnnaOpareva <84513972+AnnaOpareva@users.noreply.github.com> Date: Fri, 8 Oct 2021 12:33:28 +0300 Subject: [PATCH 4/6] bump version --- Tasks/UseDotNetV2/task.loc.json | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Tasks/UseDotNetV2/task.loc.json b/Tasks/UseDotNetV2/task.loc.json index f8c8662f9f40..0f265642bd40 100644 --- a/Tasks/UseDotNetV2/task.loc.json +++ b/Tasks/UseDotNetV2/task.loc.json @@ -13,7 +13,7 @@ "author": "Microsoft Corporation", "version": { "Major": 2, - "Minor": 194, + "Minor": 195, "Patch": 0 }, "satisfies": [ @@ -189,4 +189,4 @@ "OnlyExplicitVersionAllowed": "ms-resource:loc.messages.OnlyExplicitVersionAllowed", "SupportPhaseNotPresentInChannel": "ms-resource:loc.messages.SupportPhaseNotPresentInChannel" } -} \ No newline at end of file +} From 9f781f957f2faa02ddd8057acdb48cf9904de7e8 Mon Sep 17 00:00:00 2001 From: annaOpareva Date: Mon, 11 Oct 2021 15:54:56 +0300 Subject: [PATCH 5/6] fix loc messages --- .../Strings/resources.resjson/en-US/resources.resjson | 1 + Tasks/UseDotNetV2/task.json | 3 ++- Tasks/UseDotNetV2/task.loc.json | 3 ++- Tasks/UseDotNetV2/usedotnet.ts | 2 +- 4 files changed, 6 insertions(+), 3 deletions(-) diff --git a/Tasks/UseDotNetV2/Strings/resources.resjson/en-US/resources.resjson b/Tasks/UseDotNetV2/Strings/resources.resjson/en-US/resources.resjson index 484a7694c67f..99e904fb49db 100644 --- a/Tasks/UseDotNetV2/Strings/resources.resjson/en-US/resources.resjson +++ b/Tasks/UseDotNetV2/Strings/resources.resjson/en-US/resources.resjson @@ -96,4 +96,5 @@ "loc.messages.VersionNumberHasTheWrongFormat": "The version number: %s doesn't have the correct format. Versions can be given in the following formats: 2.x => Install latest in major version. 2.2.x => Install latest in major and minor version. 2.2.104 => Install exact version. Find the value of `version` for installing SDK/Runtime, from the releases.json. The link to releases.json of that major.minor version can be found in [**releases-index file.**](https://dotnetcli.blob.core.windows.net/dotnet/release-metadata/releases-index.json). Like link to releases.json for 2.2 version is https://dotnetcli.blob.core.windows.net/dotnet/release-metadata/2.2/releases.json", "loc.messages.OnlyExplicitVersionAllowed": "Only explicit versions and accepted, such as: 2.2.301. Version: %s is not valid.", "loc.messages.SupportPhaseNotPresentInChannel": "support-phase is not present in the channel with channel-version %s." + "loc.messages.DepricatedVersionNetCore": "NET Core version you specfied %s is out of support and will be removed from hosted agents soon. Please refer to https://aka.ms/dotnet-core-support for more information about the .NET support policy." } \ No newline at end of file diff --git a/Tasks/UseDotNetV2/task.json b/Tasks/UseDotNetV2/task.json index 1a024e7dbbda..2b281ab338bc 100644 --- a/Tasks/UseDotNetV2/task.json +++ b/Tasks/UseDotNetV2/task.json @@ -187,6 +187,7 @@ "FailedToReadGlobalJson": "The global.json at path: '%s' has the wrong format. For information about global.json, visit here: https://docs.microsoft.com/en-us/dotnet/core/tools/global-json. Error while trying to read: %s", "VersionNumberHasTheWrongFormat": "The version number: %s doesn't have the correct format. Versions can be given in the following formats: 2.x => Install latest in major version. 2.2.x => Install latest in major and minor version. 2.2.104 => Install exact version. Find the value of `version` for installing SDK/Runtime, from the releases.json. The link to releases.json of that major.minor version can be found in [**releases-index file.**](https://dotnetcli.blob.core.windows.net/dotnet/release-metadata/releases-index.json). Like link to releases.json for 2.2 version is https://dotnetcli.blob.core.windows.net/dotnet/release-metadata/2.2/releases.json", "OnlyExplicitVersionAllowed": "Only explicit versions and accepted, such as: 2.2.301. Version: %s is not valid.", - "SupportPhaseNotPresentInChannel": "support-phase is not present in the channel with channel-version %s." + "SupportPhaseNotPresentInChannel": "support-phase is not present in the channel with channel-version %s.", + "DepricatedVersionNetCore": "NET Core version you specfied %s is out of support and will be removed from hosted agents soon. Please refer to https://aka.ms/dotnet-core-support for more information about the .NET support policy." } } \ No newline at end of file diff --git a/Tasks/UseDotNetV2/task.loc.json b/Tasks/UseDotNetV2/task.loc.json index f8c8662f9f40..6fb033c860dd 100644 --- a/Tasks/UseDotNetV2/task.loc.json +++ b/Tasks/UseDotNetV2/task.loc.json @@ -187,6 +187,7 @@ "FailedToReadGlobalJson": "ms-resource:loc.messages.FailedToReadGlobalJson", "VersionNumberHasTheWrongFormat": "ms-resource:loc.messages.VersionNumberHasTheWrongFormat", "OnlyExplicitVersionAllowed": "ms-resource:loc.messages.OnlyExplicitVersionAllowed", - "SupportPhaseNotPresentInChannel": "ms-resource:loc.messages.SupportPhaseNotPresentInChannel" + "SupportPhaseNotPresentInChannel": "ms-resource:loc.messages.SupportPhaseNotPresentInChannel", + "DepricatedVersionNetCore": "ms-resource:loc.messages.DepricatedVersionNetCore" } } \ No newline at end of file diff --git a/Tasks/UseDotNetV2/usedotnet.ts b/Tasks/UseDotNetV2/usedotnet.ts index c962d708629d..0675b4ddfe6e 100644 --- a/Tasks/UseDotNetV2/usedotnet.ts +++ b/Tasks/UseDotNetV2/usedotnet.ts @@ -13,7 +13,7 @@ import { error } from 'util'; function checkVersionForDeprecationAndNotify(versionSpec: string | null): void { if (versionSpec != null && versionSpec.startsWith("2.1")) { - tl.warning(`NET Core version you specfied (${versionSpec}) is out of support and will be removed from hosted agents soon. Please refer to https://aka.ms/dotnet-core-support for more information about the .NET support policy.`); + tl.warning(tl.loc('DepricatedVersionNetCore',versionSpec)); } } From 837d2d343a300c5cf9c9f443112416583ce887a0 Mon Sep 17 00:00:00 2001 From: annaOpareva Date: Mon, 11 Oct 2021 16:01:38 +0300 Subject: [PATCH 6/6] add endlines --- .../Strings/resources.resjson/en-US/resources.resjson | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Tasks/UseDotNetV2/Strings/resources.resjson/en-US/resources.resjson b/Tasks/UseDotNetV2/Strings/resources.resjson/en-US/resources.resjson index 99e904fb49db..525a90a6b2d6 100644 --- a/Tasks/UseDotNetV2/Strings/resources.resjson/en-US/resources.resjson +++ b/Tasks/UseDotNetV2/Strings/resources.resjson/en-US/resources.resjson @@ -97,4 +97,4 @@ "loc.messages.OnlyExplicitVersionAllowed": "Only explicit versions and accepted, such as: 2.2.301. Version: %s is not valid.", "loc.messages.SupportPhaseNotPresentInChannel": "support-phase is not present in the channel with channel-version %s." "loc.messages.DepricatedVersionNetCore": "NET Core version you specfied %s is out of support and will be removed from hosted agents soon. Please refer to https://aka.ms/dotnet-core-support for more information about the .NET support policy." -} \ No newline at end of file +}