ADdd module parameters on Mac prepare

pull/418/head
Dal Rupnik 2022-07-27 12:42:54 +02:00
parent 5634f18075
commit f2c9df8178
3 changed files with 57 additions and 7 deletions

29
dist/index.js vendored
View File

@ -5442,15 +5442,38 @@ class SetupMac {
}
});
}
static getModuleParametersForTargetPlatform(targetPlatform) {
let command = '';
switch (targetPlatform) {
case 'iOS':
command += '--module ios ';
break;
case 'tvOS':
command += '--module tvos ';
break;
case 'Android':
command += '--module android ';
break;
case 'MacOS':
command += '--module mac-il2cpp ';
break;
case 'WebGL':
command += '--module webgl ';
break;
default:
throw new Error(`Unsupported module for target platform: ${targetPlatform}.`);
}
command += `--childModules`;
return command.trim();
}
static installUnity(buildParameters, silent = false) {
return __awaiter(this, void 0, void 0, function* () {
const unityChangeset = yield unity_changeset_1.getUnityChangeset(buildParameters.editorVersion);
const moduleCommand = this.getModuleParametersForTargetPlatform(buildParameters.targetPlatform);
const command = `${this.unityHubPath} -- --headless install \
--version ${buildParameters.editorVersion} \
--changeset ${unityChangeset.changeset} \
--module mac-il2cpp \
--module ios \
--childModules`;
${moduleCommand}`;
// Ignoring return code because the log seems to overflow the internal buffer which triggers
// a false error
const errorCode = yield exec_1.exec(command, undefined, { silent, ignoreReturnCode: true });

2
dist/index.js.map vendored

File diff suppressed because one or more lines are too long

View File

@ -30,14 +30,41 @@ class SetupMac {
}
}
private static getModuleParametersForTargetPlatform(targetPlatform: string): string {
let command = '';
switch (targetPlatform) {
case 'iOS':
command += '--module ios ';
break;
case 'tvOS':
command += '--module tvos ';
break;
case 'Android':
command += '--module android ';
break;
case 'MacOS':
command += '--module mac-il2cpp ';
break;
case 'WebGL':
command += '--module webgl ';
break;
default:
throw new Error(`Unsupported module for target platform: ${targetPlatform}.`);
}
command += `--childModules`;
return command.trim();
}
private static async installUnity(buildParameters: BuildParameters, silent = false) {
const unityChangeset = await getUnityChangeset(buildParameters.editorVersion);
const moduleCommand = this.getModuleParametersForTargetPlatform(buildParameters.targetPlatform);
const command = `${this.unityHubPath} -- --headless install \
--version ${buildParameters.editorVersion} \
--changeset ${unityChangeset.changeset} \
--module mac-il2cpp \
--module ios \
--childModules`;
${moduleCommand}`;
// Ignoring return code because the log seems to overflow the internal buffer which triggers
// a false error