File tree Expand file tree Collapse file tree 4 files changed +43
-6
lines changed Expand file tree Collapse file tree 4 files changed +43
-6
lines changed Original file line number Diff line number Diff line change @@ -39,12 +39,21 @@ steps:
39
39
` ` `
40
40
41
41
## Additional packages
42
- By default, sdkmanager installs "tools" and "platform-tools" packages. To install additional packages, call sdkmanager manually:
42
+ Input parameter ` packages` controls which packages this action will install from Android SDK.
43
+
44
+ Default value is `tools platform-tools`, supply an empty string to skip installing additional packages.
45
+
46
+ Additional packages can be installed at a later time by calling sdkmanager manually.
47
+
43
48
` ` ` yaml
44
49
- name: Setup Android SDK
45
50
uses: android-actions/setup-android@v3
51
+ with:
52
+ packages: ''
53
+
54
+ # ...
46
55
47
- - run : sdkmanager "ndk;26.1.10909125" "cmake;3.22.1"
56
+ - run: sdkmanager tools platform-tools
48
57
` ` `
49
58
50
59
# # SDK Version selection
Original file line number Diff line number Diff line change @@ -18,6 +18,11 @@ inputs:
18
18
required : false
19
19
default : ' true'
20
20
21
+ packages :
22
+ description : ' Additional packages to install'
23
+ required : false
24
+ default : ' tools platform-tools'
25
+
21
26
runs :
22
27
using : node20
23
28
main : ' dist/index.js'
Original file line number Diff line number Diff line change @@ -28269,8 +28269,19 @@ function run() {
28269
28269
core.info('Accepting Android SDK licenses');
28270
28270
yield callSdkManager(sdkManagerExe, '--licenses', core.getBooleanInput('log-accepted-android-sdk-licenses'));
28271
28271
}
28272
- yield callSdkManager(sdkManagerExe, 'tools');
28273
- yield callSdkManager(sdkManagerExe, 'platform-tools');
28272
+ const packages = core
28273
+ .getInput('packages', { required: false })
28274
+ .split(' ')
28275
+ .map(function (str) {
28276
+ return str.trim();
28277
+ })
28278
+ /* eslint-disable-next-line @typescript-eslint/no-unused-vars */
28279
+ .filter(function (element, index, array) {
28280
+ return element;
28281
+ });
28282
+ for (const pkg of packages) {
28283
+ yield callSdkManager(sdkManagerExe, pkg);
28284
+ }
28274
28285
core.setOutput('ANDROID_COMMANDLINE_TOOLS_VERSION', VERSION_LONG);
28275
28286
core.exportVariable('ANDROID_HOME', ANDROID_SDK_ROOT);
28276
28287
core.exportVariable('ANDROID_SDK_ROOT', ANDROID_SDK_ROOT);
Original file line number Diff line number Diff line change @@ -156,8 +156,20 @@ async function run(): Promise<void> {
156
156
core . getBooleanInput ( 'log-accepted-android-sdk-licenses' )
157
157
)
158
158
}
159
- await callSdkManager ( sdkManagerExe , 'tools' )
160
- await callSdkManager ( sdkManagerExe , 'platform-tools' )
159
+
160
+ const packages = core
161
+ . getInput ( 'packages' , { required : false } )
162
+ . split ( ' ' )
163
+ . map ( function ( str ) {
164
+ return str . trim ( )
165
+ } )
166
+ /* eslint-disable-next-line @typescript-eslint/no-unused-vars */
167
+ . filter ( function ( element , index , array ) {
168
+ return element
169
+ } )
170
+ for ( const pkg of packages ) {
171
+ await callSdkManager ( sdkManagerExe , pkg )
172
+ }
161
173
162
174
core . setOutput ( 'ANDROID_COMMANDLINE_TOOLS_VERSION' , VERSION_LONG )
163
175
core . exportVariable ( 'ANDROID_HOME' , ANDROID_SDK_ROOT )
You can’t perform that action at this time.
0 commit comments