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 2018/02/27 04:56:13 UTC

[cordova-ios] branch master updated: CB-13523: Pass automaticProvisioning to build step (#358)

This is an automated email from the ASF dual-hosted git repository.

shazron pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/cordova-ios.git


The following commit(s) were added to refs/heads/master by this push:
     new 28e7ac1  CB-13523: Pass automaticProvisioning to build step (#358)
28e7ac1 is described below

commit 28e7ac1474163c8a43e6adf5474da6298a4e0afa
Author: Darryl Pogue <dv...@gmail.com>
AuthorDate: Mon Feb 26 20:56:10 2018 -0800

    CB-13523: Pass automaticProvisioning to build step (#358)
---
 bin/templates/scripts/cordova/lib/build.js |  9 +++++++--
 tests/spec/unit/build.spec.js              | 23 +++++++++++++++++++++++
 2 files changed, 30 insertions(+), 2 deletions(-)

diff --git a/bin/templates/scripts/cordova/lib/build.js b/bin/templates/scripts/cordova/lib/build.js
index b68262e..b102152 100644
--- a/bin/templates/scripts/cordova/lib/build.js
+++ b/bin/templates/scripts/cordova/lib/build.js
@@ -171,7 +171,7 @@ module.exports.run = function (buildOpts) {
             // remove the build/device folder before building
             return spawn('rm', [ '-rf', buildOutputDir ], projectPath)
                 .then(function () {
-                    var xcodebuildArgs = getXcodeBuildArgs(projectName, projectPath, configuration, buildOpts.device, buildOpts.buildFlag, emulatorTarget);
+                    var xcodebuildArgs = getXcodeBuildArgs(projectName, projectPath, configuration, buildOpts.device, buildOpts.buildFlag, emulatorTarget, buildOpts.automaticProvisioning);
                     return spawn('xcodebuild', xcodebuildArgs, projectPath);
                 });
 
@@ -268,9 +268,10 @@ module.exports.findXCodeProjectIn = findXCodeProjectIn;
  * @param  {Boolean} isDevice       Flag that specify target for package (device/emulator)
  * @param  {Array}   buildFlags
  * @param  {String}  emulatorTarget Target for emulator (rather than default)
+ * @param  {Boolean} autoProvisioning   Whether to allow Xcode to automatically update provisioning
  * @return {Array}                  Array of arguments that could be passed directly to spawn method
  */
-function getXcodeBuildArgs (projectName, projectPath, configuration, isDevice, buildFlags, emulatorTarget) {
+function getXcodeBuildArgs (projectName, projectPath, configuration, isDevice, buildFlags, emulatorTarget, autoProvisioning) {
     var xcodebuildArgs;
     var options;
     var buildActions;
@@ -307,6 +308,10 @@ function getXcodeBuildArgs (projectName, projectPath, configuration, isDevice, b
         if (customArgs.sdk) {
             customArgs.otherFlags = customArgs.otherFlags.concat(['-sdk', customArgs.sdk]);
         }
+
+        if (autoProvisioning) {
+            options = options.concat(['-allowProvisioningUpdates']);
+        }
     } else { // emulator
         options = [
             '-xcconfig', customArgs.xcconfig || path.join(__dirname, '..', 'build-' + configuration.toLowerCase() + '.xcconfig'),
diff --git a/tests/spec/unit/build.spec.js b/tests/spec/unit/build.spec.js
index 4b12336..df53042 100644
--- a/tests/spec/unit/build.spec.js
+++ b/tests/spec/unit/build.spec.js
@@ -181,6 +181,29 @@ describe('build', function () {
             expect(args.length).toEqual(17);
             done();
         });
+
+        it('should generate appropriate args for automatic provisioning', function (done) {
+            var isDevice = true;
+            var args = getXcodeBuildArgs('TestProjectName', testProjectPath, 'TestConfiguration', isDevice, null, null, true);
+            expect(args[0]).toEqual('-xcconfig');
+            expect(args[1]).toEqual(path.join('/test', 'build-testconfiguration.xcconfig'));
+            expect(args[2]).toEqual('-workspace');
+            expect(args[3]).toEqual('TestProjectName.xcworkspace');
+            expect(args[4]).toEqual('-scheme');
+            expect(args[5]).toEqual('TestProjectName');
+            expect(args[6]).toEqual('-configuration');
+            expect(args[7]).toEqual('TestConfiguration');
+            expect(args[8]).toEqual('-destination');
+            expect(args[9]).toEqual('generic/platform=iOS');
+            expect(args[10]).toEqual('-archivePath');
+            expect(args[11]).toEqual('TestProjectName.xcarchive');
+            expect(args[12]).toEqual('-allowProvisioningUpdates');
+            expect(args[13]).toEqual('archive');
+            expect(args[14]).toEqual('CONFIGURATION_BUILD_DIR=' + path.join(testProjectPath, 'build', 'device'));
+            expect(args[15]).toEqual('SHARED_PRECOMPS_DIR=' + path.join(testProjectPath, 'build', 'sharedpch'));
+            expect(args.length).toEqual(16);
+            done();
+        });
     });
 
     describe('getXcodeArchiveArgs method', function () {

-- 
To stop receiving notification emails like this one, please contact
shazron@apache.org.

---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@cordova.apache.org
For additional commands, e-mail: commits-help@cordova.apache.org