Skip to content

Commit

Permalink
Merge pull request #8200 from cb1kenobi/timob-23650_6_0_X
Browse files Browse the repository at this point in the history
[TIMOB-23650] (6_0_X) Team id is now required in the tiapp.xml when building …
  • Loading branch information
cheekiatng committed Aug 15, 2016
2 parents c69c237 + 1d5e93c commit bd341bf
Show file tree
Hide file tree
Showing 28 changed files with 74 additions and 847 deletions.
1 change: 0 additions & 1 deletion android/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@
"version": "__VERSION__",
"author": "Appcelerator, Inc. <info@appcelerator.com>",
"maintainers": [
"Hieu Pham <hpham@appcelerator.com>",
"Chris Barber <cbarber@appcelerator.com>"
],
"minSDKVersion": "14",
Expand Down
78 changes: 57 additions & 21 deletions iphone/cli/commands/_build.js
Original file line number Diff line number Diff line change
Expand Up @@ -1448,7 +1448,6 @@ iOSBuilder.prototype.validate = function (logger, config, cli) {
}

var tiappTargets = {},
swiftRegExp = /\.swift$/,
proj = xcode.project(path.join(ext.projectPath, 'project.pbxproj')).parseSync();

// flag each target we care about
Expand Down Expand Up @@ -1808,26 +1807,35 @@ iOSBuilder.prototype.validate = function (logger, config, cli) {
},

function validateCapabilities() {
// check if we have any capabilities that we should need a team id
if (!this.tiapp.ios['team-id'] && Object.keys(this.tiapp.ios.capabilities).some(function (cap) { return this.tiapp.ios.capabilities[cap]; }, this)) {
logger.error(__('Found iOS capabilities in the tiapp.xml, but a <team-id> is not set.') + '\n');
if (Object.keys(this.xcodeEnv.teams).length) {
logger.log(__('Available teams:'));
Object.keys(this.xcodeEnv.teams).forEach(function (id) {
var team = this.xcodeEnv.teams[id];
logger.log(' ' + id.cyan + ' ' + team.name + ' - ' + team.type + (' (' + team.status + ')').grey);
}, this);
// check if we have any capabilities or if we're building with a watch app using Xcode 8 or newer that we should need a team id
if (!this.tiapp.ios['team-id']) {
var hasCapabilities = Object.keys(this.tiapp.ios.capabilities).some(function (cap) { return this.tiapp.ios.capabilities[cap]; }, this);
var hasWatchApp = this.hasWatchAppV2orNewer && version.gte(this.xcodeEnv.version, '8.0.0');
if (hasCapabilities || hasWatchApp) {
if (hasCapabilities) {
logger.error(__('Found iOS capabilities in the tiapp.xml, but a <team-id> is not set.') + '\n');
} else {
logger.error(__('Xcode %s requires Watch Extensions have a team specified, but a <team-id> is not set.', this.xcodeEnv.version) + '\n');
}

if (Object.keys(this.xcodeEnv.teams).length) {
logger.log(__('Available teams:'));
Object.keys(this.xcodeEnv.teams).forEach(function (id) {
var team = this.xcodeEnv.teams[id];
logger.log(' ' + id.cyan + ' ' + team.name + ' - ' + team.type + (' (' + team.status + ')').grey);
}, this);
logger.log();
} else {
logger.log(__('Log into the Apple Developer website and create a team, then add/refresh your account in Xcode\'s preferences window in order for Titanium to see your teams.') + '\n');
}
logger.log('<ti:app xmlns:ti="http://ti.appcelerator.org">'.grey);
logger.log(' <ios>'.grey);
logger.log(' <team-id>TEAM ID</team-id>'.magenta);
logger.log(' </ios>'.grey);
logger.log('</ti:app>'.grey);
logger.log();
} else {
logger.log(__('Log into the Apple Developer website and create a team, then add/refresh your account in Xcode\'s preferences window in order for Titanium to see your teams.') + '\n');
process.exit(1);
}
logger.log('<ti:app xmlns:ti="http://ti.appcelerator.org">'.grey);
logger.log(' <ios>'.grey);
logger.log(' <team-id>TEAM ID</team-id>'.magenta);
logger.log(' </ios>'.grey);
logger.log('</ti:app>'.grey);
logger.log();
process.exit(1);
}
},

Expand Down Expand Up @@ -1859,8 +1867,17 @@ iOSBuilder.prototype.validate = function (logger, config, cli) {
function determineMinIosVer() {
// figure out the min-ios-ver that this app is going to support
var defaultMinIosSdk = this.packageJson.minIosVersion;

if (version.gte(this.iosSdkVersion, '10.0') && version.lt(defaultMinIosSdk, '8.0')) {
defaultMinIosSdk = '8.0';
}

this.minIosVer = this.tiapp.ios['min-ios-ver'] || defaultMinIosSdk;
if (version.gte(this.iosSdkVersion, '6.0') && version.lt(this.minIosVer, defaultMinIosSdk)) {

if (version.gte(this.iosSdkVersion, '10.0') && version.lt(this.minIosVer, '8.0')) {
logger.warn(__('The %s of the iOS section in the tiapp.xml is lower than the recommended minimum iOS version %s', 'min-ios-ver', '8.0'));
logger.warn(__('Consider bumping the %s to at least %s', 'min-ios-ver', '8.0'));
} else if (version.gte(this.iosSdkVersion, '6.0') && version.lt(this.minIosVer, defaultMinIosSdk)) {
logger.info(__('Building for iOS %s; using %s as minimum iOS version', version.format(this.iosSdkVersion, 2).cyan, defaultMinIosSdk.cyan));
this.minIosVer = defaultMinIosSdk;
} else if (version.lt(this.minIosVer, defaultMinIosSdk)) {
Expand Down Expand Up @@ -2786,8 +2803,14 @@ iOSBuilder.prototype.createXcodeProject = function createXcodeProject(next) {
}, this);

// set the target-specific build settings
var legacySwift = version.lt(this.xcodeEnv.version, '8.0.0');
xobjs.XCConfigurationList[xobjs.PBXNativeTarget[mainTargetUuid].buildConfigurationList].buildConfigurations.forEach(function (buildConf) {
appc.util.mix(xobjs.XCBuildConfiguration[buildConf.value].buildSettings, buildSettings);
var bs = appc.util.mix(xobjs.XCBuildConfiguration[buildConf.value].buildSettings, buildSettings);
if (legacySwift) {
delete bs.ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES;
} else {
delete bs.EMBEDDED_CONTENT_CONTAINS_SWIFT;
}
});

// if the storyboard launch screen is disabled, remove it from the resources build phase
Expand Down Expand Up @@ -2894,6 +2917,8 @@ iOSBuilder.prototype.createXcodeProject = function createXcodeProject(next) {
if (this.extensions.length) {
this.logger.trace(__n('Adding %%d iOS extension', 'Adding %%d iOS extensions', this.extensions.length === 1 ? 1 : 2, this.extensions.length));

var swiftRegExp = /\.swift$/;

this.extensions.forEach(function (ext) {
var extObjs = ext.objs,
extPBXProject = ext.project;
Expand Down Expand Up @@ -3052,6 +3077,7 @@ iOSBuilder.prototype.createXcodeProject = function createXcodeProject(next) {
xobjs.PBXFileReference[productUuid + '_comment'] = extObjs.PBXFileReference[productUuid + '_comment'];

// add the groups and files
var hasSwiftFiles = false;
extObjs.PBXGroup[extPBXProject.mainGroup].children.some(function (child) {
if (child.comment !== target.name) return;

Expand All @@ -3073,6 +3099,9 @@ iOSBuilder.prototype.createXcodeProject = function createXcodeProject(next) {
if (extObjs.PBXFileReference[child.value]) {
xobjs.PBXFileReference[child.value] = extObjs.PBXFileReference[child.value];
xobjs.PBXFileReference[child.value + '_comment'] = extObjs.PBXFileReference[child.value + '_comment'];
if (!hasSwiftFiles && swiftRegExp.test(xobjs.PBXFileReference[child.value + '_comment'])) {
hasSwiftFiles = true;
}
}

if (extObjs.PBXVariantGroup && extObjs.PBXVariantGroup[child.value]) {
Expand All @@ -3081,6 +3110,9 @@ iOSBuilder.prototype.createXcodeProject = function createXcodeProject(next) {
varGroup.children && varGroup.children.forEach(function (child) {
xobjs.PBXFileReference[child.value] = extObjs.PBXFileReference[child.value];
xobjs.PBXFileReference[child.value + '_comment'] = extObjs.PBXFileReference[child.value + '_comment'];
if (!hasSwiftFiles && swiftRegExp.test(xobjs.PBXFileReference[child.value + '_comment'])) {
hasSwiftFiles = true;
}
});
}
});
Expand Down Expand Up @@ -3158,6 +3190,10 @@ iOSBuilder.prototype.createXcodeProject = function createXcodeProject(next) {
comment: entFile
});
}

if (hasSwiftFiles && !extBuildSettings.SWIFT_VERSION) {
extBuildSettings.SWIFT_VERSION = '2.2';
}
}, this);

if (targetInfo.isWatchAppV1Extension) {
Expand Down
2 changes: 2 additions & 0 deletions iphone/iphone/Titanium.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -2905,6 +2905,7 @@
isa = XCBuildConfiguration;
baseConfigurationReference = 241EAEC5118E2BA90081A5BE /* project.xcconfig */;
buildSettings = {
ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES = YES;
ALWAYS_SEARCH_USER_PATHS = NO;
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
ASSETCATALOG_COMPILER_LAUNCHIMAGE_NAME = LaunchImage;
Expand Down Expand Up @@ -2937,6 +2938,7 @@
isa = XCBuildConfiguration;
baseConfigurationReference = 241EAEC5118E2BA90081A5BE /* project.xcconfig */;
buildSettings = {
ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES = YES;
ALWAYS_SEARCH_USER_PATHS = NO;
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
ASSETCATALOG_COMPILER_LAUNCHIMAGE_NAME = LaunchImage;
Expand Down
11 changes: 4 additions & 7 deletions iphone/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,17 +13,14 @@
"version": "__VERSION__",
"author": "Appcelerator, Inc. <info@appcelerator.com>",
"maintainers": [
"Chris Barber <cbarber@appcelerator.com>",
"Vishal Duggal <vduggal@appcelerator.com>",
"Matt Langston <mlangston@appcelerator.com>",
"Sabil Rahim <srahim@appcelerator.com>"
"Chris Barber <cbarber@appcelerator.com>"
],
"minIosVersion": "7.1",
"minWatchosVersion": "1.0",
"vendorDependencies": {
"xcode": ">=6.0 <=7.x",
"ios sdk": ">=8.0 <=9.x",
"node": ">=4.0 <=5.x"
"xcode": ">=6.0 <=8.x",
"ios sdk": ">=8.0 <=10.x",
"node": ">=4.0 <=6.x"
},
"repository": {
"type": "git",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -339,7 +339,7 @@
SDKROOT = watchos;
SKIP_INSTALL = YES;
TARGETED_DEVICE_FAMILY = 4;
WATCHOS_DEPLOYMENT_TARGET = 2.0;
WATCHOS_DEPLOYMENT_TARGET = 2.2;
};
name = Debug;
};
Expand All @@ -354,7 +354,7 @@
SDKROOT = watchos;
SKIP_INSTALL = YES;
TARGETED_DEVICE_FAMILY = 4;
WATCHOS_DEPLOYMENT_TARGET = 2.0;
WATCHOS_DEPLOYMENT_TARGET = 2.2;
};
name = Release;
};
Expand All @@ -370,7 +370,7 @@
SDKROOT = watchos;
SKIP_INSTALL = YES;
TARGETED_DEVICE_FAMILY = 4;
WATCHOS_DEPLOYMENT_TARGET = 2.0;
WATCHOS_DEPLOYMENT_TARGET = 2.2;
};
name = Debug;
};
Expand All @@ -386,7 +386,7 @@
SDKROOT = watchos;
SKIP_INSTALL = YES;
TARGETED_DEVICE_FAMILY = 4;
WATCHOS_DEPLOYMENT_TARGET = 2.0;
WATCHOS_DEPLOYMENT_TARGET = 2.2;
};
name = Release;
};
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -333,8 +333,9 @@
PRODUCT_NAME = "${TARGET_NAME}";
SDKROOT = watchos;
SKIP_INSTALL = YES;
SWIFT_VERSION = 3.0;
TARGETED_DEVICE_FAMILY = 4;
WATCHOS_DEPLOYMENT_TARGET = 2.0;
WATCHOS_DEPLOYMENT_TARGET = 2.2;
};
name = Debug;
};
Expand All @@ -347,8 +348,9 @@
PRODUCT_NAME = "${TARGET_NAME}";
SDKROOT = watchos;
SKIP_INSTALL = YES;
SWIFT_VERSION = 3.0;
TARGETED_DEVICE_FAMILY = 4;
WATCHOS_DEPLOYMENT_TARGET = 2.0;
WATCHOS_DEPLOYMENT_TARGET = 2.2;
};
name = Release;
};
Expand All @@ -364,7 +366,7 @@
SDKROOT = watchos;
SKIP_INSTALL = YES;
TARGETED_DEVICE_FAMILY = 4;
WATCHOS_DEPLOYMENT_TARGET = 2.0;
WATCHOS_DEPLOYMENT_TARGET = 2.2;
};
name = Debug;
};
Expand All @@ -380,7 +382,7 @@
SDKROOT = watchos;
SKIP_INSTALL = YES;
TARGETED_DEVICE_FAMILY = 4;
WATCHOS_DEPLOYMENT_TARGET = 2.0;
WATCHOS_DEPLOYMENT_TARGET = 2.2;
};
name = Release;
};
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ class InterfaceController: WKInterfaceController, WCSessionDelegate {
}

@available(watchOS 2.2, *)
public func session(_ session: WCSession, activationDidCompleteWith activationState: WCSessionActivationState, error: NSError?) {
public func session(_ session: WCSession, activationDidCompleteWith activationState: WCSessionActivationState, error: Error?) {
// This will be called when the activation of a session finishes.
}

Expand Down

0 comments on commit bd341bf

Please sign in to comment.