Support global.json's rollForward latest* variants (#538)
* Rename toolcache directory instead of moving to tmp This further enhances time savings seen in #213, down from a few minutes to seconds. * Remove branch constraint on workflows used for testing This means you are going to be notified of CI issues quicker, especially if you have to wait for a confirmation before running the workflows on your PR. * Support global.json's rollForward latest* variants * Remove e2e-test's dependency on Microsoft.NET.Test.Sdk The newer versions are net8.0/net462+ only, making older .NET sdks more annoying to test * Revert "Remove e2e-test's dependency on Microsoft.NET.Test.Sdk" This reverts commit 14839a662649cdea79ccecc3a7ce9a91386185b4. * Don't run unsupported versions in global.json tests * Revert "Remove branch constraint on workflows used for testing" This reverts commit d9dae35030614ced7b174b151463481173bfe2a3.
This commit is contained in:
+21
-3
@@ -207,9 +207,27 @@ function getVersionFromGlobalJson(globalJsonPath: string): string {
|
||||
if (globalJson.sdk && globalJson.sdk.version) {
|
||||
version = globalJson.sdk.version;
|
||||
const rollForward = globalJson.sdk.rollForward;
|
||||
if (rollForward && rollForward === 'latestFeature') {
|
||||
const [major, minor] = version.split('.');
|
||||
version = `${major}.${minor}`;
|
||||
if (rollForward) {
|
||||
const [major, minor, featurePatch] = version.split('.');
|
||||
const feature = featurePatch.substring(0, 1);
|
||||
|
||||
switch (rollForward) {
|
||||
case 'latestMajor':
|
||||
version = '';
|
||||
break;
|
||||
|
||||
case 'latestMinor':
|
||||
version = `${major}`;
|
||||
break;
|
||||
|
||||
case 'latestFeature':
|
||||
version = `${major}.${minor}`;
|
||||
break;
|
||||
|
||||
case 'latestPatch':
|
||||
version = `${major}.${minor}.${feature}xx`;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
return version;
|
||||
|
||||
Reference in New Issue
Block a user