From 239c6f5c7c0c07bad35cc8e05a4663cd14c19045 Mon Sep 17 00:00:00 2001 From: Vilius Sutkus '89 Date: Wed, 3 Aug 2022 13:36:32 +0300 Subject: [PATCH 1/5] [CI] Update test matrix to include ubuntu-22.04 and macos-12 --- .github/workflows/build-test.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/build-test.yml b/.github/workflows/build-test.yml index 4373e36..350dd2a 100644 --- a/.github/workflows/build-test.yml +++ b/.github/workflows/build-test.yml @@ -59,7 +59,7 @@ jobs: strategy: fail-fast: false matrix: - os: [ ubuntu-18.04, ubuntu-20.04, macos-10.15, macos-11, windows-2019, windows-2022 ] + os: [ ubuntu-18.04, ubuntu-20.04, ubuntu-22.04, macos-10.15, macos-11, macos-12, windows-2019, windows-2022 ] steps: - uses: actions/checkout@v3 From 88c04cbb34d1bee66b2ce7d8eb4e16f981bc654d Mon Sep 17 00:00:00 2001 From: Vilius Sutkus '89 Date: Wed, 3 Aug 2022 13:39:25 +0300 Subject: [PATCH 2/5] [CI] Remove macos-10.15, because it is deprecated --- .github/workflows/build-test.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/build-test.yml b/.github/workflows/build-test.yml index 350dd2a..d4292e3 100644 --- a/.github/workflows/build-test.yml +++ b/.github/workflows/build-test.yml @@ -59,7 +59,7 @@ jobs: strategy: fail-fast: false matrix: - os: [ ubuntu-18.04, ubuntu-20.04, ubuntu-22.04, macos-10.15, macos-11, macos-12, windows-2019, windows-2022 ] + os: [ ubuntu-18.04, ubuntu-20.04, ubuntu-22.04, macos-11, macos-12, windows-2019, windows-2022 ] steps: - uses: actions/checkout@v3 From 4360e92aa0637d124fbaabd0f4458b9cf2df2a90 Mon Sep 17 00:00:00 2001 From: Vilius Sutkus '89 Date: Wed, 3 Aug 2022 15:00:44 +0300 Subject: [PATCH 3/5] Read version of cmdline-tools/latest, if version is correct - use it --- dist/index.js | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/dist/index.js b/dist/index.js index 6eec7bc..4f212e0 100644 --- a/dist/index.js +++ b/dist/index.js @@ -8589,6 +8589,12 @@ function findPreinstalledSdkManager() { 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)) { + const correctRevisionString = `Pkg.Revision=${CMDLINE_TOOLS_VERSION}`; + console.log(correctRevisionString); + result.isCorrectVersion = fs.readFileSync(propertiesFile, 'utf8').includes(correctRevisionString); + } return result; } result.exePath = ''; From 1ba064a8a2053883fee55b99e4104103c60cb105 Mon Sep 17 00:00:00 2001 From: Vilius Sutkus '89 Date: Wed, 3 Aug 2022 15:02:48 +0300 Subject: [PATCH 4/5] [2/2] Read version of cmdline-tools/latest, if version is correct - use it --- dist/index.js | 6 +++--- src/main.ts | 11 +++++++++++ 2 files changed, 14 insertions(+), 3 deletions(-) diff --git a/dist/index.js b/dist/index.js index 4f212e0..677f9c0 100644 --- a/dist/index.js +++ b/dist/index.js @@ -8591,9 +8591,9 @@ function findPreinstalledSdkManager() { if (result.isFound) { const propertiesFile = path.join(ANDROID_SDK_ROOT, 'cmdline-tools', 'latest', 'source.properties'); if (fs.existsSync(propertiesFile)) { - const correctRevisionString = `Pkg.Revision=${CMDLINE_TOOLS_VERSION}`; - console.log(correctRevisionString); - result.isCorrectVersion = fs.readFileSync(propertiesFile, 'utf8').includes(correctRevisionString); + result.isCorrectVersion = fs + .readFileSync(propertiesFile, 'utf8') + .includes(`Pkg.Revision=${CMDLINE_TOOLS_VERSION}`); } return result; } diff --git a/src/main.ts b/src/main.ts index 14d5dbb..e8f0f6b 100644 --- a/src/main.ts +++ b/src/main.ts @@ -48,6 +48,17 @@ function findPreinstalledSdkManager(): { 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 = '' From 3d201fcd5195fb2feadeb5b4bbc84bb6561b4397 Mon Sep 17 00:00:00 2001 From: Vilius Sutkus '89 Date: Wed, 3 Aug 2022 15:03:16 +0300 Subject: [PATCH 5/5] Update cmdline-tools version to 7.0 --- dist/index.js | 4 ++-- src/main.ts | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/dist/index.js b/dist/index.js index 677f9c0..37a3861 100644 --- a/dist/index.js +++ b/dist/index.js @@ -8563,8 +8563,8 @@ const path = __importStar(__nccwpck_require__(1017)); const fs = __importStar(__nccwpck_require__(7147)); const fse = __importStar(__nccwpck_require__(5630)); const os = __importStar(__nccwpck_require__(2037)); -const CMDLINE_TOOLS_VERSION = '6.0'; -const COMMANDLINE_TOOLS_VERSION = '8092744'; +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`; diff --git a/src/main.ts b/src/main.ts index e8f0f6b..697bef3 100644 --- a/src/main.ts +++ b/src/main.ts @@ -6,8 +6,8 @@ import * as fs from 'fs' import * as fse from 'fs-extra' import * as os from 'os' -const CMDLINE_TOOLS_VERSION = '6.0' -const COMMANDLINE_TOOLS_VERSION = '8092744' +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`