* Trying this
* Revert "Trying this"
This reverts commit 46eab8f218.
* Put exists check around tools move
* Remove directory before copying over it
* Reverted indent
* Revert additional two spaces
GitHub Actions have Android-SDK preinstalled, but there's no sdkmanager.
Missing sdkmanager means no additional packages can be easily installed by dowsntream users.
This changes up way too much:
- Moving most (all) of the code to main.ts instead of the numerous
files
- Dropping the caching functionality, since it should be optional
- now we will only download the android sdk tools if they are not
already present, including if ANDROID_SDK_ROOT is already set
// /path/to/file/file.class: Warning: checkClientTrusted is empty, which could cause insecure network traffic due to trusting arbitrary TLS/SSL certificates presented by peers [TrustAllX509TrustManager]
Input parameter `packages` controls which packages this action will install from Android SDK.
Default value is `tools platform-tools`, supply an empty string to skip installing additional packages.
Additional packages can be installed at a later time by calling sdkmanager manually.
```yaml
- name:Setup Android SDK
uses:android-actions/setup-android@v3
with:
packages:''
# ...
- run:sdkmanager tools platform-tools
```
## SDK Version selection
Command line tools are versioned using two variables - short and long.
Long one is the build number, used in the zip URL, short one is the human friendly version name.
By default, setup-android installs version 10406996 (short version 11.0).
To install a different version, call setup-android with desired long version as the input parameter `cmdline-tools-version`:
```yaml
- name:Setup Android SDK
uses:android-actions/setup-android@v3
with:
cmdline-tools-version:8512546
```
#### Version table
| Short version | Long version |
| --- | --- |
| 11.0 | 10406996 |
| 10.0 | 9862592 |
| 9.0 | 9477386 |
| 8.0 | 9123335 |
| 7.0 | 8512546 |
Current cmdline tools version can be found at https://developer.android.com/studio#command-line-tools-only
# Android SDK Licenses
Android SDK is not public domain software, it comes with a license.
Input parameter `accept-android-sdk-licenses` decides if Android SDK licenses should be agreed to on behalf of the user of this action.
Default option is 'yes', because otherwise SDK is unusable until said licenses are agreed to.
licenses are quite long, to prevent a wall of text in the action output, licenses can be agreed to silently.
Input parameter `log-accepted-android-sdk-licenses` controls whether license texts should be printed or omitted from the text output. Defaults to 'true'.
# Thanks
Based on the project [android-problem-matchers-action](https://github.com/jonasb/android-problem-matchers-action) from [@jonasb](https://github.com/jonasb)
module.exports=function(e,t){"use strict";varn={};function__webpack_require__(t){if(n[t]){returnn[t].exports}vari=n[t]={i:t,l:false,exports:{}};e[t].call(i.exports,i,i.exports,__webpack_require__);i.l=true;returni.exports}__webpack_require__.ab=__dirname+"/";functionstartup(){return__webpack_require__(131)}returnstartup()}({1:function(e,t,n){"use strict";vari=this&&this.__awaiter||function(e,t,n,i){functionadopt(e){returneinstanceofn?e:newn(function(t){t(e)})}returnnew(n||(n=Promise))(function(n,a){functionfulfilled(e){try{step(i.next(e))}catch(e){a(e)}}functionrejected(e){try{step(i["throw"](e))}catch(e){a(e)}}functionstep(e){e.done?n(e.value):adopt(e.value).then(fulfilled,rejected)}step((i=i.apply(e,t||[])).next())})};Object.defineProperty(t,"__esModule",{value:true});consta=n(129);consto=n(622);constr=n(669);consts=n(672);constc=r.promisify(a.exec);functioncp(e,t,n={}){returni(this,void0,void0,function*(){const{force:i,recursive:a}=readCopyOptions(n);constr=(yields.exists(t))?yields.stat(t):null;if(r&&r.isFile()&&!i){return}constc=r&&r.isDirectory()?o.join(t,o.basename(e)):t;if(!(yields.exists(e))){thrownewError(`no such file or directory: ${e}`)}constu=yields.stat(e);if(u.isDirectory()){if(!a){thrownewError(`Failed to copy. ${e} is a directory, but tried to copy without recursive flag.`)}else{yieldcpDirRecursive(e,c,0,i)}}else{if(o.relative(e,c)===""){thrownewError(`'${c}' and '${e}' are the same file`)}yieldcopyFile(e,c,i)}})}t.cp=cp;functionmv(e,t,n={}){returni(this,void0,void0,function*(){if(yields.exists(t)){leti=true;if(yields.isDirectory(t)){t=o.join(t,o.basename(e));i=yields.exists(t)}if(i){if(n.force==null||n.force){yieldrmRF(t)}else{thrownewError("Destination already exists")}}}yieldmkdirP(o.dirname(t));yields.rename(e,t)})}t.mv=mv;functionrmRF(e){returni(this,void0,void0,function*(){if(s.IS_WINDOWS){try{if(yields.isDirectory(e,true)){yieldc(`rd /s /q "${e}"`)}else{yieldc(`del /f /a "${e}"`)}}catch(e){if(e.code!=="ENOENT")throwe}try{yields.unlink(e)}catch(e){if(e.code!=="ENOENT")throwe}}else{lett=false;try{t=yields.isDirectory(e)}catch(e){if(e.code!=="ENOENT")throwe;return}if(t){yieldc(`rm -rf "${e}"`)}else{yields.unlink(e)}}})}t.rmRF=rmRF;functionmkdirP(e){returni(this,void0,void0,function*(){yields.mkdirP(e)})}t.mkdirP=mkdirP;functionwhich(e,t){returni(this,void0,void0,function*(){if(!e){thrownewError("parameter 'tool' is required")}if(t){constt=yieldwhich(e,false);if(!t){if(s.IS_WINDOWS){thrownewError(`Unable to locate executable file: ${e}. Please verify either the file path exists or the file can be found within a directory specified by the PATH environment variable. Also verify the file has a valid extension for an executable file.`)}else{thrownewError(`Unable to locate executable file: ${e}. Please verify either the file path exists or the file can be found within a directory specified by the PATH environment variable. Also check the file mode to verify the file is executable.`)}}}try{constt=[];if(s.IS_WINDOWS&&process.env.PATHEXT){for(consteofprocess.env.PATHEXT.split(o.delimiter)){if(e){t.push(e)}}}if(s.isRooted(e)){constn=yields.tryGetExecutablePath(e,t);if(n){returnn}return""}if(e.includes("/")||s.IS_WINDOWS&&e.includes("\\")){return""}constn=[];if(process.env.PATH){for(consteofprocess.env.PATH.split(o.delimiter)){if(e){n.push(e)}}}for(constiofn){constn=yields.tryGetExecutablePath(i+o.sep+e,t);if(n){returnn}}return""}catch(e){thrownewError(`which failed with message ${e.message}`)}})}t.which=which;functionreadCopyOptions(e){constt=e.force==null?true:e.force;constn=Boolean(e.recursive);return{force:t,recursive:n}}functioncpDirRecursive(e,t,n,a){returni(this,void0,void0,function*(){if(n>=255)return;n++;yieldmkdirP(t);consti=yields.readdir(e);for(constoofi){consti=`${e}/${o}`;constr=`${t}/${o}`;constc=yields.lstat(i);if(c.isDirectory()){yieldcpDirRecursive(i,r,n,a)}else{yieldcopyFile(i,r,a)}}yields.chmod(t,(yields.stat(e)).mode)})}functioncopyFile(e,t,n){returni(this,void0,void0,function*(){if((yields.lstat(e)).isSymbolicLink()){try{yields.lstat(t);yields.unlink(t)}catch(e){if(e.code==="EPERM"){yields.chmod(t,"0666");yields.unlink(t)}}constn=yields.readlink(e);yields.symlink(n,t,s.IS_WINDOWS?"junction":null)}elseif(!(yields.exists(t))||n){yields.copyFile(e,t)}})}},2:function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:true});functiondefaultGetter(e,t){returne[t]}t.defaultGetter=defaultGetter},9:function(e,t,n){"use strict";vari=this&&this.__awaiter||function(e,t,n,i){functionadopt(e){returneinstanceofn?e:newn(function(t){t(e)})}returnnew(n||(n=Promise))(function(n,a){functionfulfilled(e){try{step(i.next(e))}catch(e){a(e)}}functionrejected(e){try{step(i["throw"](e))}catch(e){a(e)}}functionstep(e){e.done?n(e.value):adopt(e.value).then(fulfilled,rejected)}step((i=i.apply(e,t||[])).next())})};vara=this&&this.__importStaLine truncated
module.exports=function(e,t){"use strict";varn={};function__webpack_require__(t){if(n[t]){returnn[t].exports}vari=n[t]={i:t,l:false,exports:{}};e[t].call(i.exports,i,i.exports,__webpack_require__);i.l=true;returni.exports}__webpack_require__.ab=__dirname+"/";functionstartup(){return__webpack_require__(878)}returnstartup()}({1:function(e,t,n){"use strict";vari=this&&this.__awaiter||function(e,t,n,i){functionadopt(e){returneinstanceofn?e:newn(function(t){t(e)})}returnnew(n||(n=Promise))(function(n,a){functionfulfilled(e){try{step(i.next(e))}catch(e){a(e)}}functionrejected(e){try{step(i["throw"](e))}catch(e){a(e)}}functionstep(e){e.done?n(e.value):adopt(e.value).then(fulfilled,rejected)}step((i=i.apply(e,t||[])).next())})};Object.defineProperty(t,"__esModule",{value:true});consta=n(129);consto=n(622);constr=n(669);consts=n(672);constc=r.promisify(a.exec);functioncp(e,t,n={}){returni(this,void0,void0,function*(){const{force:i,recursive:a}=readCopyOptions(n);constr=(yields.exists(t))?yields.stat(t):null;if(r&&r.isFile()&&!i){return}constc=r&&r.isDirectory()?o.join(t,o.basename(e)):t;if(!(yields.exists(e))){thrownewError(`no such file or directory: ${e}`)}constu=yields.stat(e);if(u.isDirectory()){if(!a){thrownewError(`Failed to copy. ${e} is a directory, but tried to copy without recursive flag.`)}else{yieldcpDirRecursive(e,c,0,i)}}else{if(o.relative(e,c)===""){thrownewError(`'${c}' and '${e}' are the same file`)}yieldcopyFile(e,c,i)}})}t.cp=cp;functionmv(e,t,n={}){returni(this,void0,void0,function*(){if(yields.exists(t)){leti=true;if(yields.isDirectory(t)){t=o.join(t,o.basename(e));i=yields.exists(t)}if(i){if(n.force==null||n.force){yieldrmRF(t)}else{thrownewError("Destination already exists")}}}yieldmkdirP(o.dirname(t));yields.rename(e,t)})}t.mv=mv;functionrmRF(e){returni(this,void0,void0,function*(){if(s.IS_WINDOWS){try{if(yields.isDirectory(e,true)){yieldc(`rd /s /q "${e}"`)}else{yieldc(`del /f /a "${e}"`)}}catch(e){if(e.code!=="ENOENT")throwe}try{yields.unlink(e)}catch(e){if(e.code!=="ENOENT")throwe}}else{lett=false;try{t=yields.isDirectory(e)}catch(e){if(e.code!=="ENOENT")throwe;return}if(t){yieldc(`rm -rf "${e}"`)}else{yields.unlink(e)}}})}t.rmRF=rmRF;functionmkdirP(e){returni(this,void0,void0,function*(){yields.mkdirP(e)})}t.mkdirP=mkdirP;functionwhich(e,t){returni(this,void0,void0,function*(){if(!e){thrownewError("parameter 'tool' is required")}if(t){constt=yieldwhich(e,false);if(!t){if(s.IS_WINDOWS){thrownewError(`Unable to locate executable file: ${e}. Please verify either the file path exists or the file can be found within a directory specified by the PATH environment variable. Also verify the file has a valid extension for an executable file.`)}else{thrownewError(`Unable to locate executable file: ${e}. Please verify either the file path exists or the file can be found within a directory specified by the PATH environment variable. Also check the file mode to verify the file is executable.`)}}}try{constt=[];if(s.IS_WINDOWS&&process.env.PATHEXT){for(consteofprocess.env.PATHEXT.split(o.delimiter)){if(e){t.push(e)}}}if(s.isRooted(e)){constn=yields.tryGetExecutablePath(e,t);if(n){returnn}return""}if(e.includes("/")||s.IS_WINDOWS&&e.includes("\\")){return""}constn=[];if(process.env.PATH){for(consteofprocess.env.PATH.split(o.delimiter)){if(e){n.push(e)}}}for(constiofn){constn=yields.tryGetExecutablePath(i+o.sep+e,t);if(n){returnn}}return""}catch(e){thrownewError(`which failed with message ${e.message}`)}})}t.which=which;functionreadCopyOptions(e){constt=e.force==null?true:e.force;constn=Boolean(e.recursive);return{force:t,recursive:n}}functioncpDirRecursive(e,t,n,a){returni(this,void0,void0,function*(){if(n>=255)return;n++;yieldmkdirP(t);consti=yields.readdir(e);for(constoofi){consti=`${e}/${o}`;constr=`${t}/${o}`;constc=yields.lstat(i);if(c.isDirectory()){yieldcpDirRecursive(i,r,n,a)}else{yieldcopyFile(i,r,a)}}yields.chmod(t,(yields.stat(e)).mode)})}functioncopyFile(e,t,n){returni(this,void0,void0,function*(){if((yields.lstat(e)).isSymbolicLink()){try{yields.lstat(t);yields.unlink(t)}catch(e){if(e.code==="EPERM"){yields.chmod(t,"0666");yields.unlink(t)}}constn=yields.readlink(e);yields.symlink(n,t,s.IS_WINDOWS?"junction":null)}elseif(!(yields.exists(t))||n){yields.copyFile(e,t)}})}},2:function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:true});functiondefaultGetter(e,t){returne[t]}t.defaultGetter=defaultGetter},9:function(e,t,n){"use strict";vari=this&&this.__awaiter||function(e,t,n,i){functionadopt(e){returneinstanceofn?e:newn(function(t){t(e)})}returnnew(n||(n=Promise))(function(n,a){functionfulfilled(e){try{step(i.next(e))}catch(e){a(e)}}functionrejected(e){try{step(i["throw"](e))}catch(e){a(e)}}functionstep(e){e.done?n(e.value):adopt(e.value).then(fulfilled,rejected)}step((i=i.apply(e,t||[])).next())})};vara=this&&this.__importStaLine truncated
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.