diff --git a/lib/common b/lib/common index 77d58daa8e..fba05a71d4 160000 --- a/lib/common +++ b/lib/common @@ -1 +1 @@ -Subproject commit 77d58daa8e82825c8373b5404b17a87b2167e917 +Subproject commit fba05a71d43a878fe8547363237f1de9d871385f diff --git a/lib/definitions/platform.d.ts b/lib/definitions/platform.d.ts index b8d2a32cc2..15aba5c20f 100644 --- a/lib/definitions/platform.d.ts +++ b/lib/definitions/platform.d.ts @@ -381,5 +381,5 @@ interface IUpdateAppOptions extends IOptionalFilesToSync, IOptionalFilesToRemove } interface IPlatformEnvironmentRequirements { - checkEnvironmentRequirements(platform?: string): Promise; + checkEnvironmentRequirements(platform?: string, projectDir?: string): Promise; } \ No newline at end of file diff --git a/lib/services/android-project-service.ts b/lib/services/android-project-service.ts index 7157e0fdec..3567a47783 100644 --- a/lib/services/android-project-service.ts +++ b/lib/services/android-project-service.ts @@ -133,7 +133,7 @@ export class AndroidProjectService extends projectServiceBaseLib.PlatformProject this.validatePackageName(projectData.projectId); this.validateProjectName(projectData.projectName); - await this.$platformEnvironmentRequirements.checkEnvironmentRequirements(this.getPlatformData(projectData).normalizedPlatformName); + await this.$platformEnvironmentRequirements.checkEnvironmentRequirements(this.getPlatformData(projectData).normalizedPlatformName, projectData.projectDir); this.$androidToolsInfo.validateTargetSdk({ showWarningsAsErrors: true }); } diff --git a/lib/services/doctor-service.ts b/lib/services/doctor-service.ts index 514614833c..c200007451 100644 --- a/lib/services/doctor-service.ts +++ b/lib/services/doctor-service.ts @@ -17,10 +17,10 @@ class DoctorService implements IDoctorService { private $terminalSpinnerService: ITerminalSpinnerService, private $versionsService: IVersionsService) { } - public async printWarnings(configOptions?: { trackResult: boolean }): Promise { + public async printWarnings(configOptions?: { trackResult: boolean , projectDir?: string }): Promise { const infos = await this.$terminalSpinnerService.execute({ text: `Getting environment information ${EOL}` - }, () => doctor.getInfos()); + }, () => doctor.getInfos({ projectDir: configOptions && configOptions.projectDir })); const warnings = infos.filter(info => info.type === constants.WARNING_TYPE_NAME); const hasWarnings = warnings.length > 0; @@ -48,7 +48,7 @@ class DoctorService implements IDoctorService { this.$logger.error("Cannot get the latest versions information from npm. Please try again later."); } - await this.$injector.resolve("platformEnvironmentRequirements").checkEnvironmentRequirements(null); + await this.$injector.resolve("platformEnvironmentRequirements").checkEnvironmentRequirements(null, configOptions && configOptions.projectDir); } public async runSetupScript(): Promise { @@ -81,12 +81,12 @@ class DoctorService implements IDoctorService { }); } - public async canExecuteLocalBuild(platform?: string): Promise { + public async canExecuteLocalBuild(platform?: string, projectDir?: string): Promise { await this.$analyticsService.trackEventActionInGoogleAnalytics({ action: TrackActionNames.CheckLocalBuildSetup, additionalData: "Starting", }); - const infos = await doctor.getInfos({ platform }); + const infos = await doctor.getInfos({ platform, projectDir }); const warnings = this.filterInfosByType(infos, constants.WARNING_TYPE_NAME); const hasWarnings = warnings.length > 0; diff --git a/lib/services/ios-project-service.ts b/lib/services/ios-project-service.ts index a56a6c1961..6866df6f76 100644 --- a/lib/services/ios-project-service.ts +++ b/lib/services/ios-project-service.ts @@ -139,7 +139,7 @@ export class IOSProjectService extends projectServiceBaseLib.PlatformProjectServ return; } - await this.$platformEnvironmentRequirements.checkEnvironmentRequirements(this.getPlatformData(projectData).normalizedPlatformName); + await this.$platformEnvironmentRequirements.checkEnvironmentRequirements(this.getPlatformData(projectData).normalizedPlatformName, projectData.projectDir); const xcodeBuildVersion = await this.getXcodeVersion(); if (helpers.versionCompare(xcodeBuildVersion, IOSProjectService.XCODEBUILD_MIN_VERSION) < 0) { diff --git a/lib/services/platform-environment-requirements.ts b/lib/services/platform-environment-requirements.ts index cfc1213c2f..e5b17199b2 100644 --- a/lib/services/platform-environment-requirements.ts +++ b/lib/services/platform-environment-requirements.ts @@ -30,7 +30,7 @@ export class PlatformEnvironmentRequirements implements IPlatformEnvironmentRequ "deploy": "tns cloud deploy" }; - public async checkEnvironmentRequirements(platform?: string): Promise { + public async checkEnvironmentRequirements(platform?: string, projectDir?: string): Promise { if (process.env.NS_SKIP_ENV_CHECK) { await this.$analyticsService.trackEventActionInGoogleAnalytics({ action: TrackActionNames.CheckEnvironmentRequirements, @@ -39,7 +39,7 @@ export class PlatformEnvironmentRequirements implements IPlatformEnvironmentRequ return true; } - const canExecute = await this.$doctorService.canExecuteLocalBuild(platform); + const canExecute = await this.$doctorService.canExecuteLocalBuild(platform, projectDir); if (!canExecute) { if (!isInteractive()) { await this.$analyticsService.trackEventActionInGoogleAnalytics({ @@ -71,7 +71,7 @@ export class PlatformEnvironmentRequirements implements IPlatformEnvironmentRequ if (selectedOption === PlatformEnvironmentRequirements.LOCAL_SETUP_OPTION_NAME) { await this.$doctorService.runSetupScript(); - if (await this.$doctorService.canExecuteLocalBuild(platform)) { + if (await this.$doctorService.canExecuteLocalBuild(platform, projectDir)) { return true; } @@ -102,7 +102,7 @@ export class PlatformEnvironmentRequirements implements IPlatformEnvironmentRequ if (selectedOption === PlatformEnvironmentRequirements.BOTH_CLOUD_SETUP_AND_LOCAL_SETUP_OPTION_NAME) { await this.processBothCloudBuildsAndSetupScript(); - if (await this.$doctorService.canExecuteLocalBuild(platform)) { + if (await this.$doctorService.canExecuteLocalBuild(platform, projectDir)) { return true; } diff --git a/npm-shrinkwrap.json b/npm-shrinkwrap.json index 595caf812c..b42340ae95 100644 --- a/npm-shrinkwrap.json +++ b/npm-shrinkwrap.json @@ -3812,9 +3812,9 @@ "integrity": "sha512-Q29yeg9aFKwhLVdkTAejM/HvYG0Y1Am1+HUkFQGn5k2j8GS+v60TVmZh6nujpEAj/qql+wGUrlryO8bF+b1jEg==" }, "nativescript-doctor": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/nativescript-doctor/-/nativescript-doctor-1.0.0.tgz", - "integrity": "sha512-QZ/hhDCeenIyVM3e9ly4xqldvsQwpQUv9R6Eqq7EXujysDrOyhRb2o59SbJ14uWRBYVKFILEvls+tqSWdc/wSw==", + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/nativescript-doctor/-/nativescript-doctor-1.1.0.tgz", + "integrity": "sha512-XmZO+6tLbiOGr/gLYuhmVhec0UPOSsShK/dG7LlEkiLOE7ew7LB/j/gPFAzS5I54jjudJ/qDK/cMvcZWS0TvBg==", "requires": { "osenv": "0.1.3", "semver": "5.3.0", diff --git a/package.json b/package.json index bc5e4f541c..180e50cbaf 100644 --- a/package.json +++ b/package.json @@ -53,7 +53,7 @@ "minimatch": "3.0.2", "mkdirp": "0.5.1", "mute-stream": "0.0.5", - "nativescript-doctor": "1.0.0", + "nativescript-doctor": "1.1.0", "open": "0.0.5", "ora": "2.0.0", "osenv": "0.1.3",