From dfdb412e9184d9505a6cd75c207fc3b9aedff48e Mon Sep 17 00:00:00 2001 From: Goncharov Ilia Date: Fri, 14 Oct 2016 22:44:32 +0300 Subject: [PATCH 1/3] Added build options for .ipa generate --- index.js | 36 ++++++++++++++++++++++++++++++++++-- readme.md | 37 +++++++++++++++++++++++++++++++++++-- 2 files changed, 69 insertions(+), 4 deletions(-) diff --git a/index.js b/index.js index 3075de0..69d4aa7 100644 --- a/index.js +++ b/index.js @@ -10,6 +10,8 @@ var cordova = cordovaLib.raw; module.exports = function (options) { options = options || {}; + var device = options.device || true; + var release = options.release || false; return through.obj(function (file, enc, cb) { // Change the working directory @@ -20,7 +22,9 @@ module.exports = function (options) { cb(); }, function (cb) { - var exists = fs.existsSync(path.join(cordovaLib.findProjectRoot(), 'platforms', 'ios')); + var self = this; + var iosPath = path.join(cordovaLib.findProjectRoot(), 'platforms', 'ios'); + var exists = fs.existsSync(iosPath); Promise.resolve() .then(function () { @@ -36,10 +40,38 @@ module.exports = function (options) { } }) .then(function () { + var options = []; + + if (device) { + options.push('--device'); + } + if (release) { + options.push('--release'); + } + // Build the platform - return cordova.build({platforms: ['ios']}); + return cordova.build({platforms: ['ios'], options: options}); }) .then(function () { + var base = path.join(iosPath, 'build/device'); + var cwd = process.env.PWD; + + // Iterate over the output directory + fs.readdirSync(base).forEach(function (file) { + // Check if the file ends with .apk + if (file.indexOf('.ipa') !== -1) { + var filePath = path.join(base, file); + + // Push the file to the result set + self.push(new gutil.File({ + base: base, + cwd: cwd, + path: filePath, + contents: fs.readFileSync(path.join(base, file)) + })); + } + }); + cb(); }) .catch(function (err) { diff --git a/readme.md b/readme.md index 5bf23e7..db84d56 100644 --- a/readme.md +++ b/readme.md @@ -23,7 +23,8 @@ gulp.task('build', () => { .pipe(create()) .pipe(plugin('org.apache.cordova.dialogs')) .pipe(plugin('org.apache.cordova.camera')) - .pipe(ios()); + .pipe(ios()) + .pipe('ios'); }); ``` @@ -43,12 +44,44 @@ Default: `false` If the value is `true`, this will cause the ios platform to be removed and re-added. -#### version +##### version Type: `string` iOS platform version. +##### device + +Type: `boolean`
+Default: `true` + +If the value is `true`, this will build .ipa file as result. + +**You must provide build.json file in cordova project directory** + +```json +{ + "ios": { + "debug": { + "codeSignIdentitiy": "iPhone Developer", + "provisioningProfile": "your-dev-provisioning-profile-UUID-here" + }, + "release": { + "codeSignIdentitiy": "iPhone Distribution", + "provisioningProfile": "your-distribution-provisioning-profile-UUID-her" + } + } +} +``` + +To get the UUID I open the .mobileprovision file on a text editor and search for 'UUID', not sure if there is an easier way of finding it. + +##### release + +Type: `boolean`
+Default: `false` + +If the value is `true`, this will build .ipa and sign it with release certificates ## Related From b9f319012e24bc9196a8ba2a47407ed1b399557f Mon Sep 17 00:00:00 2001 From: Goncharov Ilia Date: Tue, 3 Jan 2017 21:19:35 +0300 Subject: [PATCH 2/3] Fix reviews notes --- index.js | 1 - readme.md | 4 ++-- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/index.js b/index.js index 69d4aa7..2dae870 100644 --- a/index.js +++ b/index.js @@ -58,7 +58,6 @@ module.exports = function (options) { // Iterate over the output directory fs.readdirSync(base).forEach(function (file) { - // Check if the file ends with .apk if (file.indexOf('.ipa') !== -1) { var filePath = path.join(base, file); diff --git a/readme.md b/readme.md index db84d56..0d0d331 100644 --- a/readme.md +++ b/readme.md @@ -73,8 +73,8 @@ If the value is `true`, this will build .ipa file as result. } } ``` - -To get the UUID I open the .mobileprovision file on a text editor and search for 'UUID', not sure if there is an easier way of finding it. +To get UUID execute in terminal - `/usr/libexec/PlistBuddy -c "Print UUID" /dev/stdin <<< $(security cms -D -i /path/to/file.mobileprovision)` or +open the .mobileprovision file on a text editor and search for 'UUID'. ##### release From eb2519840b048bd7d963cee75054e1f3b05f6913 Mon Sep 17 00:00:00 2001 From: Goncharov Ilia Date: Wed, 18 Oct 2017 13:19:28 +0300 Subject: [PATCH 3/3] Cordova 7.1.0 --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 9c68e4e..d40ab7b 100644 --- a/package.json +++ b/package.json @@ -27,7 +27,7 @@ "ios" ], "dependencies": { - "cordova-lib": "6.2.0", + "cordova-lib": "7.1.0", "gulp-util": "^3.0.4", "pinkie-promise": "^2.0.0", "through2": "^2.0.0"