Skip to content

feat: deprecate support for Xcode 10 and below #5227

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 2 commits into from
Jan 27, 2020
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
6 changes: 6 additions & 0 deletions lib/common/declarations.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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<string>;
}

interface IHostInfo {
Expand Down
3 changes: 3 additions & 0 deletions lib/constants.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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.";
Expand Down
9 changes: 8 additions & 1 deletion lib/services/ios-project-service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}

Expand Down Expand Up @@ -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
};
Expand Down
13 changes: 12 additions & 1 deletion lib/sys-info.ts
Original file line number Diff line number Diff line change
@@ -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;
Expand Down Expand Up @@ -82,5 +83,15 @@ export class SysInfo implements ISysInfo {

return null;
}

public async getXcodeWarning(): Promise<string> {
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);