Skip to content
This repository was archived by the owner on Feb 9, 2022. It is now read-only.

feat(android): support v30 #61

Merged
merged 2 commits into from
Jun 25, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 4 additions & 2 deletions lib/android-tools-info.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,12 +10,13 @@ import * as _ from "lodash";

export class AndroidToolsInfo implements NativeScriptDoctor.IAndroidToolsInfo {
public readonly ANDROID_TARGET_PREFIX = "android";
private getSupportedTargets(projectDir: string) {
public getSupportedTargets(projectDir: string) {
const runtimeVersion = this.getRuntimeVersion({projectDir});
let baseTargets = [
"android-17",
"android-18",
"android-19",
"android-20",
"android-21",
"android-22",
"android-23",
Expand All @@ -24,7 +25,8 @@ export class AndroidToolsInfo implements NativeScriptDoctor.IAndroidToolsInfo {
"android-26",
"android-27",
"android-28",
"android-29"
"android-29",
"android-30"
];

if (runtimeVersion && semver.lt(semver.coerce(runtimeVersion), "6.1.0")) {
Expand Down
12 changes: 9 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,11 +1,16 @@
{
"name": "nativescript-doctor",
"version": "1.14.1",
"version": "1.14.2",
"description": "Library that helps identifying if the environment can be used for development of {N} apps.",
"main": "lib/index.js",
"types": "./typings/nativescript-doctor.d.ts",
"scripts": {
"test": "node_modules/.bin/istanbul cover ./node_modules/mocha/bin/_mocha -- --recursive"
"clean": "npx rimraf node_modules package-lock.json && npm i && ./node_modules/.bin/grunt clean",
"build": "./node_modules/.bin/grunt",
"build.all": "./node_modules/.bin/grunt ts:devall",
"pack": "./node_modules/.bin/grunt pack",
"test": "node_modules/.bin/istanbul cover ./node_modules/mocha/bin/_mocha -- --recursive",
"changelog": "conventional-changelog -p angular -i CHANGELOG.md -s"
},
"repository": {
"type": "git",
Expand Down Expand Up @@ -33,6 +38,7 @@
"@types/winreg": "1.2.30",
"@types/yauzl": "2.9.0",
"chai": "4.1.2",
"conventional-changelog-cli": "^2.0.34",
"grunt": "1.0.3",
"grunt-contrib-clean": "1.0.0",
"grunt-contrib-watch": "1.1.0",
Expand All @@ -44,7 +50,7 @@
"rimraf": "2.5.4",
"tslint": "5.14.0",
"tslint-microsoft-contrib": "6.1.0",
"typescript": "3.3.4000"
"typescript": "~3.8.3"
},
"dependencies": {
"lodash": "4.17.15",
Expand Down
15 changes: 15 additions & 0 deletions test/android-tools-info.ts
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,21 @@ describe("androidToolsInfo", () => {
});
});

describe("supportedAndroidSdks", () => {
it("should support android-17 - android-30", () => {
const min = 17;
const max = 30;
let cnt = 0;
const androidToolsInfo = getAndroidToolsInfo("6.5.0");
const supportedTargets = androidToolsInfo.getSupportedTargets("test");
for (let i = 0; i < supportedTargets.length; i++) {
assert.equal(supportedTargets[i], `android-${min+i}`);
cnt = min+i;
}
assert.equal(cnt, max);
});
});

describe("validateJavacVersion", () => {
const testData: ITestData[] = [
{
Expand Down
1 change: 0 additions & 1 deletion tslint.json
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,6 @@
true,
"check-branch",
"check-decl",
"check-operator",
"check-module",
"check-separator"
]
Expand Down