mirror of
https://github.com/android-actions/setup-android.git
synced 2026-10-02 01:21:35 +00:00
also cache repository info
This commit is contained in:
1 parent
e7b65d73cb
commit
c9080c4243
5 files changed
+46
-38
No files matched your search
Vendored
+1
-1
@@ -1 +1 @@
|
|||||||
module.exports=function(e,t){"use strict";var n={};function __webpack_require__(t){if(n[t]){return n[t].exports}var i=n[t]={i:t,l:false,exports:{}};e[t].call(i.exports,i,i.exports,__webpack_require__);i.l=true;return i.exports}__webpack_require__.ab=__dirname+"/";function startup(){return __webpack_require__(131)}return startup()}({1:function(e,t,n){"use strict";var i=this&&this.__awaiter||function(e,t,n,i){function adopt(e){return e instanceof n?e:new n(function(t){t(e)})}return new(n||(n=Promise))(function(n,a){function fulfilled(e){try{step(i.next(e))}catch(e){a(e)}}function rejected(e){try{step(i["throw"](e))}catch(e){a(e)}}function step(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});const a=n(129);const o=n(622);const r=n(669);const s=n(672);const c=r.promisify(a.exec);function cp(e,t,n={}){return i(this,void 0,void 0,function*(){const{force:i,recursive:a}=readCopyOptions(n);const r=(yield s.exists(t))?yield s.stat(t):null;if(r&&r.isFile()&&!i){return}const c=r&&r.isDirectory()?o.join(t,o.basename(e)):t;if(!(yield s.exists(e))){throw new Error(`no such file or directory: ${e}`)}const u=yield s.stat(e);if(u.isDirectory()){if(!a){throw new Error(`Failed to copy. ${e} is a directory, but tried to copy without recursive flag.`)}else{yield cpDirRecursive(e,c,0,i)}}else{if(o.relative(e,c)===""){throw new Error(`'${c}' and '${e}' are the same file`)}yield copyFile(e,c,i)}})}t.cp=cp;function mv(e,t,n={}){return i(this,void 0,void 0,function*(){if(yield s.exists(t)){let i=true;if(yield s.isDirectory(t)){t=o.join(t,o.basename(e));i=yield s.exists(t)}if(i){if(n.force==null||n.force){yield rmRF(t)}else{throw new Error("Destination already exists")}}}yield mkdirP(o.dirname(t));yield s.rename(e,t)})}t.mv=mv;function rmRF(e){return i(this,void 0,void 0,function*(){if(s.IS_WINDOWS){try{if(yield s.isDirectory(e,true)){yield c(`rd /s /q "${e}"`)}else{yield c(`del /f /a "${e}"`)}}catch(e){if(e.code!=="ENOENT")throw e}try{yield s.unlink(e)}catch(e){if(e.code!=="ENOENT")throw e}}else{let t=false;try{t=yield s.isDirectory(e)}catch(e){if(e.code!=="ENOENT")throw e;return}if(t){yield c(`rm -rf "${e}"`)}else{yield s.unlink(e)}}})}t.rmRF=rmRF;function mkdirP(e){return i(this,void 0,void 0,function*(){yield s.mkdirP(e)})}t.mkdirP=mkdirP;function which(e,t){return i(this,void 0,void 0,function*(){if(!e){throw new Error("parameter 'tool' is required")}if(t){const t=yield which(e,false);if(!t){if(s.IS_WINDOWS){throw new Error(`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{throw new Error(`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{const t=[];if(s.IS_WINDOWS&&process.env.PATHEXT){for(const e of process.env.PATHEXT.split(o.delimiter)){if(e){t.push(e)}}}if(s.isRooted(e)){const n=yield s.tryGetExecutablePath(e,t);if(n){return n}return""}if(e.includes("/")||s.IS_WINDOWS&&e.includes("\\")){return""}const n=[];if(process.env.PATH){for(const e of process.env.PATH.split(o.delimiter)){if(e){n.push(e)}}}for(const i of n){const n=yield s.tryGetExecutablePath(i+o.sep+e,t);if(n){return n}}return""}catch(e){throw new Error(`which failed with message ${e.message}`)}})}t.which=which;function readCopyOptions(e){const t=e.force==null?true:e.force;const n=Boolean(e.recursive);return{force:t,recursive:n}}function cpDirRecursive(e,t,n,a){return i(this,void 0,void 0,function*(){if(n>=255)return;n++;yield mkdirP(t);const i=yield s.readdir(e);for(const o of i){const i=`${e}/${o}`;const r=`${t}/${o}`;const c=yield s.lstat(i);if(c.isDirectory()){yield cpDirRecursive(i,r,n,a)}else{yield copyFile(i,r,a)}}yield s.chmod(t,(yield s.stat(e)).mode)})}function copyFile(e,t,n){return i(this,void 0,void 0,function*(){if((yield s.lstat(e)).isSymbolicLink()){try{yield s.lstat(t);yield s.unlink(t)}catch(e){if(e.code==="EPERM"){yield s.chmod(t,"0666");yield s.unlink(t)}}const n=yield s.readlink(e);yield s.symlink(n,t,s.IS_WINDOWS?"junction":null)}else if(!(yield s.exists(t))||n){yield s.copyFile(e,t)}})}},2:function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:true});function defaultGetter(e,t){return e[t]}t.defaultGetter=defaultGetter},9:function(e,t,n){"use strict";var i=this&&this.__awaiter||function(e,t,n,i){function adopt(e){return e instanceof n?e:new n(function(t){t(e)})}return new(n||(n=Promise))(function(n,a){function fulfilled(e){try{step(i.next(e))}catch(e){a(e)}}function rejected(e){try{step(i["throw"](e))}catch(e){a(e)}}function step(e){e.done?n(e.value):adopt(e.value).then(fulfilled,rejected)}step((i=i.apply(e,t||[])).next())})};var a=this&&this.__importStaLine truncated
|
module.exports=function(e,t){"use strict";var n={};function __webpack_require__(t){if(n[t]){return n[t].exports}var i=n[t]={i:t,l:false,exports:{}};e[t].call(i.exports,i,i.exports,__webpack_require__);i.l=true;return i.exports}__webpack_require__.ab=__dirname+"/";function startup(){return __webpack_require__(131)}return startup()}({1:function(e,t,n){"use strict";var i=this&&this.__awaiter||function(e,t,n,i){function adopt(e){return e instanceof n?e:new n(function(t){t(e)})}return new(n||(n=Promise))(function(n,a){function fulfilled(e){try{step(i.next(e))}catch(e){a(e)}}function rejected(e){try{step(i["throw"](e))}catch(e){a(e)}}function step(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});const a=n(129);const o=n(622);const r=n(669);const s=n(672);const c=r.promisify(a.exec);function cp(e,t,n={}){return i(this,void 0,void 0,function*(){const{force:i,recursive:a}=readCopyOptions(n);const r=(yield s.exists(t))?yield s.stat(t):null;if(r&&r.isFile()&&!i){return}const c=r&&r.isDirectory()?o.join(t,o.basename(e)):t;if(!(yield s.exists(e))){throw new Error(`no such file or directory: ${e}`)}const u=yield s.stat(e);if(u.isDirectory()){if(!a){throw new Error(`Failed to copy. ${e} is a directory, but tried to copy without recursive flag.`)}else{yield cpDirRecursive(e,c,0,i)}}else{if(o.relative(e,c)===""){throw new Error(`'${c}' and '${e}' are the same file`)}yield copyFile(e,c,i)}})}t.cp=cp;function mv(e,t,n={}){return i(this,void 0,void 0,function*(){if(yield s.exists(t)){let i=true;if(yield s.isDirectory(t)){t=o.join(t,o.basename(e));i=yield s.exists(t)}if(i){if(n.force==null||n.force){yield rmRF(t)}else{throw new Error("Destination already exists")}}}yield mkdirP(o.dirname(t));yield s.rename(e,t)})}t.mv=mv;function rmRF(e){return i(this,void 0,void 0,function*(){if(s.IS_WINDOWS){try{if(yield s.isDirectory(e,true)){yield c(`rd /s /q "${e}"`)}else{yield c(`del /f /a "${e}"`)}}catch(e){if(e.code!=="ENOENT")throw e}try{yield s.unlink(e)}catch(e){if(e.code!=="ENOENT")throw e}}else{let t=false;try{t=yield s.isDirectory(e)}catch(e){if(e.code!=="ENOENT")throw e;return}if(t){yield c(`rm -rf "${e}"`)}else{yield s.unlink(e)}}})}t.rmRF=rmRF;function mkdirP(e){return i(this,void 0,void 0,function*(){yield s.mkdirP(e)})}t.mkdirP=mkdirP;function which(e,t){return i(this,void 0,void 0,function*(){if(!e){throw new Error("parameter 'tool' is required")}if(t){const t=yield which(e,false);if(!t){if(s.IS_WINDOWS){throw new Error(`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{throw new Error(`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{const t=[];if(s.IS_WINDOWS&&process.env.PATHEXT){for(const e of process.env.PATHEXT.split(o.delimiter)){if(e){t.push(e)}}}if(s.isRooted(e)){const n=yield s.tryGetExecutablePath(e,t);if(n){return n}return""}if(e.includes("/")||s.IS_WINDOWS&&e.includes("\\")){return""}const n=[];if(process.env.PATH){for(const e of process.env.PATH.split(o.delimiter)){if(e){n.push(e)}}}for(const i of n){const n=yield s.tryGetExecutablePath(i+o.sep+e,t);if(n){return n}}return""}catch(e){throw new Error(`which failed with message ${e.message}`)}})}t.which=which;function readCopyOptions(e){const t=e.force==null?true:e.force;const n=Boolean(e.recursive);return{force:t,recursive:n}}function cpDirRecursive(e,t,n,a){return i(this,void 0,void 0,function*(){if(n>=255)return;n++;yield mkdirP(t);const i=yield s.readdir(e);for(const o of i){const i=`${e}/${o}`;const r=`${t}/${o}`;const c=yield s.lstat(i);if(c.isDirectory()){yield cpDirRecursive(i,r,n,a)}else{yield copyFile(i,r,a)}}yield s.chmod(t,(yield s.stat(e)).mode)})}function copyFile(e,t,n){return i(this,void 0,void 0,function*(){if((yield s.lstat(e)).isSymbolicLink()){try{yield s.lstat(t);yield s.unlink(t)}catch(e){if(e.code==="EPERM"){yield s.chmod(t,"0666");yield s.unlink(t)}}const n=yield s.readlink(e);yield s.symlink(n,t,s.IS_WINDOWS?"junction":null)}else if(!(yield s.exists(t))||n){yield s.copyFile(e,t)}})}},2:function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:true});function defaultGetter(e,t){return e[t]}t.defaultGetter=defaultGetter},9:function(e,t,n){"use strict";var i=this&&this.__awaiter||function(e,t,n,i){function adopt(e){return e instanceof n?e:new n(function(t){t(e)})}return new(n||(n=Promise))(function(n,a){function fulfilled(e){try{step(i.next(e))}catch(e){a(e)}}function rejected(e){try{step(i["throw"](e))}catch(e){a(e)}}function step(e){e.done?n(e.value):adopt(e.value).then(fulfilled,rejected)}step((i=i.apply(e,t||[])).next())})};var a=this&&this.__importStaLine truncated
|
||||||
Vendored
+1
-1
@@ -1 +1 @@
|
|||||||
module.exports=function(e,t){"use strict";var n={};function __webpack_require__(t){if(n[t]){return n[t].exports}var i=n[t]={i:t,l:false,exports:{}};e[t].call(i.exports,i,i.exports,__webpack_require__);i.l=true;return i.exports}__webpack_require__.ab=__dirname+"/";function startup(){return __webpack_require__(878)}return startup()}({1:function(e,t,n){"use strict";var i=this&&this.__awaiter||function(e,t,n,i){function adopt(e){return e instanceof n?e:new n(function(t){t(e)})}return new(n||(n=Promise))(function(n,a){function fulfilled(e){try{step(i.next(e))}catch(e){a(e)}}function rejected(e){try{step(i["throw"](e))}catch(e){a(e)}}function step(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});const a=n(129);const o=n(622);const r=n(669);const s=n(672);const c=r.promisify(a.exec);function cp(e,t,n={}){return i(this,void 0,void 0,function*(){const{force:i,recursive:a}=readCopyOptions(n);const r=(yield s.exists(t))?yield s.stat(t):null;if(r&&r.isFile()&&!i){return}const c=r&&r.isDirectory()?o.join(t,o.basename(e)):t;if(!(yield s.exists(e))){throw new Error(`no such file or directory: ${e}`)}const u=yield s.stat(e);if(u.isDirectory()){if(!a){throw new Error(`Failed to copy. ${e} is a directory, but tried to copy without recursive flag.`)}else{yield cpDirRecursive(e,c,0,i)}}else{if(o.relative(e,c)===""){throw new Error(`'${c}' and '${e}' are the same file`)}yield copyFile(e,c,i)}})}t.cp=cp;function mv(e,t,n={}){return i(this,void 0,void 0,function*(){if(yield s.exists(t)){let i=true;if(yield s.isDirectory(t)){t=o.join(t,o.basename(e));i=yield s.exists(t)}if(i){if(n.force==null||n.force){yield rmRF(t)}else{throw new Error("Destination already exists")}}}yield mkdirP(o.dirname(t));yield s.rename(e,t)})}t.mv=mv;function rmRF(e){return i(this,void 0,void 0,function*(){if(s.IS_WINDOWS){try{if(yield s.isDirectory(e,true)){yield c(`rd /s /q "${e}"`)}else{yield c(`del /f /a "${e}"`)}}catch(e){if(e.code!=="ENOENT")throw e}try{yield s.unlink(e)}catch(e){if(e.code!=="ENOENT")throw e}}else{let t=false;try{t=yield s.isDirectory(e)}catch(e){if(e.code!=="ENOENT")throw e;return}if(t){yield c(`rm -rf "${e}"`)}else{yield s.unlink(e)}}})}t.rmRF=rmRF;function mkdirP(e){return i(this,void 0,void 0,function*(){yield s.mkdirP(e)})}t.mkdirP=mkdirP;function which(e,t){return i(this,void 0,void 0,function*(){if(!e){throw new Error("parameter 'tool' is required")}if(t){const t=yield which(e,false);if(!t){if(s.IS_WINDOWS){throw new Error(`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{throw new Error(`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{const t=[];if(s.IS_WINDOWS&&process.env.PATHEXT){for(const e of process.env.PATHEXT.split(o.delimiter)){if(e){t.push(e)}}}if(s.isRooted(e)){const n=yield s.tryGetExecutablePath(e,t);if(n){return n}return""}if(e.includes("/")||s.IS_WINDOWS&&e.includes("\\")){return""}const n=[];if(process.env.PATH){for(const e of process.env.PATH.split(o.delimiter)){if(e){n.push(e)}}}for(const i of n){const n=yield s.tryGetExecutablePath(i+o.sep+e,t);if(n){return n}}return""}catch(e){throw new Error(`which failed with message ${e.message}`)}})}t.which=which;function readCopyOptions(e){const t=e.force==null?true:e.force;const n=Boolean(e.recursive);return{force:t,recursive:n}}function cpDirRecursive(e,t,n,a){return i(this,void 0,void 0,function*(){if(n>=255)return;n++;yield mkdirP(t);const i=yield s.readdir(e);for(const o of i){const i=`${e}/${o}`;const r=`${t}/${o}`;const c=yield s.lstat(i);if(c.isDirectory()){yield cpDirRecursive(i,r,n,a)}else{yield copyFile(i,r,a)}}yield s.chmod(t,(yield s.stat(e)).mode)})}function copyFile(e,t,n){return i(this,void 0,void 0,function*(){if((yield s.lstat(e)).isSymbolicLink()){try{yield s.lstat(t);yield s.unlink(t)}catch(e){if(e.code==="EPERM"){yield s.chmod(t,"0666");yield s.unlink(t)}}const n=yield s.readlink(e);yield s.symlink(n,t,s.IS_WINDOWS?"junction":null)}else if(!(yield s.exists(t))||n){yield s.copyFile(e,t)}})}},2:function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:true});function defaultGetter(e,t){return e[t]}t.defaultGetter=defaultGetter},9:function(e,t,n){"use strict";var i=this&&this.__awaiter||function(e,t,n,i){function adopt(e){return e instanceof n?e:new n(function(t){t(e)})}return new(n||(n=Promise))(function(n,a){function fulfilled(e){try{step(i.next(e))}catch(e){a(e)}}function rejected(e){try{step(i["throw"](e))}catch(e){a(e)}}function step(e){e.done?n(e.value):adopt(e.value).then(fulfilled,rejected)}step((i=i.apply(e,t||[])).next())})};var a=this&&this.__importStaLine truncated
|
module.exports=function(e,t){"use strict";var n={};function __webpack_require__(t){if(n[t]){return n[t].exports}var i=n[t]={i:t,l:false,exports:{}};e[t].call(i.exports,i,i.exports,__webpack_require__);i.l=true;return i.exports}__webpack_require__.ab=__dirname+"/";function startup(){return __webpack_require__(878)}return startup()}({1:function(e,t,n){"use strict";var i=this&&this.__awaiter||function(e,t,n,i){function adopt(e){return e instanceof n?e:new n(function(t){t(e)})}return new(n||(n=Promise))(function(n,a){function fulfilled(e){try{step(i.next(e))}catch(e){a(e)}}function rejected(e){try{step(i["throw"](e))}catch(e){a(e)}}function step(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});const a=n(129);const o=n(622);const r=n(669);const s=n(672);const c=r.promisify(a.exec);function cp(e,t,n={}){return i(this,void 0,void 0,function*(){const{force:i,recursive:a}=readCopyOptions(n);const r=(yield s.exists(t))?yield s.stat(t):null;if(r&&r.isFile()&&!i){return}const c=r&&r.isDirectory()?o.join(t,o.basename(e)):t;if(!(yield s.exists(e))){throw new Error(`no such file or directory: ${e}`)}const u=yield s.stat(e);if(u.isDirectory()){if(!a){throw new Error(`Failed to copy. ${e} is a directory, but tried to copy without recursive flag.`)}else{yield cpDirRecursive(e,c,0,i)}}else{if(o.relative(e,c)===""){throw new Error(`'${c}' and '${e}' are the same file`)}yield copyFile(e,c,i)}})}t.cp=cp;function mv(e,t,n={}){return i(this,void 0,void 0,function*(){if(yield s.exists(t)){let i=true;if(yield s.isDirectory(t)){t=o.join(t,o.basename(e));i=yield s.exists(t)}if(i){if(n.force==null||n.force){yield rmRF(t)}else{throw new Error("Destination already exists")}}}yield mkdirP(o.dirname(t));yield s.rename(e,t)})}t.mv=mv;function rmRF(e){return i(this,void 0,void 0,function*(){if(s.IS_WINDOWS){try{if(yield s.isDirectory(e,true)){yield c(`rd /s /q "${e}"`)}else{yield c(`del /f /a "${e}"`)}}catch(e){if(e.code!=="ENOENT")throw e}try{yield s.unlink(e)}catch(e){if(e.code!=="ENOENT")throw e}}else{let t=false;try{t=yield s.isDirectory(e)}catch(e){if(e.code!=="ENOENT")throw e;return}if(t){yield c(`rm -rf "${e}"`)}else{yield s.unlink(e)}}})}t.rmRF=rmRF;function mkdirP(e){return i(this,void 0,void 0,function*(){yield s.mkdirP(e)})}t.mkdirP=mkdirP;function which(e,t){return i(this,void 0,void 0,function*(){if(!e){throw new Error("parameter 'tool' is required")}if(t){const t=yield which(e,false);if(!t){if(s.IS_WINDOWS){throw new Error(`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{throw new Error(`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{const t=[];if(s.IS_WINDOWS&&process.env.PATHEXT){for(const e of process.env.PATHEXT.split(o.delimiter)){if(e){t.push(e)}}}if(s.isRooted(e)){const n=yield s.tryGetExecutablePath(e,t);if(n){return n}return""}if(e.includes("/")||s.IS_WINDOWS&&e.includes("\\")){return""}const n=[];if(process.env.PATH){for(const e of process.env.PATH.split(o.delimiter)){if(e){n.push(e)}}}for(const i of n){const n=yield s.tryGetExecutablePath(i+o.sep+e,t);if(n){return n}}return""}catch(e){throw new Error(`which failed with message ${e.message}`)}})}t.which=which;function readCopyOptions(e){const t=e.force==null?true:e.force;const n=Boolean(e.recursive);return{force:t,recursive:n}}function cpDirRecursive(e,t,n,a){return i(this,void 0,void 0,function*(){if(n>=255)return;n++;yield mkdirP(t);const i=yield s.readdir(e);for(const o of i){const i=`${e}/${o}`;const r=`${t}/${o}`;const c=yield s.lstat(i);if(c.isDirectory()){yield cpDirRecursive(i,r,n,a)}else{yield copyFile(i,r,a)}}yield s.chmod(t,(yield s.stat(e)).mode)})}function copyFile(e,t,n){return i(this,void 0,void 0,function*(){if((yield s.lstat(e)).isSymbolicLink()){try{yield s.lstat(t);yield s.unlink(t)}catch(e){if(e.code==="EPERM"){yield s.chmod(t,"0666");yield s.unlink(t)}}const n=yield s.readlink(e);yield s.symlink(n,t,s.IS_WINDOWS?"junction":null)}else if(!(yield s.exists(t))||n){yield s.copyFile(e,t)}})}},2:function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:true});function defaultGetter(e,t){return e[t]}t.defaultGetter=defaultGetter},9:function(e,t,n){"use strict";var i=this&&this.__awaiter||function(e,t,n,i){function adopt(e){return e instanceof n?e:new n(function(t){t(e)})}return new(n||(n=Promise))(function(n,a){function fulfilled(e){try{step(i.next(e))}catch(e){a(e)}}function rejected(e){try{step(i["throw"](e))}catch(e){a(e)}}function step(e){e.done?n(e.value):adopt(e.value).then(fulfilled,rejected)}step((i=i.apply(e,t||[])).next())})};var a=this&&this.__importStaLine truncated
|
||||||
+8
-3
@@ -14,7 +14,9 @@ import {
|
|||||||
ANDROID_GLOB,
|
ANDROID_GLOB,
|
||||||
ANDROID_KEY,
|
ANDROID_KEY,
|
||||||
COMMANDLINE_TOOLS_VERSION,
|
COMMANDLINE_TOOLS_VERSION,
|
||||||
ANDROID_SDK_ROOT
|
ANDROID_SDK_ROOT,
|
||||||
|
ANDROID_REPOSITORIES_CACHE,
|
||||||
|
ANDROID_REPOSITORIES_CFG
|
||||||
} from './constants'
|
} from './constants'
|
||||||
|
|
||||||
async function hashFiles(globs: string[]): Promise<string | undefined> {
|
async function hashFiles(globs: string[]): Promise<string | undefined> {
|
||||||
@@ -144,7 +146,7 @@ export async function preAndroidCache(): Promise<void> {
|
|||||||
core.saveState(ANDROID_KEY, androidKey)
|
core.saveState(ANDROID_KEY, androidKey)
|
||||||
|
|
||||||
const androidCache = await cache.restoreCache(
|
const androidCache = await cache.restoreCache(
|
||||||
[GRADLE_CACHE_DIR],
|
[ANDROID_SDK_ROOT, ANDROID_REPOSITORIES_CACHE, ANDROID_REPOSITORIES_CFG],
|
||||||
androidKey,
|
androidKey,
|
||||||
androidRestoreKeys
|
androidRestoreKeys
|
||||||
)
|
)
|
||||||
@@ -166,7 +168,10 @@ export async function postAndroidCache(): Promise<void> {
|
|||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
await cache.saveCache([ANDROID_SDK_ROOT], androidKey)
|
await cache.saveCache(
|
||||||
|
[ANDROID_SDK_ROOT, ANDROID_REPOSITORIES_CACHE, ANDROID_REPOSITORIES_CFG],
|
||||||
|
androidKey
|
||||||
|
)
|
||||||
|
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
@@ -31,6 +31,16 @@ export const ANDROID_SDK_ROOT = path.join(HOME, 'android')
|
|||||||
export const ANDROID_GLOB = GRADLE_CACHE_GLOB
|
export const ANDROID_GLOB = GRADLE_CACHE_GLOB
|
||||||
export const ANDROID_KEY = 'ANDROID_KEY'
|
export const ANDROID_KEY = 'ANDROID_KEY'
|
||||||
|
|
||||||
|
export const ANDROID_REPOSITORIES_DIR = path.join(HOME, '.android')
|
||||||
|
export const ANDROID_REPOSITORIES_CFG = path.join(
|
||||||
|
ANDROID_REPOSITORIES_DIR,
|
||||||
|
'repositories.cfg'
|
||||||
|
)
|
||||||
|
export const ANDROID_REPOSITORIES_CACHE = path.join(
|
||||||
|
ANDROID_REPOSITORIES_DIR,
|
||||||
|
'cache'
|
||||||
|
)
|
||||||
|
|
||||||
export const COMMANDLINE_TOOLS_VERSION = '6609375'
|
export const COMMANDLINE_TOOLS_VERSION = '6609375'
|
||||||
export const COMMANDLINE_TOOLS_WIN_URL = `https://dl.google.com/android/repository/commandlinetools-win-${COMMANDLINE_TOOLS_VERSION}_latest.zip`
|
export const COMMANDLINE_TOOLS_WIN_URL = `https://dl.google.com/android/repository/commandlinetools-win-${COMMANDLINE_TOOLS_VERSION}_latest.zip`
|
||||||
export const COMMANDLINE_TOOLS_MAC_URL = `https://dl.google.com/android/repository/commandlinetools-mac-${COMMANDLINE_TOOLS_VERSION}_latest.zip`
|
export const COMMANDLINE_TOOLS_MAC_URL = `https://dl.google.com/android/repository/commandlinetools-mac-${COMMANDLINE_TOOLS_VERSION}_latest.zip`
|
||||||
|
|||||||
+26
-33
@@ -7,60 +7,53 @@ import {
|
|||||||
ANDROID_SDK_ROOT,
|
ANDROID_SDK_ROOT,
|
||||||
COMMANDLINE_TOOLS_LIN_URL,
|
COMMANDLINE_TOOLS_LIN_URL,
|
||||||
COMMANDLINE_TOOLS_MAC_URL,
|
COMMANDLINE_TOOLS_MAC_URL,
|
||||||
COMMANDLINE_TOOLS_WIN_URL
|
COMMANDLINE_TOOLS_WIN_URL,
|
||||||
|
ANDROID_REPOSITORIES_CFG,
|
||||||
|
ANDROID_REPOSITORIES_DIR
|
||||||
} from './constants'
|
} from './constants'
|
||||||
|
|
||||||
export async function install(): Promise<void> {
|
export async function install(): Promise<void> {
|
||||||
const licenseDir = path.join(ANDROID_SDK_ROOT, 'licenses')
|
const licenseDir = path.join(ANDROID_SDK_ROOT, 'licenses')
|
||||||
|
|
||||||
// If the licences exist, the rest does too
|
// If the licences exist, the rest does too
|
||||||
if (fs.existsSync(licenseDir)) {
|
if (fs.existsSync(licenseDir) && fs.existsSync(ANDROID_REPOSITORIES_CFG)) {
|
||||||
core.debug(`Skipping install, licenseDir found: ${licenseDir}`)
|
core.debug(`Skipping install, licenseDir found: ${licenseDir}`)
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
const acceptBuffer = Buffer.from('y\ny\ny\ny\ny\n\ny', 'utf8')
|
// create ~/.android/repositories.cfg
|
||||||
|
fs.mkdirSync(ANDROID_REPOSITORIES_DIR, {recursive: true})
|
||||||
|
fs.closeSync(fs.openSync(ANDROID_REPOSITORIES_CFG, 'w'))
|
||||||
|
|
||||||
|
const acceptBuffer = Buffer.from(
|
||||||
|
Array(10)
|
||||||
|
.fill('y')
|
||||||
|
.join('\n'),
|
||||||
|
'utf8'
|
||||||
|
)
|
||||||
|
let sdkManager = ''
|
||||||
|
|
||||||
if (process.platform === 'linux') {
|
if (process.platform === 'linux') {
|
||||||
const cmdlineToolsZip = await tc.downloadTool(COMMANDLINE_TOOLS_LIN_URL)
|
const cmdlineToolsZip = await tc.downloadTool(COMMANDLINE_TOOLS_LIN_URL)
|
||||||
const cmdlineTools = await tc.extractZip(cmdlineToolsZip)
|
const cmdlineTools = await tc.extractZip(cmdlineToolsZip)
|
||||||
const sdkManager = path.join(cmdlineTools, 'tools', 'bin', 'sdkmanager')
|
sdkManager = path.join(cmdlineTools, 'tools', 'bin', 'sdkmanager')
|
||||||
|
|
||||||
console.log(fs.readdirSync(cmdlineTools))
|
|
||||||
console.log(fs.existsSync(sdkManager))
|
|
||||||
|
|
||||||
exec.exec(
|
|
||||||
sdkManager,
|
|
||||||
['--include_obsolete', `--sdk_root=${ANDROID_SDK_ROOT}`, 'tools'],
|
|
||||||
{
|
|
||||||
input: acceptBuffer
|
|
||||||
}
|
|
||||||
)
|
|
||||||
} else if (process.platform === 'darwin') {
|
} else if (process.platform === 'darwin') {
|
||||||
const cmdlineToolsZip = await tc.downloadTool(COMMANDLINE_TOOLS_MAC_URL)
|
const cmdlineToolsZip = await tc.downloadTool(COMMANDLINE_TOOLS_MAC_URL)
|
||||||
const cmdlineTools = await tc.extractZip(cmdlineToolsZip)
|
const cmdlineTools = await tc.extractZip(cmdlineToolsZip)
|
||||||
const sdkManager = path.join(cmdlineTools, 'tools', 'bin', 'sdkmanager')
|
sdkManager = path.join(cmdlineTools, 'tools', 'bin', 'sdkmanager')
|
||||||
|
|
||||||
exec.exec(
|
|
||||||
sdkManager,
|
|
||||||
['--include_obsolete', `--sdk_root=${ANDROID_SDK_ROOT}`, 'tools'],
|
|
||||||
{
|
|
||||||
input: acceptBuffer
|
|
||||||
}
|
|
||||||
)
|
|
||||||
} else if (process.platform === 'win32') {
|
} else if (process.platform === 'win32') {
|
||||||
const cmdlineToolsZip = await tc.downloadTool(COMMANDLINE_TOOLS_WIN_URL)
|
const cmdlineToolsZip = await tc.downloadTool(COMMANDLINE_TOOLS_WIN_URL)
|
||||||
const cmdlineTools = await tc.extractZip(cmdlineToolsZip)
|
const cmdlineTools = await tc.extractZip(cmdlineToolsZip)
|
||||||
const sdkManager = path.join(cmdlineTools, 'tools', 'bin', 'sdkmanager.bat')
|
sdkManager = path.join(cmdlineTools, 'tools', 'bin', 'sdkmanager.bat')
|
||||||
|
|
||||||
exec.exec(
|
|
||||||
sdkManager,
|
|
||||||
['--include_obsolete', `--sdk_root=${ANDROID_SDK_ROOT}`, 'tools'],
|
|
||||||
{
|
|
||||||
input: acceptBuffer
|
|
||||||
}
|
|
||||||
)
|
|
||||||
} else {
|
} else {
|
||||||
core.error(`Unsupported platform: ${process.platform}`)
|
core.error(`Unsupported platform: ${process.platform}`)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
exec.exec(sdkManager, ['--licenses'], {input: acceptBuffer})
|
||||||
|
|
||||||
|
exec.exec(
|
||||||
|
sdkManager,
|
||||||
|
['--include_obsolete', `--sdk_root=${ANDROID_SDK_ROOT}`, 'tools'],
|
||||||
|
{input: acceptBuffer}
|
||||||
|
)
|
||||||
}
|
}
|
||||||
Reference in new issue
Block a user