diff --git a/lib/common/declarations.d.ts b/lib/common/declarations.d.ts index 0d0e0c706b..b6ee3c263c 100644 --- a/lib/common/declarations.d.ts +++ b/lib/common/declarations.d.ts @@ -1046,6 +1046,12 @@ interface ISysInfo { * @return {string} The range of supported Node.js versions. */ getSupportedNodeVersionRange(): string; + + /** + * Gets warning message in case the currently installed Xcode will not be supported in next versions + * @returns {string} + */ + getXcodeWarning(): Promise; } interface IHostInfo { diff --git a/lib/constants.ts b/lib/constants.ts index 45009ec50c..ae885229f4 100644 --- a/lib/constants.ts +++ b/lib/constants.ts @@ -242,9 +242,12 @@ export class MacOSVersions { public static Sierra = "10.12"; public static HighSierra = "10.13"; public static Mojave = "10.14"; + public static Catalina = "10.15"; } export const MacOSDeprecationStringFormat = "NativeScript does not support macOS %s and some functionality may not work. Please, upgrade to the latest macOS version."; +export const XcodeDeprecationStringFormat = "The current Xcode version %s will not be supported in the next release of NativeScript. Consider updating your Xcode to latest official version."; + export const PROGRESS_PRIVACY_POLICY_URL = "https://www.progress.com/legal/privacy-policy"; export class SubscribeForNewsletterMessages { public static AgreeToReceiveEmailMsg = "I agree".green.bold + " to receive email communications from Progress Software in the form of the NativeScript Newsletter. Consent may be withdrawn at any time."; diff --git a/lib/services/ios-project-service.ts b/lib/services/ios-project-service.ts index 47dc9620de..efc873f680 100644 --- a/lib/services/ios-project-service.ts +++ b/lib/services/ios-project-service.ts @@ -54,7 +54,8 @@ export class IOSProjectService extends projectServiceBaseLib.PlatformProjectServ private $xcodebuildService: IXcodebuildService, private $iOSExtensionsService: IIOSExtensionsService, private $iOSWatchAppService: IIOSWatchAppService, - private $iOSNativeTargetService: IIOSNativeTargetService) { + private $iOSNativeTargetService: IIOSNativeTargetService, + private $sysInfo: ISysInfo) { super($fs, $projectDataService); } @@ -138,6 +139,12 @@ export class IOSProjectService extends projectServiceBaseLib.PlatformProjectServ notConfiguredEnvOptions }); + if (checkEnvironmentRequirementsOutput && checkEnvironmentRequirementsOutput.canExecute) { + const xcodeWarning = await this.$sysInfo.getXcodeWarning(); + if (xcodeWarning) { + this.$logger.warn(xcodeWarning); + } + } return { checkEnvironmentRequirementsOutput }; diff --git a/lib/sys-info.ts b/lib/sys-info.ts index a11dba1829..f0a04b3830 100644 --- a/lib/sys-info.ts +++ b/lib/sys-info.ts @@ -1,9 +1,10 @@ import * as path from "path"; import { format } from "util"; import { sysInfo } from "nativescript-doctor"; -import { MacOSVersions, MacOSDeprecationStringFormat } from "./constants"; +import { MacOSVersions, MacOSDeprecationStringFormat, XcodeDeprecationStringFormat } from "./constants"; import { getNodeWarning } from "./common/verify-node-version"; import { exported } from "./common/decorators"; +import * as semver from "semver"; export class SysInfo implements ISysInfo { private sysInfo: ISysInfoData = null; @@ -82,5 +83,15 @@ export class SysInfo implements ISysInfo { return null; } + + public async getXcodeWarning(): Promise { + const xcodeVersion = await this.getXcodeVersion(); + if (xcodeVersion && semver.lt(semver.coerce(xcodeVersion), "11.0.0")) { + const message = format(XcodeDeprecationStringFormat, xcodeVersion); + return message; + } + + return null; + } } $injector.register("sysInfo", SysInfo);