manualExit suppresses -quit, useful for buildMethods with async calls (#574)

* `manualExit` suppresses `-quit`, useful for buildMethods with async calls

* Use boolean
This commit is contained in:
Toby Harris
2023-09-20 22:41:17 +01:00
committed by GitHub
parent 2190fd5667
commit a13443a746
8 changed files with 39 additions and 2 deletions

View File

@@ -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,

View File

@@ -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 },

View File

@@ -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');

View File

@@ -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') || '';
}