Skip to content

Commit 609113e

Browse files
feat: add android 36.1 sdk target support
Agent-Logs-Url: https://github.com/NativeScript/nativescript-cli/sessions/88eeac91-da5e-44b8-9dcc-3560b73090e9 Co-authored-by: NathanWalker <457187+NathanWalker@users.noreply.github.com>
1 parent e563e4f commit 609113e

3 files changed

Lines changed: 21 additions & 20 deletions

File tree

lib/common/mobile/emulator-helper.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ import { injector } from "../yok";
55
export class EmulatorHelper implements Mobile.IEmulatorHelper {
66
// https://developer.android.com/guide/topics/manifest/uses-sdk-element
77
public mapAndroidApiLevelToVersion = {
8+
"android-36.1": "16.0.0",
89
"android-36": "16.0.0",
910
"android-35": "15.0.0",
1011
"android-34": "14.0.0",

packages/doctor/src/android-tools-info.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,7 @@ export class AndroidToolsInfo implements NativeScriptDoctor.IAndroidToolsInfo {
3333
"android-34",
3434
"android-35",
3535
"android-36",
36+
"android-36.1",
3637
];
3738

3839
const isRuntimeVersionLessThan = (targetVersion: string) => {

packages/doctor/test/android-tools-info.ts

Lines changed: 19 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -71,6 +71,7 @@ describe("androidToolsInfo", () => {
7171
"android-34",
7272
"android-35",
7373
"android-36",
74+
"android-36.1",
7475
];
7576
}
7677
},
@@ -111,38 +112,36 @@ describe("androidToolsInfo", () => {
111112
});
112113

113114
describe("supportedAndroidSdks", () => {
114-
const assertSupportedRange = (
115+
const assertSupportedTargets = (
115116
runtimeVersion: string,
116-
min: number,
117-
max: number,
117+
expectedTargets: string[],
118118
) => {
119-
let cnt = 0;
120119
const androidToolsInfo = getAndroidToolsInfo(runtimeVersion);
121120
const supportedTargets = androidToolsInfo.getSupportedTargets("test");
122-
for (let i = 0; i < supportedTargets.length; i++) {
123-
assert.equal(supportedTargets[i], `android-${min + i}`);
124-
cnt = min + i;
125-
}
126-
assert.equal(cnt, max);
121+
assert.deepEqual(supportedTargets, expectedTargets);
127122
};
128123

129124
it("runtime 6.0.0 should support android-17 - android-28", () => {
130-
const min = 17;
131-
const max = 28;
132-
assertSupportedRange("6.0.0", min, max);
125+
assertSupportedTargets(
126+
"6.0.0",
127+
Array.from({ length: 12 }, (_, index) => `android-${17 + index}`),
128+
);
133129
});
134130

135131
it("runtime 8.1.0 should support android-17 - android-30", () => {
136-
const min = 17;
137-
const max = 30;
138-
assertSupportedRange("8.1.0", min, max);
132+
assertSupportedTargets(
133+
"8.1.0",
134+
Array.from({ length: 14 }, (_, index) => `android-${17 + index}`),
135+
);
139136
});
140137

141-
it("runtime 8.2.0 should support android-17 - android-34", () => {
142-
const min = 17;
143-
const max = 36;
144-
assertSupportedRange("8.2.0", min, max);
145-
assertSupportedRange("8.3.0", min, max);
138+
it("runtime 8.2.0 should support android-17 - android-36.1", () => {
139+
const expectedTargets = [
140+
...Array.from({ length: 20 }, (_, index) => `android-${17 + index}`),
141+
"android-36.1",
142+
];
143+
assertSupportedTargets("8.2.0", expectedTargets);
144+
assertSupportedTargets("8.3.0", expectedTargets);
146145
});
147146
});
148147

0 commit comments

Comments
 (0)