CB-11860 - Remove build/device folder before building

Project: http://git-wip-us.apache.org/repos/asf/cordova-ios/repo
Commit: http://git-wip-us.apache.org/repos/asf/cordova-ios/commit/c609c35c
Tree: http://git-wip-us.apache.org/repos/asf/cordova-ios/tree/c609c35c
Diff: http://git-wip-us.apache.org/repos/asf/cordova-ios/diff/c609c35c

Branch: refs/heads/master
Commit: c609c35c03629dc38cde960b1ae957553008f712
Parents: 7061221
Author: Shazron Abdullah <[email protected]>
Authored: Mon Oct 3 19:07:12 2016 -0700
Committer: Darryl Pogue <[email protected]>
Committed: Tue Oct 4 10:19:36 2016 -0700

----------------------------------------------------------------------
 bin/templates/scripts/cordova/lib/build.js | 11 +++++++++--
 1 file changed, 9 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cordova-ios/blob/c609c35c/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 e173235..cfe017e 100644
--- a/bin/templates/scripts/cordova/lib/build.js
+++ b/bin/templates/scripts/cordova/lib/build.js
@@ -89,8 +89,15 @@ module.exports.run = function (buildOpts) {
         events.emit('log','\tConfiguration: ' + configuration);
         events.emit('log','\tPlatform: ' + (buildOpts.device ? 'device' : 
'emulator'));
 
-        var xcodebuildArgs = getXcodeBuildArgs(projectName, projectPath, 
configuration, buildOpts.device);
-        return spawn('xcodebuild', xcodebuildArgs, projectPath);
+        var buildOutputDir = path.join(projectPath, 'build', 'device');
+
+        // remove the build/device folder before building
+        return spawn('rm', [ '-rf', buildOutputDir ], projectPath)
+        .then(function() {
+            var xcodebuildArgs = getXcodeBuildArgs(projectName, projectPath, 
configuration, buildOpts.device);
+            return spawn('xcodebuild', xcodebuildArgs, projectPath);
+        });
+
     }).then(function () {
         if (!buildOpts.device || buildOpts.noSign) {
             return;


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to