`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
|
required: false
|
||||||
default: ''
|
default: ''
|
||||||
description: 'Path to a Namespace.Class.StaticMethod to run to perform the build.'
|
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:
|
customParameters:
|
||||||
required: false
|
required: false
|
||||||
default: ''
|
default: ''
|
||||||
|
|
|
@ -265,6 +265,7 @@ class BuildParameters {
|
||||||
buildFile,
|
buildFile,
|
||||||
buildMethod: input_1.default.buildMethod,
|
buildMethod: input_1.default.buildMethod,
|
||||||
buildVersion,
|
buildVersion,
|
||||||
|
manualExit: input_1.default.manualExit,
|
||||||
androidVersionCode,
|
androidVersionCode,
|
||||||
androidKeystoreName: input_1.default.androidKeystoreName,
|
androidKeystoreName: input_1.default.androidKeystoreName,
|
||||||
androidKeystoreBase64: input_1.default.androidKeystoreBase64,
|
androidKeystoreBase64: input_1.default.androidKeystoreBase64,
|
||||||
|
@ -6269,6 +6270,7 @@ class ImageEnvironmentFactory {
|
||||||
{ name: 'BUILD_PATH', value: parameters.buildPath },
|
{ name: 'BUILD_PATH', value: parameters.buildPath },
|
||||||
{ name: 'BUILD_FILE', value: parameters.buildFile },
|
{ name: 'BUILD_FILE', value: parameters.buildFile },
|
||||||
{ name: 'BUILD_METHOD', value: parameters.buildMethod },
|
{ name: 'BUILD_METHOD', value: parameters.buildMethod },
|
||||||
|
{ name: 'MANUAL_EXIT', value: parameters.manualExit },
|
||||||
{ name: 'VERSION', value: parameters.buildVersion },
|
{ name: 'VERSION', value: parameters.buildVersion },
|
||||||
{ name: 'ANDROID_VERSION_CODE', value: parameters.androidVersionCode },
|
{ name: 'ANDROID_VERSION_CODE', value: parameters.androidVersionCode },
|
||||||
{ name: 'ANDROID_KEYSTORE_NAME', value: parameters.androidKeystoreName },
|
{ name: 'ANDROID_KEYSTORE_NAME', value: parameters.androidKeystoreName },
|
||||||
|
@ -6828,6 +6830,10 @@ class Input {
|
||||||
static get buildMethod() {
|
static get buildMethod() {
|
||||||
return Input.getInput('buildMethod') || ''; // Processed in docker file
|
return Input.getInput('buildMethod') || ''; // Processed in docker file
|
||||||
}
|
}
|
||||||
|
static get manualExit() {
|
||||||
|
const input = Input.getInput('manualExit') || false;
|
||||||
|
return input === 'true';
|
||||||
|
}
|
||||||
static get customParameters() {
|
static get customParameters() {
|
||||||
return Input.getInput('customParameters') || '';
|
return Input.getInput('customParameters') || '';
|
||||||
}
|
}
|
||||||
|
|
File diff suppressed because one or more lines are too long
|
@ -119,7 +119,7 @@ echo ""
|
||||||
|
|
||||||
unity-editor \
|
unity-editor \
|
||||||
-logfile /dev/stdout \
|
-logfile /dev/stdout \
|
||||||
-quit \
|
$( [ "${MANUAL_EXIT}" == "true" ] || echo "-quit" ) \
|
||||||
-customBuildName "$BUILD_NAME" \
|
-customBuildName "$BUILD_NAME" \
|
||||||
-projectPath "$UNITY_PROJECT_PATH" \
|
-projectPath "$UNITY_PROJECT_PATH" \
|
||||||
-buildTarget "$BUILD_TARGET" \
|
-buildTarget "$BUILD_TARGET" \
|
||||||
|
|
|
@ -29,6 +29,7 @@ class BuildParameters {
|
||||||
public buildFile!: string;
|
public buildFile!: string;
|
||||||
public buildMethod!: string;
|
public buildMethod!: string;
|
||||||
public buildVersion!: string;
|
public buildVersion!: string;
|
||||||
|
public manualExit!: boolean;
|
||||||
public androidVersionCode!: string;
|
public androidVersionCode!: string;
|
||||||
public androidKeystoreName!: string;
|
public androidKeystoreName!: string;
|
||||||
public androidKeystoreBase64!: string;
|
public androidKeystoreBase64!: string;
|
||||||
|
@ -139,6 +140,7 @@ class BuildParameters {
|
||||||
buildFile,
|
buildFile,
|
||||||
buildMethod: Input.buildMethod,
|
buildMethod: Input.buildMethod,
|
||||||
buildVersion,
|
buildVersion,
|
||||||
|
manualExit: Input.manualExit,
|
||||||
androidVersionCode,
|
androidVersionCode,
|
||||||
androidKeystoreName: Input.androidKeystoreName,
|
androidKeystoreName: Input.androidKeystoreName,
|
||||||
androidKeystoreBase64: Input.androidKeystoreBase64,
|
androidKeystoreBase64: Input.androidKeystoreBase64,
|
||||||
|
|
|
@ -37,6 +37,7 @@ class ImageEnvironmentFactory {
|
||||||
{ name: 'BUILD_PATH', value: parameters.buildPath },
|
{ name: 'BUILD_PATH', value: parameters.buildPath },
|
||||||
{ name: 'BUILD_FILE', value: parameters.buildFile },
|
{ name: 'BUILD_FILE', value: parameters.buildFile },
|
||||||
{ name: 'BUILD_METHOD', value: parameters.buildMethod },
|
{ name: 'BUILD_METHOD', value: parameters.buildMethod },
|
||||||
|
{ name: 'MANUAL_EXIT', value: parameters.manualExit },
|
||||||
{ name: 'VERSION', value: parameters.buildVersion },
|
{ name: 'VERSION', value: parameters.buildVersion },
|
||||||
{ name: 'ANDROID_VERSION_CODE', value: parameters.androidVersionCode },
|
{ name: 'ANDROID_VERSION_CODE', value: parameters.androidVersionCode },
|
||||||
{ name: 'ANDROID_KEYSTORE_NAME', value: parameters.androidKeystoreName },
|
{ 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', () => {
|
describe('versioningStrategy', () => {
|
||||||
it('returns the default value', () => {
|
it('returns the default value', () => {
|
||||||
expect(Input.versioningStrategy).toStrictEqual('Semantic');
|
expect(Input.versioningStrategy).toStrictEqual('Semantic');
|
||||||
|
|
|
@ -126,6 +126,12 @@ class Input {
|
||||||
return Input.getInput('buildMethod') || ''; // Processed in docker file
|
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 {
|
static get customParameters(): string {
|
||||||
return Input.getInput('customParameters') || '';
|
return Input.getInput('customParameters') || '';
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue