Skip to content

Separate methods used instead getSysInfo() #1857

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jun 20, 2016
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
11 changes: 4 additions & 7 deletions lib/services/android-project-service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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<IAndroidProjectPropertiesManager>;

constructor(private $androidEmulatorServices: Mobile.IEmulatorPlatformServices,
Expand Down Expand Up @@ -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<void>()();
}

Expand Down Expand Up @@ -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<any>()();
}

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 {
Expand Down
2 changes: 1 addition & 1 deletion lib/services/platform-service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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.`);
}
});
Expand Down
2 changes: 1 addition & 1 deletion lib/services/xcproj-service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ class XcprojService implements IXcprojService {
public getXcprojInfo(): IFuture<IXcprojInfo> {
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)) {
Expand Down