Skip to content

Commit e5f1b3a

Browse files
feat: deprecate support for Xcode 10 and below
As from March 2020 iOS apps will have to be built with Xcode 10 in order to be uploaded to AppStore, deprecate the support for Xcode 10 and below - CLI will show warning in case such Xcode is used.
1 parent d4c2bf0 commit e5f1b3a

File tree

4 files changed

+29
-2
lines changed

4 files changed

+29
-2
lines changed

lib/common/declarations.d.ts

+6
Original file line numberDiff line numberDiff line change
@@ -1046,6 +1046,12 @@ interface ISysInfo {
10461046
* @return {string} The range of supported Node.js versions.
10471047
*/
10481048
getSupportedNodeVersionRange(): string;
1049+
1050+
/**
1051+
* Gets warning message in case the currently installed Xcode will not be supported in next versions
1052+
* @returns {string}
1053+
*/
1054+
getXcodeWarning(): Promise<string>;
10491055
}
10501056

10511057
interface IHostInfo {

lib/constants.ts

+3
Original file line numberDiff line numberDiff line change
@@ -242,9 +242,12 @@ export class MacOSVersions {
242242
public static Sierra = "10.12";
243243
public static HighSierra = "10.13";
244244
public static Mojave = "10.14";
245+
public static Catalina = "10.15";
245246
}
246247

247248
export const MacOSDeprecationStringFormat = "NativeScript does not support macOS %s and some functionality may not work. Please, upgrade to the latest macOS version.";
249+
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.";
250+
248251
export const PROGRESS_PRIVACY_POLICY_URL = "https://www.progress.com/legal/privacy-policy";
249252
export class SubscribeForNewsletterMessages {
250253
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.";

lib/services/ios-project-service.ts

+8-1
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,8 @@ export class IOSProjectService extends projectServiceBaseLib.PlatformProjectServ
5454
private $xcodebuildService: IXcodebuildService,
5555
private $iOSExtensionsService: IIOSExtensionsService,
5656
private $iOSWatchAppService: IIOSWatchAppService,
57-
private $iOSNativeTargetService: IIOSNativeTargetService) {
57+
private $iOSNativeTargetService: IIOSNativeTargetService,
58+
private $sysInfo: ISysInfo) {
5859
super($fs, $projectDataService);
5960
}
6061

@@ -138,6 +139,12 @@ export class IOSProjectService extends projectServiceBaseLib.PlatformProjectServ
138139
notConfiguredEnvOptions
139140
});
140141

142+
if (checkEnvironmentRequirementsOutput && checkEnvironmentRequirementsOutput.canExecute) {
143+
const xcodeWarning = await this.$sysInfo.getXcodeWarning();
144+
if (xcodeWarning ) {
145+
this.$logger.warn(xcodeWarning);
146+
}
147+
}
141148
return {
142149
checkEnvironmentRequirementsOutput
143150
};

lib/sys-info.ts

+12-1
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,10 @@
11
import * as path from "path";
22
import { format } from "util";
33
import { sysInfo } from "nativescript-doctor";
4-
import { MacOSVersions, MacOSDeprecationStringFormat } from "./constants";
4+
import { MacOSVersions, MacOSDeprecationStringFormat, XcodeDeprecationStringFormat } from "./constants";
55
import { getNodeWarning } from "./common/verify-node-version";
66
import { exported } from "./common/decorators";
7+
import * as semver from "semver";
78

89
export class SysInfo implements ISysInfo {
910
private sysInfo: ISysInfoData = null;
@@ -82,5 +83,15 @@ export class SysInfo implements ISysInfo {
8283

8384
return null;
8485
}
86+
87+
public async getXcodeWarning(): Promise<string> {
88+
const xcodeVersion = await this.getXcodeVersion();
89+
if (xcodeVersion && semver.lt(semver.coerce(xcodeVersion), "11.0.0")) {
90+
const message = format(XcodeDeprecationStringFormat, xcodeVersion);
91+
return message;
92+
}
93+
94+
return null;
95+
}
8596
}
8697
$injector.register("sysInfo", SysInfo);

0 commit comments

Comments
 (0)