Remove androidAppBundle input for V3. Should use androidExportType instead

pull/529/head
Andrew Kahr 2023-03-27 21:16:55 -07:00
parent d10a2ccdb3
commit c84a438717
5 changed files with 5 additions and 112 deletions

View File

@ -47,13 +47,9 @@ inputs:
required: false
default: ''
description: 'The android versionCode'
androidAppBundle:
required: false
default: ''
description: '[Deprecated] Use androidExportType instead. Whether to build .aab instead of .apk'
androidExportType:
required: false
default: ''
default: 'androidPackage'
description:
'The android export type. Should be androidPackage for apk, androidAppBundle for aab, or androidStudioProject for
an android studio project.'

21
dist/index.js generated vendored
View File

@ -6739,27 +6739,8 @@ class Input {
static get androidVersionCode() {
return Input.getInput('androidVersionCode') || '';
}
static get androidAppBundle() {
// Only throw warning if defined
let input = Input.getInput('androidAppBundle');
if (input !== undefined) {
core.warning('androidAppBundle is deprecated, please use androidExportType instead');
}
else {
input = 'false';
}
return input === 'true';
}
static get androidExportType() {
// TODO: remove this in V3
const exportType = Input.getInput('androidExportType') || '';
if (exportType !== '') {
return exportType;
}
return Input.androidAppBundle ? 'androidAppBundle' : 'androidPackage';
// End TODO
// Use this in V3 when androidAppBundle is removed
// return Input.getInput('androidExportType') || 'androidPackage';
return Input.getInput('androidExportType') || 'androidPackage';
}
static get androidKeystoreName() {
return Input.getInput('androidKeystoreName') || '';

2
dist/index.js.map generated vendored

File diff suppressed because one or more lines are too long

View File

@ -143,81 +143,21 @@ describe('Input', () => {
});
});
describe('androidAppBundle', () => {
it('returns the default value', () => {
expect(Input.androidAppBundle).toStrictEqual(false);
});
it('returns true when string true is passed', () => {
const spy = jest.spyOn(core, 'getInput').mockReturnValue('true');
expect(Input.androidAppBundle).toStrictEqual(true);
expect(spy).toHaveBeenCalledTimes(1);
});
it('returns false when string false is passed', () => {
const spy = jest.spyOn(core, 'getInput').mockReturnValue('false');
expect(Input.androidAppBundle).toStrictEqual(false);
expect(spy).toHaveBeenCalledTimes(1);
});
});
describe('androidExportType', () => {
it('returns the default value', () => {
expect(Input.androidExportType).toStrictEqual('androidPackage');
});
// TODO: Remove "and androidAppBundle is not set" in v3
test.each`
input | expected
${'androidPackage'} | ${'androidPackage'}
${'androidAppBundle'} | ${'androidAppBundle'}
${'androidStudioProject'} | ${'androidStudioProject'}
`('returns $expected when $input is passed and androidAppBundle is not set', ({ input, expected }) => {
`('returns $expected when $input is passed', ({ input, expected }) => {
const spy = jest.spyOn(core, 'getInput').mockReturnValue(input);
expect(Input.androidExportType).toStrictEqual(expected);
expect(spy).toHaveBeenCalledTimes(1);
});
// TODO: Remove in v3
test.each`
input | expected
${'androidPackage'} | ${'androidPackage'}
${'androidAppBundle'} | ${'androidAppBundle'}
${'androidStudioProject'} | ${'androidStudioProject'}
`('returns $expected when $input is passed and overrides androidAppBundle if it is set', ({ input, expected }) => {
const spy = jest.spyOn(Input, 'getInput');
spy.mockImplementationOnce(() => {
return input;
});
spy.mockImplementationOnce(() => {
return 'true';
});
expect(Input.androidExportType).toStrictEqual(expected);
expect(spy).toHaveBeenCalledTimes(1);
});
// TODO: Remove in v3
test.each`
input | expected
${'true'} | ${'androidAppBundle'}
${'false'} | ${'androidPackage'}
`(
'returns $expected when androidExportType is undefined and androidAppBundle is set to $input',
({ input, expected }) => {
const spy = jest.spyOn(Input, 'getInput');
spy.mockImplementationOnce(() => {
return '';
});
spy.mockImplementationOnce(() => {
return input;
});
expect(Input.androidExportType).toStrictEqual(expected);
expect(spy).toHaveBeenCalledTimes(2);
},
);
});
describe('androidSymbolType', () => {

View File

@ -142,32 +142,8 @@ class Input {
return Input.getInput('androidVersionCode') || '';
}
static get androidAppBundle(): boolean {
// Only throw warning if defined
let input = Input.getInput('androidAppBundle');
if (input !== undefined) {
core.warning('androidAppBundle is deprecated, please use androidExportType instead');
} else {
input = 'false';
}
return input === 'true';
}
static get androidExportType(): string {
// TODO: remove this in V3
const exportType = Input.getInput('androidExportType') || '';
if (exportType !== '') {
return exportType;
}
return Input.androidAppBundle ? 'androidAppBundle' : 'androidPackage';
// End TODO
// Use this in V3 when androidAppBundle is removed
// return Input.getInput('androidExportType') || 'androidPackage';
return Input.getInput('androidExportType') || 'androidPackage';
}
static get androidKeystoreName(): string {