Skip to content

Commit 53151f5

Browse files
committed
Add support for using google_apis_playstore system images.
1 parent fd240e4 commit 53151f5

File tree

10 files changed

+21
-9
lines changed

10 files changed

+21
-9
lines changed

.github/workflows/workflow.yml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,10 @@ jobs:
3333
- os: macos-latest
3434
api-level: 30
3535
target: google_apis
36+
- os: macos-latest
37+
api-level: 24
38+
target: playstore
39+
3640
steps:
3741
- name: checkout
3842
uses: actions/checkout@v2

README.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -86,10 +86,10 @@ jobs:
8686

8787
## Configurations
8888

89-
| | **Required** | **Default** | **Description** |
90-
|----------------------|--------------|-------------|----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
89+
| **Input** | **Required** | **Default** | **Description** |
90+
|-|-|-|-|
9191
| `api-level` | Required | N/A | API level of the platform system image - e.g. 23 for Android Marshmallow, 29 for Android 10. **Minimum API level supported is 15**. |
92-
| `target` | Optional | `default` | Target of the system image - `default` or `google_apis`. |
92+
| `target` | Optional | `default` | Target of the system image - `default`, `google_apis` or `playstore`. |
9393
| `arch` | Optional | `x86` | CPU architecture of the system image - `x86` or `x86_64`. Note that `x86_64` image is only available for API 21+. |
9494
| `profile` | Optional | N/A | Hardware profile used for creating the AVD - e.g. `Nexus 6`. For a list of all profiles available, run `avdmanager list` and refer to the results under "Available Android Virtual Devices". |
9595
| `avd-name` | Optional | `test` | Custom AVD name used for creating the Android Virtual Device. |

__tests__/input-validator.test.ts

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,11 @@ describe('target validator tests', () => {
5353
validator.checkTarget('google_apis');
5454
};
5555
expect(func2).not.toThrow();
56+
57+
const func3 = () => {
58+
validator.checkTarget('google_apis');
59+
};
60+
expect(func3).not.toThrow();
5661
});
5762
});
5863

action.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ inputs:
99
description: 'API level of the platform and system image - e.g. 23 for Android Marshmallow, 29 for Android 10'
1010
required: true
1111
target:
12-
description: 'target of the system image - default or google_apis'
12+
description: 'target of the system image - default, google_apis or playstore'
1313
default: 'default'
1414
arch:
1515
description: 'CPU architecture of the system image - x86 or x86_64'

lib/input-validator.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
Object.defineProperty(exports, "__esModule", { value: true });
33
exports.checkEmulatorBuild = exports.checkDisableAnimations = exports.checkArch = exports.checkTarget = exports.checkApiLevel = exports.VALID_ARCHS = exports.VALID_TARGETS = exports.MIN_API_LEVEL = void 0;
44
exports.MIN_API_LEVEL = 15;
5-
exports.VALID_TARGETS = ['default', 'google_apis'];
5+
exports.VALID_TARGETS = ['default', 'google_apis', 'google_apis_playstore'];
66
exports.VALID_ARCHS = ['x86', 'x86_64'];
77
function checkApiLevel(apiLevel) {
88
if (isNaN(Number(apiLevel)) || !Number.isInteger(Number(apiLevel))) {

lib/main.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,8 @@ function run() {
5252
const apiLevel = Number(apiLevelInput);
5353
console.log(`API level: ${apiLevel}`);
5454
// target of the system image
55-
const target = core.getInput('target');
55+
const targetInput = core.getInput('target');
56+
const target = targetInput == 'playstore' ? 'google_apis_playstore' : targetInput;
5657
input_validator_1.checkTarget(target);
5758
console.log(`target: ${target}`);
5859
// CPU architecture of the system image

src/input-validator.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
export const MIN_API_LEVEL = 15;
2-
export const VALID_TARGETS: Array<string> = ['default', 'google_apis'];
2+
export const VALID_TARGETS: Array<string> = ['default', 'google_apis', 'google_apis_playstore'];
33
export const VALID_ARCHS: Array<string> = ['x86', 'x86_64'];
44

55
export function checkApiLevel(apiLevel: string): void {

src/main.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,8 @@ async function run() {
2525
console.log(`API level: ${apiLevel}`);
2626

2727
// target of the system image
28-
const target = core.getInput('target');
28+
const targetInput = core.getInput('target');
29+
const target = targetInput == 'playstore' ? 'google_apis_playstore' : targetInput;
2930
checkTarget(target);
3031
console.log(`target: ${target}`);
3132

test-fixture/gradle.properties

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
org.gradle.parallel=true
22
org.gradle.configureondemand=true
33
org.gradle.caching=true
4+
org.gradle.vfs.watch=true
45

56
# Enable Kotlin incremental compilation
67
kotlin.incremental=true

test-fixture/gradle/wrapper/gradle-wrapper.properties

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,4 +3,4 @@ distributionBase=GRADLE_USER_HOME
33
distributionPath=wrapper/dists
44
zipStoreBase=GRADLE_USER_HOME
55
zipStorePath=wrapper/dists
6-
distributionUrl=https\://services.gradle.org/distributions/gradle-6.7-rc-1-all.zip
6+
distributionUrl=https\://services.gradle.org/distributions/gradle-6.7-all.zip

0 commit comments

Comments
 (0)