Skip to content

Commit 4d502a9

Browse files
Merge pull request #41 from NativeScript/vladimirov/remove-android-support-library-requirement
feat: remove requirement for Android Support Repository installation
2 parents 978d5ef + f8c35da commit 4d502a9

File tree

3 files changed

+1
-45
lines changed

3 files changed

+1
-45
lines changed

lib/android-tools-info.ts

-39
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,6 @@ export class AndroidToolsInfo implements NativeScriptDoctor.IAndroidToolsInfo {
3030
infoData.androidHomeEnvVar = this.androidHome;
3131
infoData.compileSdkVersion = this.getCompileSdk();
3232
infoData.buildToolsVersion = this.getBuildToolsVersion();
33-
infoData.supportRepositoryVersion = this.getAndroidSupportRepositoryVersion();
3433

3534
this.toolsInfo = infoData;
3635
}
@@ -72,19 +71,6 @@ export class AndroidToolsInfo implements NativeScriptDoctor.IAndroidToolsInfo {
7271
});
7372
}
7473

75-
if (!toolsInfoData.supportRepositoryVersion) {
76-
let invalidSupportLibAdditionalMsg = `Run \`\$ ${this.getPathToSdkManagementTool()}\` to manage the Android Support Repository.`;
77-
if (!isAndroidHomeValid) {
78-
invalidSupportLibAdditionalMsg += ' In case you already have it installed, make sure `ANDROID_HOME` environment variable is set correctly.';
79-
}
80-
81-
errors.push({
82-
warning: `You need to have Android SDK ${AndroidToolsInfo.MIN_REQUIRED_COMPILE_TARGET} or later and the latest Android Support Repository installed on your system.`,
83-
additionalInformation: invalidSupportLibAdditionalMsg,
84-
platforms: [Constants.ANDROID_PLATFORM_NAME]
85-
});
86-
}
87-
8874
return errors;
8975
}
9076

@@ -275,31 +261,6 @@ export class AndroidToolsInfo implements NativeScriptDoctor.IAndroidToolsInfo {
275261
return buildToolsVersion;
276262
}
277263

278-
private getAppCompatRange(): string {
279-
let compileSdkVersion = this.getCompileSdk();
280-
let requiredAppCompatRange: string;
281-
if (compileSdkVersion) {
282-
requiredAppCompatRange = `>=${compileSdkVersion} <${compileSdkVersion + 1}`;
283-
}
284-
285-
return requiredAppCompatRange;
286-
}
287-
288-
private getAndroidSupportRepositoryVersion(): string {
289-
let selectedAppCompatVersion: string;
290-
const requiredAppCompatRange = this.getAppCompatRange();
291-
if (this.androidHome && requiredAppCompatRange) {
292-
const pathToAppCompat = path.join(this.androidHome, "extras", "android", "m2repository", "com", "android", "support", "appcompat-v7");
293-
selectedAppCompatVersion = this.getMatchingDir(pathToAppCompat, requiredAppCompatRange);
294-
if (!selectedAppCompatVersion) {
295-
// get latest matching version, as there's no available appcompat versions for latest SDK versions.
296-
selectedAppCompatVersion = this.getMatchingDir(pathToAppCompat, "*");
297-
}
298-
}
299-
300-
return selectedAppCompatVersion;
301-
}
302-
303264
private getLatestValidAndroidTarget(): string {
304265
const installedTargets = this.getInstalledTargets();
305266
let latestValidAndroidTarget: string;

package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "nativescript-doctor",
3-
"version": "1.2.1",
3+
"version": "1.3.0",
44
"description": "Library that helps identifying if the environment can be used for development of {N} apps.",
55
"main": "lib/index.js",
66
"types": "./typings/nativescript-doctor.d.ts",

typings/interfaces.ts

-5
Original file line numberDiff line numberDiff line change
@@ -489,10 +489,5 @@ declare module NativeScriptDoctor {
489489
* The latest installed version of Android SDK that satisfies CLI's requirements.
490490
*/
491491
compileSdkVersion: number;
492-
493-
/**
494-
* The latest installed version of Android Support Repository that satisfies CLI's requirements.
495-
*/
496-
supportRepositoryVersion: string;
497492
}
498493
}

0 commit comments

Comments
 (0)