You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cordova.apache.org by sh...@apache.org on 2015/04/22 23:29:52 UTC
[1/2] ios commit: CB-8485 Support for signed archive for iOS (closes
#138)
Repository: cordova-ios
Updated Branches:
refs/heads/4.0.x 5162e1dfe -> 96ffa30de
CB-8485 Support for signed archive for iOS (closes #138)
Project: http://git-wip-us.apache.org/repos/asf/cordova-ios/repo
Commit: http://git-wip-us.apache.org/repos/asf/cordova-ios/commit/f3dfb92b
Tree: http://git-wip-us.apache.org/repos/asf/cordova-ios/tree/f3dfb92b
Diff: http://git-wip-us.apache.org/repos/asf/cordova-ios/diff/f3dfb92b
Branch: refs/heads/4.0.x
Commit: f3dfb92bd8bdd5c2d85336b2bb992e59a6b6ce20
Parents: 078a47f
Author: Nikhil Khandelwal <ni...@microsoft.com>
Authored: Mon Apr 20 21:57:31 2015 -0700
Committer: Shazron Abdullah <sh...@apache.org>
Committed: Wed Apr 22 14:22:10 2015 -0700
----------------------------------------------------------------------
.../scripts/cordova/build-debug.xcconfig | 3 +-
.../scripts/cordova/build-extras.xcconfig | 22 ++++++
.../scripts/cordova/build-release.xcconfig | 4 +-
bin/templates/scripts/cordova/lib/build.js | 79 ++++++++++++++++++--
4 files changed, 98 insertions(+), 10 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/cordova-ios/blob/f3dfb92b/bin/templates/scripts/cordova/build-debug.xcconfig
----------------------------------------------------------------------
diff --git a/bin/templates/scripts/cordova/build-debug.xcconfig b/bin/templates/scripts/cordova/build-debug.xcconfig
index 85748ea..124d020 100644
--- a/bin/templates/scripts/cordova/build-debug.xcconfig
+++ b/bin/templates/scripts/cordova/build-debug.xcconfig
@@ -21,4 +21,5 @@
// XCode Build settings for "Debug" Build Configuration.
//
-#include "build.xcconfig"
\ No newline at end of file
+#include "build.xcconfig"
+#include "build-extras.xcconfig"
http://git-wip-us.apache.org/repos/asf/cordova-ios/blob/f3dfb92b/bin/templates/scripts/cordova/build-extras.xcconfig
----------------------------------------------------------------------
diff --git a/bin/templates/scripts/cordova/build-extras.xcconfig b/bin/templates/scripts/cordova/build-extras.xcconfig
new file mode 100644
index 0000000..7e63111
--- /dev/null
+++ b/bin/templates/scripts/cordova/build-extras.xcconfig
@@ -0,0 +1,22 @@
+//
+// Licensed to the Apache Software Foundation (ASF) under one
+// or more contributor license agreements. See the NOTICE file
+// distributed with this work for additional information
+// regarding copyright ownership. The ASF licenses this file
+// to you under the Apache License, Version 2.0 (the
+// "License"); you may not use this file except in compliance
+// with the License. You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing,
+// software distributed under the License is distributed on an
+// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+// KIND, either express or implied. See the License for the
+// specific language governing permissions and limitations
+// under the License.
+//
+
+//
+// Auto-generated config file to override configuration files (build-release/build-debug).
+//
http://git-wip-us.apache.org/repos/asf/cordova-ios/blob/f3dfb92b/bin/templates/scripts/cordova/build-release.xcconfig
----------------------------------------------------------------------
diff --git a/bin/templates/scripts/cordova/build-release.xcconfig b/bin/templates/scripts/cordova/build-release.xcconfig
index 6169afd..674aa79 100644
--- a/bin/templates/scripts/cordova/build-release.xcconfig
+++ b/bin/templates/scripts/cordova/build-release.xcconfig
@@ -24,4 +24,6 @@
#include "build.xcconfig"
CODE_SIGN_IDENTITY = iPhone Distribution
-CODE_SIGN_IDENTITY[sdk=iphoneos*] = iPhone Distribution
\ No newline at end of file
+CODE_SIGN_IDENTITY[sdk=iphoneos*] = iPhone Distribution
+
+#include "build-extras.xcconfig"
http://git-wip-us.apache.org/repos/asf/cordova-ios/blob/f3dfb92b/bin/templates/scripts/cordova/lib/build.js
----------------------------------------------------------------------
diff --git a/bin/templates/scripts/cordova/lib/build.js b/bin/templates/scripts/cordova/lib/build.js
index 153a4ec..2213ef8 100644
--- a/bin/templates/scripts/cordova/lib/build.js
+++ b/bin/templates/scripts/cordova/lib/build.js
@@ -24,9 +24,11 @@ var Q = require('q'),
path = require('path'),
shell = require('shelljs'),
spawn = require('./spawn'),
- check_reqs = require('./check_reqs');
+ check_reqs = require('./check_reqs'),
+ fs = require('fs');
var projectPath = path.join(__dirname, '..', '..');
+var projectName = null;
module.exports.run = function (argv) {
@@ -36,6 +38,10 @@ module.exports.run = function (argv) {
'release': Boolean,
'device': Boolean,
'emulator': Boolean,
+ 'codeSignIdentity': String,
+ 'codeSignResourceRules': String,
+ 'provisioningProfile': String,
+ 'buildConfig' : String
}, {'-r': '--release'}, argv);
if (args.debug && args.release) {
@@ -45,10 +51,42 @@ module.exports.run = function (argv) {
if (args.device && args.emulator) {
return Q.reject('Only one of "device"/"emulator" options should be specified');
}
+
+ if(args.buildConfig) {
+ if(!fs.existsSync(args.buildConfig)) {
+ return Q.reject('Build config file does not exist:' + args.buildConfig);
+ }
+ console.log('Reading build config file:', path.resolve(args.buildConfig));
+ var buildConfig = JSON.parse(fs.readFileSync(args.buildConfig, 'utf-8'));
+ if(buildConfig.ios) {
+ var buildType = args.release ? 'release' : 'debug';
+ var config = buildConfig.ios[buildType];
+ if(config) {
+ ['codeSignIdentity', 'codeSignResourceRules', 'provisioningProfile'].forEach(
+ function(key) {
+ args[key] = args[key] || config[key];
+ });
+ }
+ }
+ }
return check_reqs.run().then(function () {
return findXCodeProjectIn(projectPath);
- }).then(function (projectName) {
+ }).then(function (name) {
+ projectName = name;
+ var extraConfig = '';
+ if (args.codeSignIdentity) {
+ extraConfig += 'CODE_SIGN_IDENTITY = ' + args.codeSignIdentity + '\n';
+ extraConfig += 'CODE_SIGN_IDENTITY[sdk=iphoneos*] = ' + args.codeSignIdentity + '\n';
+ }
+ if (args.codeSignResourceRules) {
+ extraConfig += 'CODE_SIGN_RESOURCE_RULES_PATH = ' + args.codeSignResourceRules + '\n';
+ }
+ if (args.provisioningProfile) {
+ extraConfig += 'PROVISIONING_PROFILE = ' + args.provisioningProfile + '\n';
+ }
+ return Q.nfcall(fs.writeFile, path.join(__dirname, '..', 'build-extras.xcconfig'), extraConfig, 'utf-8');
+ }).then(function () {
var configuration = args.release ? 'Release' : 'Debug';
console.log('Building project : ' + path.join(projectPath, projectName + '.xcodeproj'));
@@ -57,6 +95,23 @@ module.exports.run = function (argv) {
var xcodebuildArgs = getXcodeArgs(projectName, projectPath, configuration, args.device);
return spawn('xcodebuild', xcodebuildArgs, projectPath);
+ }).then(function () {
+ if (!args.device) {
+ return;
+ }
+ var buildOutputDir = path.join(projectPath, 'build', 'device');
+ var pathToApp = path.join(buildOutputDir, projectName + '.app');
+ var pathToIpa = path.join(buildOutputDir, projectName + '.ipa');
+ var xcRunArgs = ['-sdk', 'iphoneos', 'PackageApplication',
+ '-v', pathToApp,
+ '-o', pathToIpa];
+ if (args.codeSignIdentity) {
+ xcRunArgs.concat('--sign', args.codeSignIdentity);
+ }
+ if (args.provisioningProfile) {
+ xcRunArgs.concat('--embed', args.provisioningProfile);
+ }
+ return spawn('xcrun', xcRunArgs, projectPath);
});
};
@@ -128,19 +183,27 @@ function getXcodeArgs(projectName, projectPath, configuration, isDevice) {
// help/usage function
module.exports.help = function help() {
console.log('');
- console.log('Usage: build [ --debug | --release ] [--archs=\"<list of architectures...>\"] [--device | --simulator]');
- console.log(' --help : Displays this dialog.');
- console.log(' --debug : Builds project in debug mode. (Default)');
- console.log(' --release : Builds project in release mode.');
- console.log(' -r : Shortcut :: builds project in release mode.');
+ console.log('Usage: build [--debug | --release] [--archs=\"<list of architectures...>\"]');
+ console.log(' [--device | --simulator] [--codeSignIdentity=\"<identity>\"]');
+ console.log(' [--codeSignResourceRules=\"<resourcerules path>\"]');
+ console.log(' [--provisioningProfile=\"<provisioning profile>\"]');
+ console.log(' --help : Displays this dialog.');
+ console.log(' --debug : Builds project in debug mode. (Default)');
+ console.log(' --release : Builds project in release mode.');
+ console.log(' -r : Shortcut :: builds project in release mode.');
// TODO: add support for building different archs
// console.log(" --archs : Builds project binaries for specific chip architectures (`anycpu`, `arm`, `x86`, `x64`).");
console.log(' --device, --simulator');
- console.log(' : Specifies, what type of project to build');
+ console.log(' : Specifies, what type of project to build');
+ console.log(' --codeSignIdentity : Type of signing identity used for code signing.');
+ console.log(' --codeSignResourceRules : Path to ResourceRules.plist.');
+ console.log(' --provisioningProfile : UUID of the profile.');
+ console.log('');
console.log('examples:');
console.log(' build ');
console.log(' build --debug');
console.log(' build --release');
+ console.log(' build --codeSignIdentity="iPhone Distribution" --provisioningProfile="926c2bd6-8de9-4c2f-8407-1016d2d12954"');
// TODO: add support for building different archs
// console.log(" build --release --archs=\"armv7\"");
console.log('');
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@cordova.apache.org
For additional commands, e-mail: commits-help@cordova.apache.org
[2/2] ios commit: Merge branch 'master' into 4.0.x
Posted by sh...@apache.org.
Merge branch 'master' into 4.0.x
Project: http://git-wip-us.apache.org/repos/asf/cordova-ios/repo
Commit: http://git-wip-us.apache.org/repos/asf/cordova-ios/commit/96ffa30d
Tree: http://git-wip-us.apache.org/repos/asf/cordova-ios/tree/96ffa30d
Diff: http://git-wip-us.apache.org/repos/asf/cordova-ios/diff/96ffa30d
Branch: refs/heads/4.0.x
Commit: 96ffa30de4783c0fbe0ae28616ee79f4494387ae
Parents: 5162e1d f3dfb92
Author: Shazron Abdullah <sh...@apache.org>
Authored: Wed Apr 22 14:29:39 2015 -0700
Committer: Shazron Abdullah <sh...@apache.org>
Committed: Wed Apr 22 14:29:39 2015 -0700
----------------------------------------------------------------------
.../scripts/cordova/build-debug.xcconfig | 3 +-
.../scripts/cordova/build-extras.xcconfig | 22 ++++++
.../scripts/cordova/build-release.xcconfig | 4 +-
bin/templates/scripts/cordova/lib/build.js | 79 ++++++++++++++++++--
4 files changed, 98 insertions(+), 10 deletions(-)
----------------------------------------------------------------------
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@cordova.apache.org
For additional commands, e-mail: commits-help@cordova.apache.org