`manualExit` suppresses `-quit`, useful for buildMethods with async calls (#574)
* `manualExit` suppresses `-quit`, useful for buildMethods with async calls * Use booleanfix/android-tools
parent
2190fd5667
commit
a13443a746
|
@ -31,6 +31,10 @@ inputs:
|
|||
required: false
|
||||
default: ''
|
||||
description: 'Path to a Namespace.Class.StaticMethod to run to perform the build.'
|
||||
manualExit:
|
||||
required: false
|
||||
default: ''
|
||||
description: 'Suppresses `-quit`. Exit your build method using `EditorApplication.Exit(0)` instead.'
|
||||
customParameters:
|
||||
required: false
|
||||
default: ''
|
||||
|
|
|
@ -265,6 +265,7 @@ class BuildParameters {
|
|||
buildFile,
|
||||
buildMethod: input_1.default.buildMethod,
|
||||
buildVersion,
|
||||
manualExit: input_1.default.manualExit,
|
||||
androidVersionCode,
|
||||
androidKeystoreName: input_1.default.androidKeystoreName,
|
||||
androidKeystoreBase64: input_1.default.androidKeystoreBase64,
|
||||
|
@ -6269,6 +6270,7 @@ class ImageEnvironmentFactory {
|
|||
{ name: 'BUILD_PATH', value: parameters.buildPath },
|
||||
{ name: 'BUILD_FILE', value: parameters.buildFile },
|
||||
{ name: 'BUILD_METHOD', value: parameters.buildMethod },
|
||||
{ name: 'MANUAL_EXIT', value: parameters.manualExit },
|
||||
{ name: 'VERSION', value: parameters.buildVersion },
|
||||
{ name: 'ANDROID_VERSION_CODE', value: parameters.androidVersionCode },
|
||||
{ name: 'ANDROID_KEYSTORE_NAME', value: parameters.androidKeystoreName },
|
||||
|
@ -6828,6 +6830,10 @@ class Input {
|
|||
static get buildMethod() {
|
||||
return Input.getInput('buildMethod') || ''; // Processed in docker file
|
||||
}
|
||||
static get manualExit() {
|
||||
const input = Input.getInput('manualExit') || false;
|
||||
return input === 'true';
|
||||
}
|
||||
static get customParameters() {
|
||||
return Input.getInput('customParameters') || '';
|
||||
}
|
||||
|
|
File diff suppressed because one or more lines are too long
|
@ -119,7 +119,7 @@ echo ""
|
|||
|
||||
unity-editor \
|
||||
-logfile /dev/stdout \
|
||||
-quit \
|
||||
$( [ "${MANUAL_EXIT}" == "true" ] || echo "-quit" ) \
|
||||
-customBuildName "$BUILD_NAME" \
|
||||
-projectPath "$UNITY_PROJECT_PATH" \
|
||||
-buildTarget "$BUILD_TARGET" \
|
||||
|
|
|
@ -29,6 +29,7 @@ class BuildParameters {
|
|||
public buildFile!: string;
|
||||
public buildMethod!: string;
|
||||
public buildVersion!: string;
|
||||
public manualExit!: boolean;
|
||||
public androidVersionCode!: string;
|
||||
public androidKeystoreName!: string;
|
||||
public androidKeystoreBase64!: string;
|
||||
|
@ -139,6 +140,7 @@ class BuildParameters {
|
|||
buildFile,
|
||||
buildMethod: Input.buildMethod,
|
||||
buildVersion,
|
||||
manualExit: Input.manualExit,
|
||||
androidVersionCode,
|
||||
androidKeystoreName: Input.androidKeystoreName,
|
||||
androidKeystoreBase64: Input.androidKeystoreBase64,
|
||||
|
|
|
@ -37,6 +37,7 @@ class ImageEnvironmentFactory {
|
|||
{ name: 'BUILD_PATH', value: parameters.buildPath },
|
||||
{ name: 'BUILD_FILE', value: parameters.buildFile },
|
||||
{ name: 'BUILD_METHOD', value: parameters.buildMethod },
|
||||
{ name: 'MANUAL_EXIT', value: parameters.manualExit },
|
||||
{ name: 'VERSION', value: parameters.buildVersion },
|
||||
{ name: 'ANDROID_VERSION_CODE', value: parameters.androidVersionCode },
|
||||
{ name: 'ANDROID_KEYSTORE_NAME', value: parameters.androidKeystoreName },
|
||||
|
|
|
@ -104,6 +104,24 @@ describe('Input', () => {
|
|||
});
|
||||
});
|
||||
|
||||
describe('manualExit', () => {
|
||||
it('returns the default value', () => {
|
||||
expect(Input.manualExit).toStrictEqual(false);
|
||||
});
|
||||
|
||||
it('returns true when string true is passed', () => {
|
||||
const spy = jest.spyOn(core, 'getInput').mockReturnValue('true');
|
||||
expect(Input.manualExit).toStrictEqual(true);
|
||||
expect(spy).toHaveBeenCalledTimes(1);
|
||||
});
|
||||
|
||||
it('returns false when string false is passed', () => {
|
||||
const spy = jest.spyOn(core, 'getInput').mockReturnValue('false');
|
||||
expect(Input.manualExit).toStrictEqual(false);
|
||||
expect(spy).toHaveBeenCalledTimes(1);
|
||||
});
|
||||
});
|
||||
|
||||
describe('versioningStrategy', () => {
|
||||
it('returns the default value', () => {
|
||||
expect(Input.versioningStrategy).toStrictEqual('Semantic');
|
||||
|
|
|
@ -126,6 +126,12 @@ class Input {
|
|||
return Input.getInput('buildMethod') || ''; // Processed in docker file
|
||||
}
|
||||
|
||||
static get manualExit(): boolean {
|
||||
const input = Input.getInput('manualExit') || false;
|
||||
|
||||
return input === 'true';
|
||||
}
|
||||
|
||||
static get customParameters(): string {
|
||||
return Input.getInput('customParameters') || '';
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue