Skip to content
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
12 changes: 11 additions & 1 deletion Tasks/UnityBuild/UnityBuildV3/task.json
Original file line number Diff line number Diff line change
Expand Up @@ -200,6 +200,16 @@
"defaultValue": "",
"helpMarkDown": "Specify class and method name of the method to execute in your build script separated by a dot. E.g. `MyClass.PerformBuild`"
},
{
"name": "scriptCompletionQuit",
"type": "boolean",
"label": "Quit after script method completion",
"groupName": "build",
"visibleRule": "buildScriptType = existing",
"required": false,
"defaultValue": true,
"helpMarkDown": "Weather to quit the Unity editor after the build script method has completed. If set to false, the editor will stay open after the build script method has completed. The default value is true."
},
{
"name": "additionalCmdArgs",
"type": "string",
Expand Down Expand Up @@ -293,4 +303,4 @@
"successGetUnityEditorVersion": "Success, Unity editor version found",
"failGetUnityEditorVersion": "Fail, Unity editor version not found"
}
}
}
9 changes: 7 additions & 2 deletions Tasks/UnityBuild/UnityBuildV3/unity-build.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ const buildScriptTypeInputVariableName = 'buildScriptType';
const unityEditorsPathModeInputVariableName = 'unityEditorsPathMode';
const inlineBuildScriptInputVariableName = 'inlineBuildScript';
const scriptExecuteMethodInputVariableName = 'scriptExecuteMethod';
const scriptCompletionQuitInputVariableName = 'scriptCompletionQuit';
const additionalCmdArgsInputVariableName = 'additionalCmdArgs';
const customUnityEditorsPathInputVariableName = 'customUnityEditorsPath';
const cleanBuildInputVariableName = 'Build.Repository.Clean';
Expand Down Expand Up @@ -138,7 +139,11 @@ async function run() {
unityCmd.arg('-executeMethod').arg(tl.getInput(scriptExecuteMethodInputVariableName)!);
} else if (buildScriptType === 'existing') {
// If the user already has an existing build script we only need the method to execute.
unityCmd.arg('-executeMethod').arg(tl.getInput(scriptExecuteMethodInputVariableName)!).arg('-quit');
unityCmd.arg('-executeMethod').arg(tl.getInput(scriptExecuteMethodInputVariableName)!);

if (tl.getBoolInput(scriptCompletionQuitInputVariableName)) {
unityCmd.arg('-quit');
}
} else {
throw `Unsupported build script type ${buildScriptType}`
}
Expand Down Expand Up @@ -187,4 +192,4 @@ function getUnityEditorVersion(): UnityVersionInfoResult {
return unityVersion;
}

run();
run();