зеркало из https://github.com/microsoft/BuildXL.git
Merged PR 587278: Update nodejs version for rush test.
Update nodejs version for rush test. Related work items: #1794623
This commit is contained in:
Родитель
d7a5ab55fe
Коммит
0fa99c3a6b
|
@ -273,9 +273,14 @@ config({{
|
||||||
string rushJson = File.ReadAllText(pathToRushJson);
|
string rushJson = File.ReadAllText(pathToRushJson);
|
||||||
|
|
||||||
// Update the initial template created by 'rush init' to accept a higher version of node
|
// Update the initial template created by 'rush init' to accept a higher version of node
|
||||||
var updatedRushJson = rushJson.Replace(
|
// Also update the pnpm version to make it work correctly with node
|
||||||
|
var updatedRushJson = rushJson
|
||||||
|
.Replace(
|
||||||
"\"nodeSupportedVersionRange\": \">=10.13.0 <11.0.0\"",
|
"\"nodeSupportedVersionRange\": \">=10.13.0 <11.0.0\"",
|
||||||
"\"nodeSupportedVersionRange\": \">=10.13.0 <13.3.1\"");
|
"\"nodeSupportedVersionRange\": \">=10.13.0 <15.2.2\"")
|
||||||
|
.Replace(
|
||||||
|
"\"pnpmVersion\": \"2.15.1\"",
|
||||||
|
"\"pnpmVersion\": \"5.0.2\"");
|
||||||
|
|
||||||
File.WriteAllText(pathToRushJson, updatedRushJson);
|
File.WriteAllText(pathToRushJson, updatedRushJson);
|
||||||
}
|
}
|
||||||
|
|
|
@ -86,31 +86,8 @@ namespace Test.Rush {
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
subfolder: a`node`,
|
subfolder: a`node`,
|
||||||
contents: [getNodeExeForRushDirectory()]
|
contents: [Node.Node.nodeExecutables]
|
||||||
},
|
},
|
||||||
],
|
],
|
||||||
});
|
});
|
||||||
|
|
||||||
const nodeWinDir = "node-v12.16.1-win-x64";
|
|
||||||
const nodeOsxDir = "node-v12.16.1-darwin-x64";
|
|
||||||
|
|
||||||
function getNodeExeForRushDirectory(): StaticDirectory {
|
|
||||||
Contract.assert(isRunningOnSupportedSystem, "Only 64bit versions of Win and OSX supported.");
|
|
||||||
|
|
||||||
let pkgContents : StaticDirectory = undefined;
|
|
||||||
|
|
||||||
const host = Context.getCurrentHost();
|
|
||||||
switch (host.os) {
|
|
||||||
case "win":
|
|
||||||
pkgContents = Transformer.reSealPartialDirectory(importFrom("NodeJs.ForRush.win-x64").extracted, r`${nodeWinDir}`);
|
|
||||||
break;
|
|
||||||
case "macOS":
|
|
||||||
pkgContents = Transformer.reSealPartialDirectory(importFrom("NodeJs.ForRush.osx-x64").extracted, r`${nodeOsxDir}\bin`);
|
|
||||||
break;
|
|
||||||
default:
|
|
||||||
Contract.fail(`The current NodeJs package doesn't support the current OS: ${host.os}. Ensure you run on a supported OS -or- update the NodeJs package to have the version embdded.`);
|
|
||||||
}
|
|
||||||
|
|
||||||
return pkgContents;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
13
config.dsc
13
config.dsc
|
@ -495,19 +495,6 @@ config({
|
||||||
url: "https://nodejs.org/dist/v15.2.1/node-v15.2.1-linux-x64.tar.gz",
|
url: "https://nodejs.org/dist/v15.2.1/node-v15.2.1-linux-x64.tar.gz",
|
||||||
hash: "VSO0:038EB56ECF4C3FEC397E149A91F32DDD0E91E9FB61E7BA064FB9E5E5C0A3779800",
|
hash: "VSO0:038EB56ECF4C3FEC397E149A91F32DDD0E91E9FB61E7BA064FB9E5E5C0A3779800",
|
||||||
archiveType: "tgz",
|
archiveType: "tgz",
|
||||||
},
|
|
||||||
// Rush tests need an LTS (older) version of NodeJs
|
|
||||||
{
|
|
||||||
moduleName: "NodeJs.ForRush.win-x64",
|
|
||||||
url: "https://nodejs.org/dist/v12.16.1/node-v12.16.1-win-x64.zip",
|
|
||||||
hash: "VSO0:B65327703FB1775A7ABD637D44816CDE13DFE01BD98FF2B1B1DE8DAC46D1567800",
|
|
||||||
archiveType: "zip",
|
|
||||||
},
|
|
||||||
{
|
|
||||||
moduleName: "NodeJs.ForRush.osx-x64",
|
|
||||||
url: "https://nodejs.org/dist/v12.16.1/node-v12.16.1-darwin-x64.tar.gz",
|
|
||||||
hash: "VSO0:A3DEEC9D7C133120F255195146072452C6D06D24E7F97754F342627C53A5008000",
|
|
||||||
archiveType: "tgz",
|
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
},
|
},
|
||||||
|
|
Загрузка…
Ссылка в новой задаче