From 8d6684b8c3e3750820fcbb35fd7ea55bb2a4e513 Mon Sep 17 00:00:00 2001 From: Fatme Havaluova Date: Tue, 29 Sep 2015 16:09:21 +0300 Subject: [PATCH] Warning if pods are not installed and for old CocoaPods versions https://github.com/NativeScript/nativescript-cli/issues/949 --- lib/common | 2 +- lib/services/doctor-service.ts | 18 +++++++++++++++++- 2 files changed, 18 insertions(+), 2 deletions(-) diff --git a/lib/common b/lib/common index bee77ac80a..dcdddcee7c 160000 --- a/lib/common +++ b/lib/common @@ -1 +1 @@ -Subproject commit bee77ac80a5fae35fb3fa13bbac24375297775c5 +Subproject commit dcdddcee7c23f40e34b59840ac7f29f6d1b14539 diff --git a/lib/services/doctor-service.ts b/lib/services/doctor-service.ts index c03353a570..5044c3f319 100644 --- a/lib/services/doctor-service.ts +++ b/lib/services/doctor-service.ts @@ -2,9 +2,11 @@ "use strict"; import {EOL} from "os"; import * as helpers from "../common/helpers"; +import * as semver from "semver"; class DoctorService implements IDoctorService { private static MIN_SUPPORTED_GRADLE_VERSION = "2.3"; + private static MIN_SUPPORTED_POD_VERSION = "0.38.2"; constructor(private $androidToolsInfo: IAndroidToolsInfo, private $hostInfo: IHostInfo, @@ -67,7 +69,7 @@ class DoctorService implements IDoctorService { if(sysInfo.gradleVer && helpers.versionCompare(sysInfo.gradleVer, DoctorService.MIN_SUPPORTED_GRADLE_VERSION) === -1) { this.$logger.warn(`WARNING: Gradle version is lower than ${DoctorService.MIN_SUPPORTED_GRADLE_VERSION}.`); this.$logger.out("You will not be able to build your projects for Android or run them in the emulator or on a connected device." + EOL - + `To be able to build for Android and run apps in the emulator or on a connected device, verify thqt you have at least ${DoctorService.MIN_SUPPORTED_GRADLE_VERSION} version installed.`); + + `To be able to build for Android and run apps in the emulator or on a connected device, verify that you have at least ${DoctorService.MIN_SUPPORTED_GRADLE_VERSION} version installed.`); result = true; } @@ -79,6 +81,20 @@ class DoctorService implements IDoctorService { result = true; } + if(!sysInfo.cocoapodVer) { + this.$logger.warn("WARNING: CocoaPod is not installed or is not configured properly."); + this.$logger.out("You will not be able to build your projects for iOS if they contain plugin with CocoaPod file." + EOL + + "To be able to build such projects, verify that you have installed CocoaPod."); + result = true; + } + + if(sysInfo.cocoapodVer && semver.lt(sysInfo.cocoapodVer, DoctorService.MIN_SUPPORTED_POD_VERSION)) { + this.$logger.warn(`WARNING: CocoaPod version is lower than ${DoctorService.MIN_SUPPORTED_POD_VERSION}`); + this.$logger.out("You will not be able to build your projects for iOS if they contain plugin with CocoaPod file." + EOL + + `To be able to build such projects, verify that you have at least ${DoctorService.MIN_SUPPORTED_POD_VERSION} version installed.`); + result = true; + } + let androidToolsIssues = this.$androidToolsInfo.validateInfo().wait(); return result || androidToolsIssues; }