123 Commits
v1 ... v2.0.9

Author SHA1 Message Date
Vilius Sutkus '89
2741e25473 Update README.md 2022-08-03 16:44:44 +03:00
Vilius Sutkus '89
ed89994087 Merge branch 'main' of github.com:android-actions/setup-android 2022-08-03 16:38:34 +03:00
Vilius Sutkus '89
240c9729bd Downgrade @types/node to 16, because we are using node LTS - 16. 2022-08-03 16:14:58 +03:00
Vilius Sutkus '89
36d0d24ca4 Update dependencies 2022-08-03 16:09:19 +03:00
Vilius Sutkus '89
cabf29c9ef [CI] Update "rebuild needed" check 2022-08-03 15:56:56 +03:00
Vilius Sutkus '89
65b8c7bc99 [CI] Add a "rebuild needed" check 2022-08-03 15:27:53 +03:00
Vilius Sutkus '89
34f33aad26 Use Node16 (current LTS), instead of Node12 2022-08-03 15:23:56 +03:00
Vilius Sutkus '89
3d201fcd51 Update cmdline-tools version to 7.0 2022-08-03 15:19:19 +03:00
Vilius Sutkus '89
1ba064a8a2 [2/2] Read version of cmdline-tools/latest, if version is correct - use it 2022-08-03 15:19:19 +03:00
Vilius Sutkus '89
4360e92aa0 Read version of cmdline-tools/latest, if version is correct - use it 2022-08-03 15:19:19 +03:00
Vilius Sutkus '89
88c04cbb34 [CI] Remove macos-10.15, because it is deprecated 2022-08-03 15:19:19 +03:00
Vilius Sutkus '89
239c6f5c7c [CI] Update test matrix to include ubuntu-22.04 and macos-12 2022-08-03 15:19:19 +03:00
Vilius Sutkus '89
882b1d3cd5 Update cmdline-tools version to 7.0 2022-08-03 15:03:16 +03:00
Vilius Sutkus '89
00dbb341f0 [2/2] Read version of cmdline-tools/latest, if version is correct - use it 2022-08-03 15:02:48 +03:00
Vilius Sutkus '89
c1ac9c4be4 Read version of cmdline-tools/latest, if version is correct - use it 2022-08-03 15:00:44 +03:00
Vilius Sutkus '89
0f0da39d59 [CI] Remove macos-10.15, because it is deprecated 2022-08-03 13:39:25 +03:00
Vilius Sutkus '89
c6c2260dde [CI] Update test matrix to include ubuntu-22.04 and macos-12 2022-08-03 13:36:32 +03:00
Vilius Sutkus '89
47ea489789 [CI] Disable run.yml 2022-04-22 06:28:18 +03:00
Vilius Sutkus '89
244317f5bb Rebuild dist/index.js after dependency update 2022-04-22 06:25:41 +03:00
Vilius Sutkus '89
5440ded976 [ESLint] warn instead of error about English text in string literals 2022-04-22 06:24:03 +03:00
Vilius Sutkus '89
e94bbf69b5 Update npm dependencies 2022-04-22 06:18:23 +03:00
Vilius Sutkus '89
98f14d164f [CI][README.md] Update setup-java to v3 2022-04-22 05:44:03 +03:00
Vilius Sutkus '89
f56c207000 [CI] Update actions/setup-node to v3 (sliding version, instead of 2.2.2) 2022-04-22 05:41:02 +03:00
Vilius Sutkus '89
a7d36b05d1 [CI][README.MD] Update actions/checkout to v3 2022-04-22 05:38:58 +03:00
Vilius Sutkus '89
20bad8a341 [CI][Test] Update OS list 2022-04-22 05:34:57 +03:00
Mike Hardy
fc91ea75c1 build(deps): bump tools version to v6 / 8092744 2022-04-22 05:22:01 +03:00
Dave Olsthoorn
1685c3d866 workflow: code analysis 2021-07-17 19:13:18 +02:00
Dave Olsthoorn
62d9713f6c workflow: add distribution to setup-java 2021-07-17 19:10:26 +02:00
Dave Olsthoorn
e2a3af499e package.json: bump to version 2021-07-17 19:06:08 +02:00
Dave Olsthoorn
c83cf2fad5 tsconfig: set moduleResolution 2021-07-17 18:55:57 +02:00
dependabot[bot]
39db4a222a Bump @vercel/ncc from 0.27.0 to 0.29.0
Bumps [@vercel/ncc](https://github.com/vercel/ncc) from 0.27.0 to 0.29.0.
- [Release notes](https://github.com/vercel/ncc/releases)
- [Commits](https://github.com/vercel/ncc/compare/0.27.0...0.29.0)

---
updated-dependencies:
- dependency-name: "@vercel/ncc"
  dependency-type: direct:development
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2021-07-17 18:51:07 +02:00
dependabot[bot]
69e42af51e Bump fs-extra from 9.1.0 to 10.0.0
Bumps [fs-extra](https://github.com/jprichardson/node-fs-extra) from 9.1.0 to 10.0.0.
- [Release notes](https://github.com/jprichardson/node-fs-extra/releases)
- [Changelog](https://github.com/jprichardson/node-fs-extra/blob/master/CHANGELOG.md)
- [Commits](https://github.com/jprichardson/node-fs-extra/compare/9.1.0...10.0.0)

Signed-off-by: dependabot[bot] <support@github.com>
2021-07-17 18:47:51 +02:00
dependabot[bot]
1eccbc5efd Bump jest-circus from 26.6.3 to 27.0.6
Bumps [jest-circus](https://github.com/facebook/jest/tree/HEAD/packages/jest-circus) from 26.6.3 to 27.0.6.
- [Release notes](https://github.com/facebook/jest/releases)
- [Changelog](https://github.com/facebook/jest/blob/master/CHANGELOG.md)
- [Commits](https://github.com/facebook/jest/commits/v27.0.6/packages/jest-circus)

---
updated-dependencies:
- dependency-name: jest-circus
  dependency-type: direct:development
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
2021-07-17 18:14:52 +02:00
dependabot[bot]
54a403b145 Bump @types/node from 14.17.5 to 16.3.3
Bumps [@types/node](https://github.com/DefinitelyTyped/DefinitelyTyped/tree/HEAD/types/node) from 14.17.5 to 16.3.3.
- [Release notes](https://github.com/DefinitelyTyped/DefinitelyTyped/releases)
- [Commits](https://github.com/DefinitelyTyped/DefinitelyTyped/commits/HEAD/types/node)

---
updated-dependencies:
- dependency-name: "@types/node"
  dependency-type: direct:development
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
2021-07-17 18:14:13 +02:00
dependabot[bot]
4bd635e9b7 Bump actions/setup-node from 2.1.5 to 2.2.0
Bumps [actions/setup-node](https://github.com/actions/setup-node) from 2.1.5 to 2.2.0.
- [Release notes](https://github.com/actions/setup-node/releases)
- [Commits](https://github.com/actions/setup-node/compare/v2.1.5...v2.2.0)

---
updated-dependencies:
- dependency-name: actions/setup-node
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2021-07-17 18:06:56 +02:00
Dave Olsthoorn
7528b5330e build: update build 2021-07-17 18:06:29 +02:00
Dave Olsthoorn
c1a2a96971 package-lock: run npm update 2021-07-17 18:04:48 +02:00
Dave Olsthoorn
a812d70a1a build: update build with new dependencies 2021-05-25 11:56:10 +02:00
Dave Olsthoorn
9bd8ed6b1f dependencies: update them all 2021-05-25 11:54:58 +02:00
dependabot[bot]
ecf659ded2 Bump @actions/core from 1.2.6 to 1.3.0
Bumps [@actions/core](https://github.com/actions/toolkit/tree/HEAD/packages/core) from 1.2.6 to 1.3.0.
- [Release notes](https://github.com/actions/toolkit/releases)
- [Changelog](https://github.com/actions/toolkit/blob/main/packages/core/RELEASES.md)
- [Commits](https://github.com/actions/toolkit/commits/HEAD/packages/core)

Signed-off-by: dependabot[bot] <support@github.com>
2021-05-25 11:44:24 +02:00
dependabot[bot]
8f636b1085 Bump eslint-plugin-github from 4.1.1 to 4.1.3
Bumps [eslint-plugin-github](https://github.com/github/eslint-plugin-github) from 4.1.1 to 4.1.3.
- [Release notes](https://github.com/github/eslint-plugin-github/releases)
- [Commits](https://github.com/github/eslint-plugin-github/compare/v4.1.1...v4.1.3)

Signed-off-by: dependabot[bot] <support@github.com>
2021-04-27 18:56:31 +02:00
dependabot[bot]
be688ab050 Bump ts-jest from 26.5.2 to 26.5.5
Bumps [ts-jest](https://github.com/kulshekhar/ts-jest) from 26.5.2 to 26.5.5.
- [Release notes](https://github.com/kulshekhar/ts-jest/releases)
- [Changelog](https://github.com/kulshekhar/ts-jest/blob/master/CHANGELOG.md)
- [Commits](https://github.com/kulshekhar/ts-jest/compare/v26.5.2...v26.5.5)

Signed-off-by: dependabot[bot] <support@github.com>
2021-04-27 18:56:17 +02:00
dependabot[bot]
2842aed41c Bump @types/node from 14.14.31 to 14.14.41
Bumps [@types/node](https://github.com/DefinitelyTyped/DefinitelyTyped/tree/HEAD/types/node) from 14.14.31 to 14.14.41.
- [Release notes](https://github.com/DefinitelyTyped/DefinitelyTyped/releases)
- [Commits](https://github.com/DefinitelyTyped/DefinitelyTyped/commits/HEAD/types/node)

Signed-off-by: dependabot[bot] <support@github.com>
2021-04-27 18:51:45 +02:00
dependabot[bot]
bc065618ae Bump typescript from 4.2.2 to 4.2.4
Bumps [typescript](https://github.com/Microsoft/TypeScript) from 4.2.2 to 4.2.4.
- [Release notes](https://github.com/Microsoft/TypeScript/releases)
- [Commits](https://github.com/Microsoft/TypeScript/compare/v4.2.2...v4.2.4)

Signed-off-by: dependabot[bot] <support@github.com>
2021-04-27 18:51:08 +02:00
dependabot[bot]
2d34867f5a Bump eslint-plugin-jest from 24.1.5 to 24.3.6
Bumps [eslint-plugin-jest](https://github.com/jest-community/eslint-plugin-jest) from 24.1.5 to 24.3.6.
- [Release notes](https://github.com/jest-community/eslint-plugin-jest/releases)
- [Changelog](https://github.com/jest-community/eslint-plugin-jest/blob/main/CHANGELOG.md)
- [Commits](https://github.com/jest-community/eslint-plugin-jest/compare/v24.1.5...v24.3.6)

Signed-off-by: dependabot[bot] <support@github.com>
2021-04-27 18:50:43 +02:00
dependabot[bot]
2469709471 Bump actions/setup-java from v1 to v2
Bumps [actions/setup-java](https://github.com/actions/setup-java) from v1 to v2.
- [Release notes](https://github.com/actions/setup-java/releases)
- [Commits](https://github.com/actions/setup-java/compare/v1...8764a52df183aa0ccea74521dfd9d506ffc7a19a)

Signed-off-by: dependabot[bot] <support@github.com>
2021-04-27 18:48:58 +02:00
Vilius Sutkus '89
3404b45d4c Don't minify dist/index.js, ~150kb of added bloat.
Will be easier to debug production errors later.
2021-03-03 01:07:35 +02:00
Vilius Sutkus '89
161f0b2707 Rebuild dist/index.js with updated deps 2021-03-03 01:00:48 +02:00
Vilius Sutkus '89
ae8a1c8d80 Upgrade zeit/ncc to vercel/ncc. zeit/ncc is deprecated 2021-03-03 00:55:11 +02:00
Vilius Sutkus '89
e458de9c46 Update package-lock file version to 2 (npm-7)
Line reorder in package.json
2021-03-03 00:48:48 +02:00
Vilius Sutkus '89
da1ab05e31 Comments about mkdir/rmdir 2021-03-03 00:43:22 +02:00
dependabot[bot]
910b2809b6 Bump @typescript-eslint/eslint-plugin from 4.15.2 to 4.16.1 (#116)
Bumps [@typescript-eslint/eslint-plugin](https://github.com/typescript-eslint/typescript-eslint/tree/HEAD/packages/eslint-plugin) from 4.15.2 to 4.16.1.
- [Release notes](https://github.com/typescript-eslint/typescript-eslint/releases)
- [Changelog](https://github.com/typescript-eslint/typescript-eslint/blob/master/packages/eslint-plugin/CHANGELOG.md)
- [Commits](https://github.com/typescript-eslint/typescript-eslint/commits/v4.16.1/packages/eslint-plugin)

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2021-03-03 00:40:40 +02:00
dependabot[bot]
7fc55be752 Bump @typescript-eslint/parser from 4.15.1 to 4.16.1 (#118)
Bumps [@typescript-eslint/parser](https://github.com/typescript-eslint/typescript-eslint/tree/HEAD/packages/parser) from 4.15.1 to 4.16.1.
- [Release notes](https://github.com/typescript-eslint/typescript-eslint/releases)
- [Changelog](https://github.com/typescript-eslint/typescript-eslint/blob/master/packages/parser/CHANGELOG.md)
- [Commits](https://github.com/typescript-eslint/typescript-eslint/commits/v4.16.1/packages/parser)

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2021-03-03 00:35:22 +02:00
dependabot[bot]
36160f0297 Bump @types/fs-extra from 9.0.7 to 9.0.8 (#117)
Bumps [@types/fs-extra](https://github.com/DefinitelyTyped/DefinitelyTyped/tree/HEAD/types/fs-extra) from 9.0.7 to 9.0.8.
- [Release notes](https://github.com/DefinitelyTyped/DefinitelyTyped/releases)
- [Commits](https://github.com/DefinitelyTyped/DefinitelyTyped/commits/HEAD/types/fs-extra)

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2021-03-03 00:24:04 +02:00
dependabot[bot]
46ed96d180 Bump ts-jest from 26.5.1 to 26.5.2 (#111)
Bumps [ts-jest](https://github.com/kulshekhar/ts-jest) from 26.5.1 to 26.5.2.
- [Release notes](https://github.com/kulshekhar/ts-jest/releases)
- [Changelog](https://github.com/kulshekhar/ts-jest/blob/master/CHANGELOG.md)
- [Commits](https://github.com/kulshekhar/ts-jest/compare/v26.5.1...v26.5.2)

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2021-03-03 00:19:30 +02:00
dependabot[bot]
57a1f875c4 Bump js-yaml from 3.14.1 to 4.0.0 (#87)
Bumps [js-yaml](https://github.com/nodeca/js-yaml) from 3.14.1 to 4.0.0.
- [Release notes](https://github.com/nodeca/js-yaml/releases)
- [Changelog](https://github.com/nodeca/js-yaml/blob/master/CHANGELOG.md)
- [Commits](https://github.com/nodeca/js-yaml/compare/3.14.1...4.0.0)

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2021-03-03 00:19:04 +02:00
dependabot[bot]
cee829806b Bump actions/setup-node from v2.1.4 to v2.1.5 (#109)
Bumps [actions/setup-node](https://github.com/actions/setup-node) from v2.1.4 to v2.1.5.
- [Release notes](https://github.com/actions/setup-node/releases)
- [Commits](https://github.com/actions/setup-node/compare/v2.1.4...46071b5c7a2e0c34e49c3cb8a0e792e86e18d5ea)

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2021-03-03 00:11:43 +02:00
dependabot[bot]
a83cba80ae Bump @typescript-eslint/eslint-plugin from 4.15.1 to 4.15.2 (#110)
Bumps [@typescript-eslint/eslint-plugin](https://github.com/typescript-eslint/typescript-eslint/tree/HEAD/packages/eslint-plugin) from 4.15.1 to 4.15.2.
- [Release notes](https://github.com/typescript-eslint/typescript-eslint/releases)
- [Changelog](https://github.com/typescript-eslint/typescript-eslint/blob/master/packages/eslint-plugin/CHANGELOG.md)
- [Commits](https://github.com/typescript-eslint/typescript-eslint/commits/v4.15.2/packages/eslint-plugin)

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2021-03-03 00:10:39 +02:00
dependabot[bot]
53fbf5011f Bump typescript from 4.1.5 to 4.2.2 (#112)
Bumps [typescript](https://github.com/Microsoft/TypeScript) from 4.1.5 to 4.2.2.
- [Release notes](https://github.com/Microsoft/TypeScript/releases)
- [Commits](https://github.com/Microsoft/TypeScript/compare/v4.1.5...v4.2.2)

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2021-03-03 00:10:01 +02:00
dependabot[bot]
ef1614e11f Bump eslint from 7.20.0 to 7.21.0 (#113)
Bumps [eslint](https://github.com/eslint/eslint) from 7.20.0 to 7.21.0.
- [Release notes](https://github.com/eslint/eslint/releases)
- [Changelog](https://github.com/eslint/eslint/blob/master/CHANGELOG.md)
- [Commits](https://github.com/eslint/eslint/compare/v7.20.0...v7.21.0)

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2021-03-03 00:09:25 +02:00
Laura
7506bcd002 [Issue #108] Overwrite CLI Tools (#115)
* 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
2021-03-03 00:02:20 +02:00
Vilius Sutkus '89
0bdb2caf82 [issue #108] Remove zip extraction leftovers 2021-03-02 03:05:42 +02:00
Vilius Sutkus '89
6989f50c81 Rebuild dist/index.js 2021-02-20 23:06:23 +01:00
Vilius Sutkus '89
9ab2660a79 Add @types/fs-extra dev dependency 2021-02-20 23:06:23 +01:00
Vilius Sutkus '89
cc38275357 Un-whitespace ANDROID_SDK_ROOT
sdkmanager doesn't like spaces in it's path.
Move the whole SDK to a place without spaces.
2021-02-20 23:03:41 +01:00
Vilius Sutkus '89
999dabf39c Use fs-extra.moveSync instead of fs.renameSync to move cmdline-tools
fs.renameSync can't rename across drives.
2021-02-20 23:03:41 +01:00
Vilius Sutkus '89
6bde8445cd Call sdkmanager, not .bat on windows too, it just works 2021-02-20 23:03:41 +01:00
Vilius Sutkus '89
1edf194eee Actually try to install sdkmanager after each commit 2021-02-20 23:03:41 +01:00
Vilius Sutkus '89
8c02e1fcfa Update run.yml to run sdkmanager after each update 2021-02-20 23:03:41 +01:00
Vilius Sutkus '89
87280a34d4 Check if sdkManager is actually available
GitHub Actions have Android-SDK preinstalled, but there's no sdkmanager.
Missing sdkmanager means no additional packages can be easily installed by dowsntream users.
2021-02-20 23:03:41 +01:00
Dave Olsthoorn
e3e9dc9b68 update dependencies 2021-02-20 22:53:11 +01:00
dependabot[bot]
fb95bc1561 Bump @types/jest from 26.0.19 to 26.0.20
Bumps [@types/jest](https://github.com/DefinitelyTyped/DefinitelyTyped/tree/HEAD/types/jest) from 26.0.19 to 26.0.20.
- [Release notes](https://github.com/DefinitelyTyped/DefinitelyTyped/releases)
- [Commits](https://github.com/DefinitelyTyped/DefinitelyTyped/commits/HEAD/types/jest)

Signed-off-by: dependabot[bot] <support@github.com>
2021-02-01 12:16:20 +01:00
dependabot[bot]
0df682b3d9 Bump @types/node from 14.14.17 to 14.14.22
Bumps [@types/node](https://github.com/DefinitelyTyped/DefinitelyTyped/tree/HEAD/types/node) from 14.14.17 to 14.14.22.
- [Release notes](https://github.com/DefinitelyTyped/DefinitelyTyped/releases)
- [Commits](https://github.com/DefinitelyTyped/DefinitelyTyped/commits/HEAD/types/node)

Signed-off-by: dependabot[bot] <support@github.com>
2021-02-01 12:06:09 +01:00
Dave Olsthoorn
0e84f1d6a4 update dependencies 2020-12-31 20:04:54 +01:00
Dave Olsthoorn
9e5b3ce36b Merge branch 'main' of github.com:android-actions/setup-android into main 2020-12-21 09:19:32 +01:00
dependabot[bot]
ebc0cbe4ab Bump actions/setup-node from v2.1.2 to v2.1.4
Bumps [actions/setup-node](https://github.com/actions/setup-node) from v2.1.2 to v2.1.4.
- [Release notes](https://github.com/actions/setup-node/releases)
- [Commits](https://github.com/actions/setup-node/compare/v2.1.2...c46424eee26de4078d34105d3de3cc4992202b1e)

Signed-off-by: dependabot[bot] <support@github.com>
2020-12-21 09:16:42 +01:00
Max Romanyuta
27f88822ed Fix lint problems 2020-12-21 09:16:42 +01:00
Max Romanyuta
a9018e09bb Remove unnecessary changes 2020-12-21 09:16:42 +01:00
Max Romanyuta
6bb81b1f40 Fix path to sdkmanager for all platforms 2020-12-21 09:16:42 +01:00
Max Romanyuta
7b2dad077d Fix path to sdkmanager
In the commandlinetools-${OS}-${TOOLS_VERSION}_latest.zip file, the name of the zipped folder has been changed.
2020-12-21 09:16:42 +01:00
dependabot[bot]
6ef7c7f726 Bump @actions/cache from 1.0.3 to 1.0.5
Bumps [@actions/cache](https://github.com/actions/toolkit/tree/HEAD/packages/cache) from 1.0.3 to 1.0.5.
- [Release notes](https://github.com/actions/toolkit/releases)
- [Changelog](https://github.com/actions/toolkit/blob/main/packages/cache/RELEASES.md)
- [Commits](https://github.com/actions/toolkit/commits/HEAD/packages/cache)

Signed-off-by: dependabot[bot] <support@github.com>
2020-12-21 09:16:42 +01:00
dependabot[bot]
df284ad095 Bump eslint from 7.12.1 to 7.16.0
Bumps [eslint](https://github.com/eslint/eslint) from 7.12.1 to 7.16.0.
- [Release notes](https://github.com/eslint/eslint/releases)
- [Changelog](https://github.com/eslint/eslint/blob/master/CHANGELOG.md)
- [Commits](https://github.com/eslint/eslint/compare/v7.12.1...v7.16.0)

Signed-off-by: dependabot[bot] <support@github.com>
2020-12-21 09:16:42 +01:00
dependabot[bot]
bb3313467a Bump eslint-plugin-jest from 23.20.0 to 24.1.3
Bumps [eslint-plugin-jest](https://github.com/jest-community/eslint-plugin-jest) from 23.20.0 to 24.1.3.
- [Release notes](https://github.com/jest-community/eslint-plugin-jest/releases)
- [Changelog](https://github.com/jest-community/eslint-plugin-jest/blob/master/CHANGELOG.md)
- [Commits](https://github.com/jest-community/eslint-plugin-jest/compare/v23.20.0...v24.1.3)

Signed-off-by: dependabot[bot] <support@github.com>
2020-12-21 09:16:42 +01:00
Dave Olsthoorn
8c6fc62420 Bump @types/node from 14.14.6 to 14.14.14
Bumps [@types/node](https://github.com/DefinitelyTyped/DefinitelyTyped/tree/HEAD/types/node) from 14.14.6 to 14.14.14.
- [Release notes](https://github.com/DefinitelyTyped/DefinitelyTyped/releases)
- [Commits](https://github.com/DefinitelyTyped/DefinitelyTyped/commits/HEAD/types/node)

Signed-off-by: dependabot[bot] <support@github.com>
2020-12-21 09:16:27 +01:00
dependabot[bot]
bd524df5da Bump actions/setup-node from v2.1.2 to v2.1.4
Bumps [actions/setup-node](https://github.com/actions/setup-node) from v2.1.2 to v2.1.4.
- [Release notes](https://github.com/actions/setup-node/releases)
- [Commits](https://github.com/actions/setup-node/compare/v2.1.2...c46424eee26de4078d34105d3de3cc4992202b1e)

Signed-off-by: dependabot[bot] <support@github.com>
2020-12-21 09:04:56 +01:00
Max Romanyuta
e5fc925f91 Fix lint problems 2020-12-21 09:04:23 +01:00
Max Romanyuta
aceb0eac9b Remove unnecessary changes 2020-12-21 09:04:23 +01:00
Max Romanyuta
903dd50e8f Fix path to sdkmanager for all platforms 2020-12-21 09:04:23 +01:00
Max Romanyuta
ec68242df7 Fix path to sdkmanager
In the commandlinetools-${OS}-${TOOLS_VERSION}_latest.zip file, the name of the zipped folder has been changed.
2020-12-21 09:04:23 +01:00
dependabot[bot]
658d02355a Bump @typescript-eslint/parser from 4.6.1 to 4.10.0
Bumps [@typescript-eslint/parser](https://github.com/typescript-eslint/typescript-eslint/tree/HEAD/packages/parser) from 4.6.1 to 4.10.0.
- [Release notes](https://github.com/typescript-eslint/typescript-eslint/releases)
- [Changelog](https://github.com/typescript-eslint/typescript-eslint/blob/master/packages/parser/CHANGELOG.md)
- [Commits](https://github.com/typescript-eslint/typescript-eslint/commits/v4.10.0/packages/parser)

Signed-off-by: dependabot[bot] <support@github.com>
2020-12-21 05:51:33 +00:00
Dave Olsthoorn
72fdd2e74f Update build after dependabot updates 2020-11-06 17:10:32 +01:00
dependabot[bot]
e8ff59719d Bump actions/setup-node from v2.1.1 to v2.1.2
Bumps [actions/setup-node](https://github.com/actions/setup-node) from v2.1.1 to v2.1.2.
- [Release notes](https://github.com/actions/setup-node/releases)
- [Commits](https://github.com/actions/setup-node/compare/v2.1.1...c6fd00ceb9747fb23ffdf72987450a2664414867)

Signed-off-by: dependabot[bot] <support@github.com>
2020-11-06 17:08:15 +01:00
dependabot[bot]
f373a0666c Bump typescript from 3.9.7 to 4.0.5
Bumps [typescript](https://github.com/Microsoft/TypeScript) from 3.9.7 to 4.0.5.
- [Release notes](https://github.com/Microsoft/TypeScript/releases)
- [Commits](https://github.com/Microsoft/TypeScript/compare/v3.9.7...v4.0.5)

Signed-off-by: dependabot[bot] <support@github.com>
2020-11-06 17:07:47 +01:00
dependabot[bot]
e5615156f4 Bump jest-circus from 26.6.1 to 26.6.3
Bumps [jest-circus](https://github.com/facebook/jest/tree/HEAD/packages/jest-circus) from 26.6.1 to 26.6.3.
- [Release notes](https://github.com/facebook/jest/releases)
- [Changelog](https://github.com/facebook/jest/blob/master/CHANGELOG.md)
- [Commits](https://github.com/facebook/jest/commits/v26.6.3/packages/jest-circus)

Signed-off-by: dependabot[bot] <support@github.com>
2020-11-06 17:07:40 +01:00
dependabot[bot]
943107c4e9 Bump @typescript-eslint/parser from 3.10.1 to 4.6.1
Bumps [@typescript-eslint/parser](https://github.com/typescript-eslint/typescript-eslint/tree/HEAD/packages/parser) from 3.10.1 to 4.6.1.
- [Release notes](https://github.com/typescript-eslint/typescript-eslint/releases)
- [Changelog](https://github.com/typescript-eslint/typescript-eslint/blob/master/packages/parser/CHANGELOG.md)
- [Commits](https://github.com/typescript-eslint/typescript-eslint/commits/v4.6.1/packages/parser)

Signed-off-by: dependabot[bot] <support@github.com>
2020-11-06 17:07:40 +01:00
Brian Ballsun-Stanton
9ee0d8a034 bumped package lock for 1.2.6 and made sure to output hardcoded commandline tools version 2020-11-06 16:50:43 +01:00
Brian Ballsun-Stanton
d7b9d01c78 recompile, update android version 2020-11-06 16:50:43 +01:00
dependabot[bot]
b5b08e0aee Bump @actions/core from 1.2.4 to 1.2.6
Bumps [@actions/core](https://github.com/actions/toolkit/tree/HEAD/packages/core) from 1.2.4 to 1.2.6.
- [Release notes](https://github.com/actions/toolkit/releases)
- [Changelog](https://github.com/actions/toolkit/blob/main/packages/core/RELEASES.md)
- [Commits](https://github.com/actions/toolkit/commits/HEAD/packages/core)

Signed-off-by: dependabot[bot] <support@github.com>
2020-10-06 12:11:55 +02:00
Axel Navarro
61b92998bb Fix setup-android version in README.md 2020-09-15 17:47:48 +02:00
dependabot[bot]
3496691692 Bump node-fetch from 2.6.0 to 2.6.1
Bumps [node-fetch](https://github.com/bitinn/node-fetch) from 2.6.0 to 2.6.1.
- [Release notes](https://github.com/bitinn/node-fetch/releases)
- [Changelog](https://github.com/node-fetch/node-fetch/blob/master/docs/CHANGELOG.md)
- [Commits](https://github.com/bitinn/node-fetch/compare/v2.6.0...v2.6.1)

Signed-off-by: dependabot[bot] <support@github.com>
2020-09-15 17:47:15 +02:00
Dave Olsthoorn
331008df41 Fix test for download, only test if licenseDir exists 2020-08-26 18:51:04 +02:00
Dave Olsthoorn
24b7e80ade Changeup: consilidate code, drop cache, change download
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
2020-08-26 17:51:32 +02:00
Dave Olsthoorn
57977119c1 Move all matchers to a single file 2020-08-26 17:43:31 +02:00
Dave Olsthoorn
2112bb34ef Update build 2020-08-17 20:09:00 +02:00
dependabot[bot]
78611c05a8 Bump @typescript-eslint/parser from 3.9.0 to 3.9.1
Bumps [@typescript-eslint/parser](https://github.com/typescript-eslint/typescript-eslint/tree/HEAD/packages/parser) from 3.9.0 to 3.9.1.
- [Release notes](https://github.com/typescript-eslint/typescript-eslint/releases)
- [Changelog](https://github.com/typescript-eslint/typescript-eslint/blob/master/packages/parser/CHANGELOG.md)
- [Commits](https://github.com/typescript-eslint/typescript-eslint/commits/v3.9.1/packages/parser)

Signed-off-by: dependabot[bot] <support@github.com>
2020-08-17 20:04:10 +02:00
dependabot[bot]
c52a594b8a Bump @types/node from 14.0.27 to 14.6.0
Bumps [@types/node](https://github.com/DefinitelyTyped/DefinitelyTyped/tree/HEAD/types/node) from 14.0.27 to 14.6.0.
- [Release notes](https://github.com/DefinitelyTyped/DefinitelyTyped/releases)
- [Commits](https://github.com/DefinitelyTyped/DefinitelyTyped/commits/HEAD/types/node)

Signed-off-by: dependabot[bot] <support@github.com>
2020-08-17 20:01:40 +02:00
dependabot[bot]
d22da3d6e9 Bump @types/jest from 26.0.9 to 26.0.10
Bumps [@types/jest](https://github.com/DefinitelyTyped/DefinitelyTyped/tree/HEAD/types/jest) from 26.0.9 to 26.0.10.
- [Release notes](https://github.com/DefinitelyTyped/DefinitelyTyped/releases)
- [Commits](https://github.com/DefinitelyTyped/DefinitelyTyped/commits/HEAD/types/jest)

Signed-off-by: dependabot[bot] <support@github.com>
2020-08-17 19:53:06 +02:00
dependabot[bot]
1d816790f5 Bump jest-circus from 26.3.0 to 26.4.0
Bumps [jest-circus](https://github.com/facebook/jest/tree/HEAD/packages/jest-circus) from 26.3.0 to 26.4.0.
- [Release notes](https://github.com/facebook/jest/releases)
- [Changelog](https://github.com/facebook/jest/blob/master/CHANGELOG.md)
- [Commits](https://github.com/facebook/jest/commits/v26.4.0/packages/jest-circus)

Signed-off-by: dependabot[bot] <support@github.com>
2020-08-17 19:52:46 +02:00
dependabot[bot]
a4d56ab860 Bump eslint from 7.6.0 to 7.7.0
Bumps [eslint](https://github.com/eslint/eslint) from 7.6.0 to 7.7.0.
- [Release notes](https://github.com/eslint/eslint/releases)
- [Changelog](https://github.com/eslint/eslint/blob/master/CHANGELOG.md)
- [Commits](https://github.com/eslint/eslint/compare/v7.6.0...v7.7.0)

Signed-off-by: dependabot[bot] <support@github.com>
2020-08-17 19:52:11 +02:00
Dave Olsthoorn
62ea653263 Update README.md 2020-08-17 19:44:06 +02:00
Dave Olsthoorn
f7a7114037 Create LICENSE 2020-08-11 20:48:49 +02:00
Dave Olsthoorn
87ec6df705 Update build 2020-08-11 20:31:45 +02:00
dependabot[bot]
19571f1d06 Bump @types/node from 12.12.50 to 14.0.27
Bumps [@types/node](https://github.com/DefinitelyTyped/DefinitelyTyped/tree/HEAD/types/node) from 12.12.50 to 14.0.27.
- [Release notes](https://github.com/DefinitelyTyped/DefinitelyTyped/releases)
- [Commits](https://github.com/DefinitelyTyped/DefinitelyTyped/commits/HEAD/types/node)

Signed-off-by: dependabot[bot] <support@github.com>
2020-08-11 20:27:29 +02:00
dependabot[bot]
f2fe6d103b Bump eslint from 6.8.0 to 7.6.0
Bumps [eslint](https://github.com/eslint/eslint) from 6.8.0 to 7.6.0.
- [Release notes](https://github.com/eslint/eslint/releases)
- [Changelog](https://github.com/eslint/eslint/blob/master/CHANGELOG.md)
- [Commits](https://github.com/eslint/eslint/compare/v6.8.0...v7.6.0)

Signed-off-by: dependabot[bot] <support@github.com>
2020-08-11 20:24:01 +02:00
dependabot[bot]
9665d86acf Bump @zeit/ncc from 0.20.5 to 0.22.3
Bumps [@zeit/ncc](https://github.com/zeit/ncc) from 0.20.5 to 0.22.3.
- [Release notes](https://github.com/zeit/ncc/releases)
- [Commits](https://github.com/zeit/ncc/compare/0.20.5...0.22.3)

Signed-off-by: dependabot[bot] <support@github.com>
2020-08-11 20:22:17 +02:00
Dave Olsthoorn
01efde8e60 fix linting 2020-08-11 19:59:48 +02:00
Dave Olsthoorn
db3b072a6b Update workflows 2020-08-11 19:44:45 +02:00
Dave Olsthoorn
469d66c201 Run prettier, to pass format-check 2020-08-11 19:25:29 +02:00
dependabot[bot]
f4de3ae372 Bump prettier from 1.19.1 to 2.0.5
Bumps [prettier](https://github.com/prettier/prettier) from 1.19.1 to 2.0.5.
- [Release notes](https://github.com/prettier/prettier/releases)
- [Changelog](https://github.com/prettier/prettier/blob/master/CHANGELOG.md)
- [Commits](https://github.com/prettier/prettier/compare/1.19.1...2.0.5)

Signed-off-by: dependabot[bot] <support@github.com>
2020-08-11 19:25:29 +02:00
dependabot[bot]
c19969d881 Bump @typescript-eslint/parser from 2.34.0 to 3.9.0
Bumps [@typescript-eslint/parser](https://github.com/typescript-eslint/typescript-eslint/tree/HEAD/packages/parser) from 2.34.0 to 3.9.0.
- [Release notes](https://github.com/typescript-eslint/typescript-eslint/releases)
- [Changelog](https://github.com/typescript-eslint/typescript-eslint/blob/master/packages/parser/CHANGELOG.md)
- [Commits](https://github.com/typescript-eslint/typescript-eslint/commits/v3.9.0/packages/parser)

Signed-off-by: dependabot[bot] <support@github.com>
2020-08-11 19:05:33 +02:00
dependabot[bot]
a98b957810 Bump eslint-plugin-jest from 22.21.0 to 23.20.0
Bumps [eslint-plugin-jest](https://github.com/jest-community/eslint-plugin-jest) from 22.21.0 to 23.20.0.
- [Release notes](https://github.com/jest-community/eslint-plugin-jest/releases)
- [Changelog](https://github.com/jest-community/eslint-plugin-jest/blob/master/CHANGELOG.md)
- [Commits](https://github.com/jest-community/eslint-plugin-jest/compare/v22.21.0...v23.20.0)

Signed-off-by: dependabot[bot] <support@github.com>
2020-08-11 19:05:18 +02:00
dependabot[bot]
a1f8a01619 Bump eslint from 5.16.0 to 6.8.0
Bumps [eslint](https://github.com/eslint/eslint) from 5.16.0 to 6.8.0.
- [Release notes](https://github.com/eslint/eslint/releases)
- [Changelog](https://github.com/eslint/eslint/blob/master/CHANGELOG.md)
- [Commits](https://github.com/eslint/eslint/compare/v5.16.0...v6.8.0)

Signed-off-by: dependabot[bot] <support@github.com>
2020-08-11 19:05:01 +02:00
dependabot[bot]
3626142136 Bump typescript from 3.9.6 to 3.9.7
Bumps [typescript](https://github.com/Microsoft/TypeScript) from 3.9.6 to 3.9.7.
- [Release notes](https://github.com/Microsoft/TypeScript/releases)
- [Commits](https://github.com/Microsoft/TypeScript/compare/v3.9.6...v3.9.7)

Signed-off-by: dependabot[bot] <support@github.com>
2020-08-11 19:01:11 +02:00
25 changed files with 19309 additions and 7456 deletions

View File

@@ -1,59 +1,55 @@
{
"plugins": ["jest", "@typescript-eslint"],
"extends": ["plugin:github/es6"],
"parser": "@typescript-eslint/parser",
"parserOptions": {
"ecmaVersion": 9,
"sourceType": "module",
"project": "./tsconfig.json"
},
"rules": {
"eslint-comments/no-use": "off",
"import/no-namespace": "off",
"no-unused-vars": "off",
"@typescript-eslint/no-unused-vars": "error",
"@typescript-eslint/explicit-member-accessibility": ["error", {"accessibility": "no-public"}],
"@typescript-eslint/no-require-imports": "error",
"@typescript-eslint/array-type": "error",
"@typescript-eslint/await-thenable": "error",
"@typescript-eslint/ban-ts-ignore": "error",
"camelcase": "off",
"@typescript-eslint/camelcase": "error",
"@typescript-eslint/class-name-casing": "error",
"@typescript-eslint/explicit-function-return-type": ["error", {"allowExpressions": true}],
"@typescript-eslint/func-call-spacing": ["error", "never"],
"@typescript-eslint/generic-type-naming": ["error", "^[A-Z][A-Za-z]*$"],
"@typescript-eslint/no-array-constructor": "error",
"@typescript-eslint/no-empty-interface": "error",
"@typescript-eslint/no-explicit-any": "error",
"@typescript-eslint/no-extraneous-class": "error",
"@typescript-eslint/no-for-in-array": "error",
"@typescript-eslint/no-inferrable-types": "error",
"@typescript-eslint/no-misused-new": "error",
"@typescript-eslint/no-namespace": "error",
"@typescript-eslint/no-non-null-assertion": "warn",
"@typescript-eslint/no-object-literal-type-assertion": "error",
"@typescript-eslint/no-unnecessary-qualifier": "error",
"@typescript-eslint/no-unnecessary-type-assertion": "error",
"@typescript-eslint/no-useless-constructor": "error",
"@typescript-eslint/no-var-requires": "error",
"@typescript-eslint/prefer-for-of": "warn",
"@typescript-eslint/prefer-function-type": "warn",
"@typescript-eslint/prefer-includes": "error",
"@typescript-eslint/prefer-interface": "error",
"@typescript-eslint/prefer-string-starts-ends-with": "error",
"@typescript-eslint/promise-function-async": "error",
"@typescript-eslint/require-array-sort-compare": "error",
"@typescript-eslint/restrict-plus-operands": "error",
"semi": "off",
"@typescript-eslint/semi": ["error", "never"],
"@typescript-eslint/type-annotation-spacing": "error",
"@typescript-eslint/unbound-method": "error",
"no-console": "off"
},
"env": {
"node": true,
"es6": true,
"jest/globals": true
}
}
{
"plugins": ["jest", "@typescript-eslint"],
"extends": ["plugin:github/recommended"],
"parser": "@typescript-eslint/parser",
"parserOptions": {
"ecmaVersion": 9,
"sourceType": "module",
"project": "./tsconfig.json"
},
"rules": {
"eslint-comments/no-use": "off",
"import/no-namespace": "off",
"no-unused-vars": "off",
"@typescript-eslint/no-unused-vars": "error",
"@typescript-eslint/explicit-member-accessibility": ["error", {"accessibility": "no-public"}],
"@typescript-eslint/no-require-imports": "error",
"@typescript-eslint/array-type": "error",
"@typescript-eslint/await-thenable": "error",
"@typescript-eslint/ban-ts-comment": "error",
"camelcase": "off",
"@typescript-eslint/consistent-type-assertions": "error",
"@typescript-eslint/explicit-function-return-type": ["error", {"allowExpressions": true}],
"@typescript-eslint/func-call-spacing": ["error", "never"],
"@typescript-eslint/no-array-constructor": "error",
"@typescript-eslint/no-empty-interface": "error",
"@typescript-eslint/no-explicit-any": "error",
"@typescript-eslint/no-extraneous-class": "error",
"@typescript-eslint/no-for-in-array": "error",
"@typescript-eslint/no-inferrable-types": "error",
"@typescript-eslint/no-misused-new": "error",
"@typescript-eslint/no-namespace": "error",
"@typescript-eslint/no-non-null-assertion": "warn",
"@typescript-eslint/no-unnecessary-qualifier": "error",
"@typescript-eslint/no-unnecessary-type-assertion": "error",
"@typescript-eslint/no-useless-constructor": "error",
"@typescript-eslint/no-var-requires": "error",
"@typescript-eslint/prefer-for-of": "warn",
"@typescript-eslint/prefer-function-type": "warn",
"@typescript-eslint/prefer-includes": "error",
"@typescript-eslint/prefer-string-starts-ends-with": "error",
"@typescript-eslint/promise-function-async": "error",
"@typescript-eslint/require-array-sort-compare": "error",
"@typescript-eslint/restrict-plus-operands": "error",
"semi": "off",
"@typescript-eslint/semi": ["error", "never"],
"@typescript-eslint/type-annotation-spacing": "error",
"i18n-text/no-en": "warn",
"@typescript-eslint/unbound-method": "error"
},
"env": {
"node": true,
"es6": true,
"jest/globals": true
}
}

View File

@@ -1,19 +0,0 @@
{
// Example:
// /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]
"problemMatcher": [
{
"owner": "android-lint-file",
"pattern": [
{
"regexp": "^(.+):\\s+(Warning|Error):\\s+(.+)\\s+\\[(.+)\\]$",
"file": 1,
"severity": 2,
"message": 3,
"code": 4,
"kind": "file"
}
]
}
]
}

View File

@@ -1,19 +0,0 @@
{
// Example:
// /path/to/file/build.gradle:55: Warning: A newer version of androidx.core:core-ktx than 1.2.0-beta01 is available: 1.2.0-rc01 [GradleDependency]
"problemMatcher": [
{
"owner": "android-lint-line",
"pattern": [
{
"regexp": "^(.+):(\\d+):\\s+(Warning|Error):\\s+(.+)\\s+\\[(.+)\\]$",
"file": 1,
"line": 2,
"severity": 3,
"message": 4,
"code": 5
}
]
}
]
}

View File

@@ -1,23 +0,0 @@
{
// Example:
// warning unused-exclude-by-conf the exclude dependency is not in your dependency graph, so has no effect
// app/build.gradle:45
"problemMatcher": [
{
"owner": "gradle",
"pattern": [
{
"regexp": "^(error|quiet|warning|lifecycle|info|debug)\\s+(\\S+)\\s+(.+)$",
"severity": 1,
"code": 2,
"message": 3
},
{
"regexp": "^([^\\s]+):([\\d]+)$",
"file": 1,
"line": 2
}
]
}
]
}

View File

@@ -1,19 +0,0 @@
{
// Example:
// e: /path/to/file/KotlinFile.kt: (14, 5): Val cannot be reassigned
"problemMatcher": [
{
"owner": "kotlin-error",
"pattern": [
{
"regexp": "^e:\\s+(\\S+):\\s+\\((\\d+),\\s+(\\d+)\\):\\s+(.+)$",
"file": 1,
"line": 2,
"column": 3,
"message": 4
}
],
"severity": "error"
}
]
}

View File

@@ -1,19 +0,0 @@
{
// Example:
// w: /path/to/file/KotlinFile.kt: (14, 5): Parameter 'foo' is never used
"problemMatcher": [
{
"owner": "kotlin-warning",
"pattern": [
{
"regexp": "^w:\\s+(\\S+):\\s+\\((\\d+),\\s+(\\d+)\\):\\s+(.+)$",
"file": 1,
"line": 2,
"column": 3,
"message": 4
}
],
"severity": "warning"
}
]
}

View File

@@ -15,17 +15,80 @@ jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v3
- name: Setup node 12
uses: actions/setup-node@v2.1.1
- name: Setup node 16
uses: actions/setup-node@v3
with:
node-version: 12.x
node-version: '16'
- run: npm ci
- run: npm run build
- name: Check if dist/index.js needs to be rebuilt
run: diff <(git status dist/index.js --short) <(echo -n "")
format-check:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Setup node 16
uses: actions/setup-node@v3
with:
node-version: '16'
- run: npm ci
- run: npm run format-check
test:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Setup node 16
uses: actions/setup-node@v3
with:
node-version: '16'
- run: npm ci
- run: npm test
runSdkManager:
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os: [ ubuntu-18.04, ubuntu-20.04, ubuntu-22.04, macos-11, macos-12, windows-2019, windows-2022 ]
steps:
- uses: actions/checkout@v3
- name: Setup node 16
uses: actions/setup-node@v3
with:
node-version: '16'
- run: npm ci
- run: npm run build
- run: node dist/index.js
- run: sdkmanager --list
lint:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Setup node 16
uses: actions/setup-node@v3
with:
node-version: '16'
- run: npm ci
- run: npm run lint

43
.github/workflows/codeql-analysis.yml vendored Normal file
View File

@@ -0,0 +1,43 @@
# For most projects, this workflow file will not need changing; you simply need
# to commit it to your repository.
#
# You may wish to alter this file to override the set of languages analyzed,
# or to provide custom queries or build logic.
#
# ******** NOTE ********
# We have attempted to detect the languages in your repository. Please check
# the `language` matrix defined below to confirm you have the correct set of
# supported CodeQL languages.
#
name: "CodeQL"
on:
push:
branches: [ main ]
pull_request:
# The branches below must be a subset of the branches above
branches: [ main ]
schedule:
- cron: '44 12 * * 4'
jobs:
analyze:
name: Analyze
runs-on: ubuntu-latest
permissions:
actions: read
contents: read
security-events: write
steps:
- name: Checkout repository
uses: actions/checkout@v3
# Initializes the CodeQL tools for scanning.
- name: Initialize CodeQL
uses: github/codeql-action/init@v1
with:
languages: 'javascript'
- name: Perform CodeQL Analysis
uses: github/codeql-action/analyze@v1

View File

@@ -1,47 +1,54 @@
name: Run Android build
on:
pull_request:
paths-ignore:
- '**.md'
push:
branches:
- main
- releases/*
paths-ignore:
- '**.md'
jobs:
build:
runs-on: ${{ matrix.os }}
strategy:
matrix:
os:
- ubuntu-latest
- windows-latest
- macos-latest
steps:
- uses: actions/checkout@v2
with:
repository: daveol/SampleApplication
- uses: actions/checkout@v2
with:
path: ./build/
- name: Set up JDK 1.8
uses: actions/setup-java@v1
with:
java-version: 1.8
- name: Setup Android SDK
id: 'setup-android'
uses: ./build/
- name: Build SampleApplication
if: runner.os != 'windows'
run: ./gradlew --no-daemon build
- name: Build SampleApplication (Windows)
if: runner.os == 'windows'
run: .\gradlew.bat --no-daemon build
name: Run Android build
on:
pull_request:
paths:
- 'dist/**.js'
- '.github/*.json'
push:
branches:
- main
- releases/*
paths:
- 'dist/**.js'
- '.github/*.json'
jobs:
build:
runs-on: ${{ matrix.os }}
strategy:
matrix:
os:
- ubuntu-latest
- windows-latest
- macos-latest
# Disabled, because daveol/SampleApplication is missing
if: ${{ false }}
steps:
- uses: actions/checkout@v3
with:
repository: daveol/SampleApplication
- uses: actions/checkout@v3
with:
path: ./build/
- name: Set up JDK 1.8
uses: actions/setup-java@v3
with:
java-version: 1.8
distribution: 'adopt'
- name: Setup Android SDK
id: 'setup-android'
uses: ./build/
- name: Build SampleApplication
if: runner.os != 'windows'
run: ./gradlew --no-daemon build
- name: Build SampleApplication (Windows)
if: runner.os == 'windows'
run: .\gradlew.bat --no-daemon build

21
LICENSE Normal file
View File

@@ -0,0 +1,21 @@
MIT License
Copyright (c) 2020 Dave Olsthoorn
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.

View File

@@ -1,7 +1,42 @@
# setup-android
For setting up the android sdk in a github-action
<!-- TODO: write readme -->
![Build & Test](https://github.com/android-actions/setup-android/workflows/Build%20&%20Test/badge.svg)
This action sets up the Android SDK tools by:
- Downloading the SDK commandline tools, if the current version (7.0) is not found in either `$ANDROID_SDK_ROOT` or `$HOME/.android/sdk`.
- Accepting the SDK licenses.
- Installing `tools` and `platform-tools`.
- Adding `platform-tools` (contains adb) and `cmdline-tools/7.0/bin` (contains sdkmanager) to `$PATH`.
- Setting up problem [matchers](/matchers.json).
On Windows 2016 runners, this action also checks if `$ANDROID_SDK_ROOT` path contains spaces.
If it does - it moves SDK to a path without spaces. This is needed because spaces are highly problematic:
```
C:\windows\system32\cmd.exe /D /S /C ""C:\Program Files (x86)\Android\android-sdk\cmdline-tools\3.0\bin\sdkmanager.bat" --licenses"
Error: Could not find or load main class Files
```
# Usage
See [action.yml](action.yml)
## Basic
```yaml
steps:
- uses: actions/checkout@v3
- name: Set up JDK 1.8
uses: actions/setup-java@v3
with:
java-version: 1.8
- name: Setup Android SDK
uses: android-actions/setup-android@v2
- name: Build SampleApplication
run: ./gradlew --no-daemon build
```
# Thanks
Based on the project [android-problem-matchers-action](https://github.com/jonasb/android-problem-matchers-action) from [@jonasb](https://github.com/jonasb)

View File

@@ -1,5 +1,5 @@
describe('setup-android', () => {
it('has sanity', async () => {
expect(true)
})
})
describe('setup-android', () => {
it('has sanity', async () => {
expect(true)
})
})

View File

@@ -3,10 +3,8 @@ author: 'Android-Actions'
description: 'Setup the Android SDK Tools and add them to the path'
runs:
using: 'node12'
main: 'dist/main/index.js'
post: 'dist/post/index.js'
post-if: success()
using: 'node16'
main: 'dist/index.js'
branding:
icon: 'list'

9347
dist/index.js vendored Normal file

File diff suppressed because it is too large Load Diff

1
dist/main/index.js vendored

File diff suppressed because one or more lines are too long

1
dist/post/index.js vendored

File diff suppressed because one or more lines are too long

72
matchers.json Normal file
View File

@@ -0,0 +1,72 @@
{
"problemMatcher": [
{
"owner": "android-lint-file",
"pattern": [
{
"regexp": "^(.+):\\s+(Warning|Error):\\s+(.+)\\s+\\[(.+)\\]$",
"file": 1,
"severity": 2,
"message": 3,
"code": 4,
"kind": "file"
}
]
},
{
"owner": "android-lint-line",
"pattern": [
{
"regexp": "^(.+):(\\d+):\\s+(Warning|Error):\\s+(.+)\\s+\\[(.+)\\]$",
"file": 1,
"line": 2,
"severity": 3,
"message": 4,
"code": 5
}
]
},
{
"owner": "gradle",
"pattern": [
{
"regexp": "^(error|quiet|warning|lifecycle|info|debug)\\s+(\\S+)\\s+(.+)$",
"severity": 1,
"code": 2,
"message": 3
},
{
"regexp": "^([^\\s]+):([\\d]+)$",
"file": 1,
"line": 2
}
]
},
{
"owner": "kotlin-error",
"pattern": [
{
"regexp": "^e:\\s+(\\S+):\\s+\\((\\d+),\\s+(\\d+)\\):\\s+(.+)$",
"file": 1,
"line": 2,
"column": 3,
"message": 4
}
],
"severity": "error"
},
{
"owner": "kotlin-warning",
"pattern": [
{
"regexp": "^w:\\s+(\\S+):\\s+\\((\\d+),\\s+(\\d+)\\):\\s+(.+)$",
"file": 1,
"line": 2,
"column": 3,
"message": 4
}
],
"severity": "warning"
}
]
}

16260
package-lock.json generated

File diff suppressed because it is too large Load Diff

View File

@@ -5,10 +5,10 @@
"description": "setup android action",
"main": "lib/main.js",
"scripts": {
"build": "ncc build src/main.ts --out dist/main --minify && ncc build src/post.ts --out dist/post --minify",
"build": "ncc build src/main.ts --out dist/",
"format": "prettier --write **/*.ts",
"format-check": "prettier --check **/*.ts",
"lint": "eslint src/**/*.ts",
"lint": "eslint src/*.ts",
"test": "jest",
"all": "npm run format && npm run lint && npm run build && npm test"
},
@@ -25,25 +25,26 @@
"author": "daveol",
"license": "ISC",
"dependencies": {
"@actions/cache": "^1.0.2",
"@actions/core": "^1.2.0",
"@actions/tool-cache": "^1.6.0",
"axios": "^0.19.2",
"xml-js": "^1.6.11"
"@actions/cache": "^3.0.0",
"@actions/core": "^1.3.0",
"@actions/tool-cache": "^2.0.1",
"fs-extra": "^10.0.0"
},
"devDependencies": {
"@types/jest": "^26.0.9",
"@types/node": "^12.7.12",
"@typescript-eslint/parser": "^2.8.0",
"@zeit/ncc": "^0.20.5",
"eslint": "^5.16.0",
"eslint-plugin-github": "^4.1.1",
"eslint-plugin-jest": "^22.21.0",
"jest": "^24.9.0",
"jest-circus": "^26.3.0",
"js-yaml": "^3.13.1",
"prettier": "^1.19.1",
"ts-jest": "^24.2.0",
"typescript": "^3.6.4"
"@types/fs-extra": "^9.0.11",
"@types/jest": "^28.1.6",
"@types/node": "^16.11.47",
"@typescript-eslint/eslint-plugin": "^5.20.0",
"@typescript-eslint/parser": "^5.20.0",
"@vercel/ncc": "^0.34.0",
"eslint": "^8.13.0",
"eslint-plugin-github": "^4.3.6",
"eslint-plugin-jest": "^26.1.4",
"jest": "^28.1.3",
"jest-circus": "^28.1.3",
"js-yaml": "^4.1.0",
"prettier": "^2.3.0",
"ts-jest": "^28.0.7",
"typescript": "^4.2.4"
}
}

View File

@@ -1,189 +0,0 @@
import * as glob from '@actions/glob'
import * as cache from '@actions/cache'
import * as core from '@actions/core'
import * as crypto from 'crypto'
import * as fs from 'fs'
import {platform} from 'os'
import {
GRADLE_WRAPPER_GLOB,
GRADLE_CACHE_GLOB,
GRADLE_WRAPPER_DIR,
GRADLE_CACHE_DIR,
GRADLE_WRAPPER_KEY,
GRADLE_CACHE_KEY,
ANDROID_GLOB,
ANDROID_KEY,
COMMANDLINE_TOOLS_VERSION,
ANDROID_SDK_ROOT,
ANDROID_REPOSITORIES_CACHE,
ANDROID_REPOSITORIES_CFG,
VERSION
} from './constants'
async function hashFiles(globs: string[]): Promise<string | undefined> {
const globber = await glob.create(globs.join('\n'), {
followSymbolicLinks: false
})
const hashes: Buffer[] = []
for await (const file of globber.globGenerator()) {
// skip directories
if (fs.statSync(file).isDirectory()) continue
core.debug(`hashFiles: found ${file}`)
const hash = crypto.createHash('sha256')
fs.createReadStream(file).pipe(hash)
hashes.push(hash.digest())
}
// No files hashed
if (hashes.length === 0) {
core.debug('hashFiles: no hashes in array')
return
}
// Loop trough files
const completeHash = crypto.createHash('sha256')
for (const hash of hashes) {
completeHash.update(hash)
}
completeHash.end()
return completeHash.digest('hex')
}
export async function preGradleWrapper(): Promise<void> {
const wrapperHash = await hashFiles(GRADLE_WRAPPER_GLOB)
const wrapperKey = `gradle-wrapper-${platform}-${wrapperHash}`
const wrapperRestoreKeys = [`gradle-wrapper-${platform}-`, `gradle-wrapper-`]
// if no wrapper is present skip trying to retrieve it
if (!wrapperHash) {
core.info('A hash for the gradle wrapper could not be generated')
return
}
const wrapperCache = await cache.restoreCache(
[GRADLE_WRAPPER_DIR],
wrapperKey,
wrapperRestoreKeys
)
if (!wrapperCache) {
core.info(
'Gradle wrapper cache not found, expect a download from gradle wrapper.'
)
}
if (wrapperCache !== wrapperKey) {
core.saveState(GRADLE_WRAPPER_KEY, wrapperKey)
}
return
}
export async function postGradleWrapper(): Promise<void> {
const wrapperKey = core.getState(GRADLE_WRAPPER_KEY)
if (wrapperKey === '') {
core.info(
'A key for gradle wrapper was not defined, and thus there will not be a cache'
)
return
}
await cache.saveCache([GRADLE_WRAPPER_DIR], wrapperKey)
return
}
export async function preGradleCache(): Promise<void> {
const cacheHash = await hashFiles(GRADLE_CACHE_GLOB)
const cacheKey = `gradle-cache-${platform}-${cacheHash}`
const cacheRestoreKeys = [`gradle-cache-${platform}-`, `gradle-cache-`]
if (!cacheHash) {
core.info('A hash for the gradle dependencies could not be generated')
return
}
const cacheCache = await cache.restoreCache(
[GRADLE_CACHE_DIR],
cacheKey,
cacheRestoreKeys
)
if (!cacheCache) {
core.info('Gradle cache not found, expect dependency downloads from gradle')
}
if (cacheCache !== cacheKey) {
core.saveState(GRADLE_CACHE_KEY, cacheKey)
}
return
}
export async function postGradleCache(): Promise<void> {
const cacheKey = core.getState(GRADLE_CACHE_KEY)
if (cacheKey === '') {
core.info(
'A key for gradle cache was not defined, and thus there will not be a cache'
)
return
}
await cache.saveCache([GRADLE_CACHE_DIR], cacheKey)
return
}
export async function preAndroidCache(): Promise<void> {
const androidHash = await hashFiles(ANDROID_GLOB)
const androidKey = `android-${VERSION}-${platform}-${COMMANDLINE_TOOLS_VERSION}-${androidHash}`
const androidRestoreKeys = [
`android-${VERSION}-${platform}-${COMMANDLINE_TOOLS_VERSION}-`,
`android-${VERSION}-${platform}-`
]
if (!androidHash) {
core.info('A hash for the android sdk could not be generated')
return
}
const androidCache = await cache.restoreCache(
[ANDROID_SDK_ROOT, ANDROID_REPOSITORIES_CACHE, ANDROID_REPOSITORIES_CFG],
androidKey,
androidRestoreKeys
)
if (!androidCache) {
core.info(
'Android cache not found, expect dependency downloads from gradle'
)
}
if (androidCache !== androidKey) {
core.saveState(ANDROID_KEY, androidKey)
}
return
}
export async function postAndroidCache(): Promise<void> {
const androidKey = core.getState(ANDROID_KEY)
if (androidKey === '') {
core.info(
'A key for the android sdk was not defined, and thus there will not be a cache'
)
return
}
await cache.saveCache(
[ANDROID_SDK_ROOT, ANDROID_REPOSITORIES_CACHE, ANDROID_REPOSITORIES_CFG],
androidKey
)
return
}

View File

@@ -1,49 +0,0 @@
import * as os from 'os'
import * as path from 'path'
export const ANNOTATION_MATCHERS = [
'android-lint-file-matcher.json',
'android-lint-line-matcher.json',
'gradle-matcher.json',
'kotlin-error-matcher.json',
'kotlin-warning-matcher.json'
]
export const HOME = os.homedir()
export const VERSION = 'v1'
// Gradle constants
// For caching the gradle cache in ~/.gradle/cache
export const GRADLE_CACHE_GLOB = [
'**/*.gradle',
'**.gradle',
'**/gradle.properties'
]
export const GRADLE_CACHE_DIR = path.join(HOME, '.gradle', 'cache')
export const GRADLE_CACHE_KEY = 'GRADLE_CACHE_KEY'
// For caching the gradle wrapper in ~/.gradle/wrapper
export const GRADLE_WRAPPER_GLOB = ['**/gradle/wrapper/**', '**/gradlew*']
export const GRADLE_WRAPPER_DIR = path.join(HOME, '.gradle', 'wrapper')
export const GRADLE_WRAPPER_KEY = 'GRADLE_WRAPPER_KEY'
// Android constants
export const ANDROID_SDK_ROOT = path.join(HOME, 'android')
export const ANDROID_GLOB = GRADLE_CACHE_GLOB
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_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_LIN_URL = `https://dl.google.com/android/repository/commandlinetools-linux-${COMMANDLINE_TOOLS_VERSION}_latest.zip`

View File

@@ -1,63 +0,0 @@
import * as fs from 'fs'
import * as path from 'path'
import * as core from '@actions/core'
import * as exec from '@actions/exec'
import * as tc from '@actions/tool-cache'
import {
ANDROID_SDK_ROOT,
COMMANDLINE_TOOLS_LIN_URL,
COMMANDLINE_TOOLS_MAC_URL,
COMMANDLINE_TOOLS_WIN_URL,
ANDROID_REPOSITORIES_CFG,
ANDROID_REPOSITORIES_DIR
} from './constants'
export async function install(): Promise<void> {
const licenseDir = path.join(ANDROID_SDK_ROOT, 'licenses')
// If the licences exist, the rest does too
if (fs.existsSync(licenseDir) && fs.existsSync(ANDROID_REPOSITORIES_CFG)) {
core.debug(`Skipping install, licenseDir found: ${licenseDir}`)
return
}
// 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') {
const cmdlineToolsZip = await tc.downloadTool(COMMANDLINE_TOOLS_LIN_URL)
const cmdlineTools = await tc.extractZip(cmdlineToolsZip)
sdkManager = path.join(cmdlineTools, 'tools', 'bin', 'sdkmanager')
} else if (process.platform === 'darwin') {
const cmdlineToolsZip = await tc.downloadTool(COMMANDLINE_TOOLS_MAC_URL)
const cmdlineTools = await tc.extractZip(cmdlineToolsZip)
sdkManager = path.join(cmdlineTools, 'tools', 'bin', 'sdkmanager')
} else if (process.platform === 'win32') {
const cmdlineToolsZip = await tc.downloadTool(COMMANDLINE_TOOLS_WIN_URL)
const cmdlineTools = await tc.extractZip(cmdlineToolsZip)
sdkManager = path.join(cmdlineTools, 'tools', 'bin', 'sdkmanager.bat')
} else {
core.error(`Unsupported platform: ${process.platform}`)
}
await exec.exec(
sdkManager,
['--licenses', `--sdk_root=${ANDROID_SDK_ROOT}`],
{input: acceptBuffer}
)
exec.exec(
sdkManager,
['--include_obsolete', `--sdk_root=${ANDROID_SDK_ROOT}`, 'tools'],
{input: acceptBuffer}
)
}

View File

@@ -1,26 +1,196 @@
import * as core from '@actions/core'
import * as path from 'path'
import {ANDROID_SDK_ROOT, ANNOTATION_MATCHERS} from './constants'
import {preGradleCache, preAndroidCache, preGradleWrapper} from './cache'
import {install} from './install'
async function run(): Promise<void> {
// process all caching but wait for them to all complete
await Promise.all([preGradleWrapper(), preGradleCache(), preAndroidCache()])
await install()
core.exportVariable('ANDROID_HOME', ANDROID_SDK_ROOT)
core.exportVariable('ANDROID_SDK_ROOT', ANDROID_SDK_ROOT)
core.addPath(path.join(ANDROID_SDK_ROOT, 'tools', 'bin'))
core.addPath(path.join(ANDROID_SDK_ROOT, 'platform-tools'))
core.debug('add matchers')
const matchersPath = path.join(__dirname, '..', '..', '.github')
for (const matcher of ANNOTATION_MATCHERS) {
console.log(`##[add-matcher]${path.join(matchersPath, matcher)}`)
}
}
run()
import * as core from '@actions/core'
import * as tc from '@actions/tool-cache'
import * as exec from '@actions/exec'
import * as path from 'path'
import * as fs from 'fs'
import * as fse from 'fs-extra'
import * as os from 'os'
const CMDLINE_TOOLS_VERSION = '7.0'
const COMMANDLINE_TOOLS_VERSION = '8512546'
const COMMANDLINE_TOOLS_WIN_URL = `https://dl.google.com/android/repository/commandlinetools-win-${COMMANDLINE_TOOLS_VERSION}_latest.zip`
const COMMANDLINE_TOOLS_MAC_URL = `https://dl.google.com/android/repository/commandlinetools-mac-${COMMANDLINE_TOOLS_VERSION}_latest.zip`
const COMMANDLINE_TOOLS_LIN_URL = `https://dl.google.com/android/repository/commandlinetools-linux-${COMMANDLINE_TOOLS_VERSION}_latest.zip`
const HOME = os.homedir()
const ANDROID_HOME_DIR = path.join(HOME, '.android')
const ANDROID_HOME_SDK_DIR = path.join(ANDROID_HOME_DIR, 'sdk')
let ANDROID_SDK_ROOT = process.env['ANDROID_SDK_ROOT'] || ANDROID_HOME_SDK_DIR
function getSdkManagerPath(cmdToolsVersion: string): string {
return path.join(
ANDROID_SDK_ROOT,
'cmdline-tools',
cmdToolsVersion,
'bin',
'sdkmanager'
)
}
function findPreinstalledSdkManager(): {
isFound: boolean
isCorrectVersion: boolean
exePath: string
} {
const result = {isFound: false, isCorrectVersion: false, exePath: ''}
// First try to find the version defined in CMDLINE_TOOLS_VERSION
result.exePath = getSdkManagerPath(CMDLINE_TOOLS_VERSION)
result.isFound = fs.existsSync(result.exePath)
if (result.isFound) {
result.isCorrectVersion = true
return result
}
// cmdline-tools could have a 'latest' version, but if it was installed 2 years ago
// it may not be 'latest' as of today
result.exePath = getSdkManagerPath('latest')
result.isFound = fs.existsSync(result.exePath)
if (result.isFound) {
const propertiesFile = path.join(
ANDROID_SDK_ROOT,
'cmdline-tools',
'latest',
'source.properties'
)
if (fs.existsSync(propertiesFile)) {
result.isCorrectVersion = fs
.readFileSync(propertiesFile, 'utf8')
.includes(`Pkg.Revision=${CMDLINE_TOOLS_VERSION}`)
}
return result
}
result.exePath = ''
// Find whatever version is available in ANDROID_SDK_ROOT
const cmdlineToolsDir = path.join(ANDROID_SDK_ROOT, 'cmdline-tools')
const foundVersions: string[] = fs.existsSync(cmdlineToolsDir)
? fs.readdirSync(cmdlineToolsDir)
: []
const foundVersionsFiltered: string[] = foundVersions.filter(
obj => '.' !== obj && '..' !== obj
)
// Sort by desc, to get 2.0 first, before 1.0
const foundVersionsSorted: string[] = foundVersionsFiltered.sort(
(a: string, b: string) => (a > b ? -1 : 1)
)
for (const version of foundVersionsSorted) {
result.exePath = getSdkManagerPath(version)
result.isFound = fs.existsSync(result.exePath)
if (result.isFound) {
return result
}
}
result.exePath = ''
return result
}
async function callSdkManager(sdkManager: string, arg: string): Promise<void> {
const acceptBuffer = Buffer.from(Array(10).fill('y').join('\n'), 'utf8')
await exec.exec(sdkManager, [arg], {
input: acceptBuffer
})
}
async function installSdkManager(): Promise<string> {
fs.mkdirSync(ANDROID_SDK_ROOT, {recursive: true})
// touch $ANDROID_SDK_ROOT/repositories.cfg
fs.closeSync(
fs.openSync(path.join(ANDROID_SDK_ROOT, 'repositories.cfg'), 'w')
)
const sdkManager = findPreinstalledSdkManager()
if (!sdkManager.isFound) {
let cmdlineToolsURL
if (process.platform === 'linux') {
cmdlineToolsURL = COMMANDLINE_TOOLS_LIN_URL
} else if (process.platform === 'darwin') {
cmdlineToolsURL = COMMANDLINE_TOOLS_MAC_URL
} else if (process.platform === 'win32') {
cmdlineToolsURL = COMMANDLINE_TOOLS_WIN_URL
} else {
core.error(`Unsupported platform: ${process.platform}`)
return ''
}
const cmdlineToolsZip = await tc.downloadTool(cmdlineToolsURL)
const cmdlineToolsExtractedLocation = await tc.extractZip(cmdlineToolsZip)
// Move cmdline-tools to where it would be if it was installed through sdkmanager
// Will allow calling sdkmanager without --sdk_root='..' argument
const desiredLocation = path.join(
ANDROID_SDK_ROOT,
'cmdline-tools',
CMDLINE_TOOLS_VERSION
)
// Create parent directory
fs.mkdirSync(path.dirname(desiredLocation), {recursive: true})
// Make sure we don't have leftover target directory (happens sometimes...)
if (fs.existsSync(desiredLocation)) fse.removeSync(desiredLocation)
// @TODO: use io.mv instead of fs-extra.moveSync once following issue is resolved:
// https://github.com/actions/toolkit/issues/706
fse.moveSync(
path.join(cmdlineToolsExtractedLocation, 'cmdline-tools'),
desiredLocation
)
fse.removeSync(cmdlineToolsExtractedLocation)
sdkManager.exePath = getSdkManagerPath(CMDLINE_TOOLS_VERSION)
sdkManager.isCorrectVersion = true
}
if (!sdkManager.isCorrectVersion) {
await callSdkManager(
sdkManager.exePath,
`cmdline-tools;${CMDLINE_TOOLS_VERSION}`
)
sdkManager.exePath = getSdkManagerPath(CMDLINE_TOOLS_VERSION)
}
return sdkManager.exePath
}
async function run(): Promise<void> {
if ('win16' === process.env['ImageOS']) {
if (-1 !== ANDROID_SDK_ROOT.indexOf(' ')) {
// On Windows2016, Android SDK is installed to Program Files,
// and it doesn't really work..
// C:\windows\system32\cmd.exe /D /S /C ""C:\Program Files (x86)\Android\android-sdk\cmdline-tools\3.0\bin\sdkmanager.bat" --licenses"
// Error: Could not find or load main class Files
const newSDKLocation = ANDROID_SDK_ROOT.replace(/\s/gi, '-')
core.debug(`moving ${ANDROID_SDK_ROOT} to ${newSDKLocation}`)
fs.mkdirSync(path.dirname(newSDKLocation), {recursive: true})
// intentionally using fs.renameSync,
// because it doesn't move across drives
fs.renameSync(ANDROID_SDK_ROOT, newSDKLocation)
ANDROID_SDK_ROOT = newSDKLocation
}
}
const sdkManager = await installSdkManager()
core.debug(`sdkmanager installed to: ${sdkManager}`)
await callSdkManager(sdkManager, '--licenses')
await callSdkManager(sdkManager, 'tools')
await callSdkManager(sdkManager, 'platform-tools')
core.setOutput('ANDROID_COMMANDLINE_TOOLS_VERSION', COMMANDLINE_TOOLS_VERSION)
core.exportVariable('ANDROID_HOME', ANDROID_SDK_ROOT)
core.exportVariable('ANDROID_SDK_ROOT', ANDROID_SDK_ROOT)
core.addPath(path.dirname(sdkManager))
core.addPath(path.join(ANDROID_SDK_ROOT, 'platform-tools'))
core.debug('add matchers')
// eslint-disable-next-line no-console
console.log(`##[add-matcher]${path.join(__dirname, '..', 'matchers.json')}`)
}
run()

View File

@@ -1,13 +0,0 @@
import {postAndroidCache, postGradleCache, postGradleWrapper} from './cache'
async function run(): Promise<void> {
await Promise.all([
postGradleCache(),
postGradleWrapper(),
postAndroidCache()
])
return
}
run()

View File

@@ -6,7 +6,8 @@
"rootDir": "./src", /* Specify the root directory of input files. Use to control the output directory structure with --outDir. */
"strict": true, /* Enable all strict type-checking options. */
"noImplicitAny": true, /* Raise error on expressions and declarations with an implied 'any' type. */
"esModuleInterop": true /* Enables emit interoperability between CommonJS and ES Modules via creation of namespace objects for all imports. Implies 'allowSyntheticDefaultImports'. */
"esModuleInterop": true, /* Enables emit interoperability between CommonJS and ES Modules via creation of namespace objects for all imports. Implies 'allowSyntheticDefaultImports'. */
"moduleResolution": "node"
},
"exclude": ["node_modules", "**/*.test.ts"]
}