From 14b598cce619b9bc2760e5ac347ca8ff3ebbcb01 Mon Sep 17 00:00:00 2001 From: Vladimir Enchev Date: Fri, 17 Jun 2016 12:35:34 +0300 Subject: [PATCH] Separate methods used instead getSysInfo() --- lib/common | 2 +- lib/services/android-project-service.ts | 11 ++++------- lib/services/platform-service.ts | 2 +- lib/services/xcproj-service.ts | 2 +- 4 files changed, 7 insertions(+), 10 deletions(-) diff --git a/lib/common b/lib/common index c68d228330..4c19dd0aa1 160000 --- a/lib/common +++ b/lib/common @@ -1 +1 @@ -Subproject commit c68d228330ae382e69066608c370b4cea1610916 +Subproject commit 4c19dd0aa16403305e24900d665f46f5ba6aafaf diff --git a/lib/services/android-project-service.ts b/lib/services/android-project-service.ts index 025968c220..b0d3d14a9f 100644 --- a/lib/services/android-project-service.ts +++ b/lib/services/android-project-service.ts @@ -23,10 +23,6 @@ export class AndroidProjectService extends projectServiceBaseLib.PlatformProject { name: "lazy", version: "^1.0.11" } ]; - private get sysInfoData(): ISysInfoData { - return this.$sysInfo.getSysInfo(path.join(__dirname, "..", "..", "package.json")).wait(); - } - private _androidProjectPropertiesManagers: IDictionary; constructor(private $androidEmulatorServices: Mobile.IEmulatorPlatformServices, @@ -99,7 +95,8 @@ export class AndroidProjectService extends projectServiceBaseLib.PlatformProject // this call will fail in case `android` is not set correctly. this.$androidToolsInfo.getPathToAndroidExecutable({ showWarningsAsErrors: true }).wait(); - this.$androidToolsInfo.validateJavacVersion(this.sysInfoData.javacVersion, { showWarningsAsErrors: true }).wait(); + let javaCompilerVersion = this.$sysInfo.getJavaCompilerVersion().wait(); + this.$androidToolsInfo.validateJavacVersion(javaCompilerVersion, { showWarningsAsErrors: true }).wait(); }).future()(); } @@ -167,14 +164,14 @@ export class AndroidProjectService extends projectServiceBaseLib.PlatformProject } }); } else { - this.$logger.printMarkdown(` As you are using Node.js \`${this.sysInfoData.nodeVer}\` Static Binding Generator will be turned off.` + + this.$logger.printMarkdown(` As you are using Node.js \`${process.version}\` Static Binding Generator will be turned off.` + `Upgrade your Node.js to ${AndroidProjectService.MIN_REQUIRED_NODEJS_VERSION_FOR_STATIC_BINDINGS} or later, so you can use this feature.`); } }).future()(); } private canUseStaticBindingGenerator(): boolean { - return semver.gte(this.sysInfoData.nodeVer, AndroidProjectService.MIN_REQUIRED_NODEJS_VERSION_FOR_STATIC_BINDINGS); + return semver.gte(process.version, AndroidProjectService.MIN_REQUIRED_NODEJS_VERSION_FOR_STATIC_BINDINGS); } private useGradleWrapper(frameworkDir: string): boolean { diff --git a/lib/services/platform-service.ts b/lib/services/platform-service.ts index 046a175190..1dc70fe249 100644 --- a/lib/services/platform-service.ts +++ b/lib/services/platform-service.ts @@ -218,7 +218,7 @@ export class PlatformService implements IPlatformService { if (platform === "ios") { _.each(this.$pluginsService.getAllInstalledPlugins().wait(), (pluginData: IPluginData) => { if (this.$fs.exists(path.join(pluginData.pluginPlatformsFolderPath(platform), "Podfile")).wait() && - !this.$sysInfo.getSysInfo(this.$staticConfig.pathToPackageJson).wait().cocoapodVer) { + !this.$sysInfo.getCocoapodVersion().wait()) { this.$errors.failWithoutHelp(`${pluginData.name} has Podfile and you don't have Cocoapods installed or it is not configured correctly. Please verify Cocoapods can work on your machine.`); } }); diff --git a/lib/services/xcproj-service.ts b/lib/services/xcproj-service.ts index 664f74dd96..10405c2e07 100644 --- a/lib/services/xcproj-service.ts +++ b/lib/services/xcproj-service.ts @@ -34,7 +34,7 @@ class XcprojService implements IXcprojService { public getXcprojInfo(): IFuture { return ((): IXcprojInfo => { if (!this.xcprojInfoCache) { - let cocoapodVer = this.$sysInfo.getSysInfo(this.$staticConfig.pathToPackageJson).wait().cocoapodVer, + let cocoapodVer = this.$sysInfo.getCocoapodVersion().wait(), xcodeVersion = this.$xcodeSelectService.getXcodeVersion().wait(); if(cocoapodVer && !semver.valid(cocoapodVer)) {