Repository: cordova-ios Updated Branches: refs/heads/master c6587cffe -> c609c35c0
CB-11860 - Add post-archive step to unpack the .ipa Project: http://git-wip-us.apache.org/repos/asf/cordova-ios/repo Commit: http://git-wip-us.apache.org/repos/asf/cordova-ios/commit/70612218 Tree: http://git-wip-us.apache.org/repos/asf/cordova-ios/tree/70612218 Diff: http://git-wip-us.apache.org/repos/asf/cordova-ios/diff/70612218 Branch: refs/heads/master Commit: 7061221863d409110190f38353457c4314df7e9b Parents: 861cac8 Author: Shazron Abdullah <[email protected]> Authored: Fri Sep 30 13:02:37 2016 -0700 Committer: Darryl Pogue <[email protected]> Committed: Fri Sep 30 17:33:16 2016 -0700 ---------------------------------------------------------------------- bin/templates/scripts/cordova/lib/build.js | 28 ++++++++++++++++++++++++- 1 file changed, 27 insertions(+), 1 deletion(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/cordova-ios/blob/70612218/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 ee03891..e173235 100644 --- a/bin/templates/scripts/cordova/lib/build.js +++ b/bin/templates/scripts/cordova/lib/build.js @@ -116,8 +116,34 @@ module.exports.run = function (buildOpts) { return spawn('xcodebuild', xcodearchiveArgs, projectPath); } + function unpackIPA() { + var ipafile = path.join(buildOutputDir, projectName + '.ipa'); + + // unpack the existing platform/ios/build/device/appname.ipa (zipfile), will create a Payload folder + return spawn('unzip', [ '-o', '-qq', ipafile ], buildOutputDir); + } + + function moveApp() { + var appFileInflated = path.join(buildOutputDir, 'Payload', projectName + '.app'); + var appFile = path.join(buildOutputDir, projectName + '.app'); + var payloadFolder = path.join(buildOutputDir, 'Payload'); + + // delete the existing platform/ios/build/device/appname.app + return spawn('rm', [ '-rf', appFile ], buildOutputDir) + .then(function() { + // move the platform/ios/build/device/Payload/appname.app to parent + return spawn('mv', [ '-f', appFileInflated, buildOutputDir ], buildOutputDir); + }) + .then(function() { + // delete the platform/ios/build/device/Payload folder + return spawn('rm', [ '-rf', payloadFolder ], buildOutputDir); + }); + } + return Q.nfcall(fs.writeFile, exportOptionsPath, exportOptionsPlist, 'utf-8') - .then(packageArchive); + .then(packageArchive) + .then(unpackIPA) + .then(moveApp); }); }; --------------------------------------------------------------------- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
