Skip to content

Commit 2b55d33

Browse files
oliversalzburgChris Brody
authored and
Chris Brody
committed
emit xcodebuild & other spawned CLI commands (#479)
1 parent 6527275 commit 2b55d33

File tree

4 files changed

+9
-8
lines changed

4 files changed

+9
-8
lines changed

bin/templates/scripts/cordova/lib/Podfile.js

+1
Original file line numberDiff line numberDiff line change
@@ -385,6 +385,7 @@ Podfile.prototype.install = function (requirementsCheckerFunction) {
385385
var opts = {};
386386
opts.cwd = path.join(this.path, '..'); // parent path of this Podfile
387387
opts.stdio = 'pipe';
388+
opts.printCommand = true;
388389
var first = true;
389390
var self = this;
390391

bin/templates/scripts/cordova/lib/build.js

+2-2
Original file line numberDiff line numberDiff line change
@@ -171,7 +171,7 @@ module.exports.run = function (buildOpts) {
171171
shell.rm('-rf', buildOutputDir);
172172

173173
var xcodebuildArgs = getXcodeBuildArgs(projectName, projectPath, configuration, buildOpts.device, buildOpts.buildFlag, emulatorTarget, buildOpts.automaticProvisioning);
174-
return superspawn.spawn('xcodebuild', xcodebuildArgs, { cwd: projectPath });
174+
return superspawn.spawn('xcodebuild', xcodebuildArgs, { cwd: projectPath, printCommand: true });
175175

176176
}).then(function () {
177177
if (!buildOpts.device || buildOpts.noSign) {
@@ -224,7 +224,7 @@ module.exports.run = function (buildOpts) {
224224

225225
function packageArchive () {
226226
var xcodearchiveArgs = getXcodeArchiveArgs(projectName, projectPath, buildOutputDir, exportOptionsPath, buildOpts.automaticProvisioning);
227-
return superspawn.spawn('xcodebuild', xcodearchiveArgs, { cwd: projectPath });
227+
return superspawn.spawn('xcodebuild', xcodearchiveArgs, { cwd: projectPath, printCommand: true });
228228
}
229229

230230
return Q.nfcall(fs.writeFile, exportOptionsPath, exportOptionsPlist, 'utf-8')

bin/templates/scripts/cordova/lib/clean.js

+2-2
Original file line numberDiff line numberDiff line change
@@ -33,9 +33,9 @@ module.exports.run = function () {
3333
return Q.reject('No Xcode project found in ' + projectPath);
3434
}
3535

36-
return superspawn.spawn('xcodebuild', ['-project', projectName, '-configuration', 'Debug', '-alltargets', 'clean'], { cwd: projectPath })
36+
return superspawn.spawn('xcodebuild', ['-project', projectName, '-configuration', 'Debug', '-alltargets', 'clean'], { cwd: projectPath, printCommand: true })
3737
.then(function () {
38-
return superspawn.spawn('xcodebuild', ['-project', projectName, '-configuration', 'Release', '-alltargets', 'clean'], { cwd: projectPath });
38+
return superspawn.spawn('xcodebuild', ['-project', projectName, '-configuration', 'Release', '-alltargets', 'clean'], { cwd: projectPath, printCommand: true });
3939
}).then(function () {
4040
return shell.rm('-rf', path.join(projectPath, 'build'));
4141
});

bin/templates/scripts/cordova/lib/run.js

+4-4
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,7 @@ module.exports.run = function (runOptions) {
7979
var ipafile = path.join(buildOutputDir, projectName + '.ipa');
8080

8181
// unpack the existing platform/ios/build/device/appname.ipa (zipfile), will create a Payload folder
82-
return superspawn.spawn('unzip', [ '-o', '-qq', ipafile ], { cwd: buildOutputDir });
82+
return superspawn.spawn('unzip', [ '-o', '-qq', ipafile ], { cwd: buildOutputDir, printCommand: true });
8383
})
8484
.then(function () {
8585
// Uncompress IPA (zip file)
@@ -148,7 +148,7 @@ function filterSupportedArgs (args) {
148148
* @return {Promise} Fullfilled when any device is connected, rejected otherwise
149149
*/
150150
function checkDeviceConnected () {
151-
return superspawn.spawn('ios-deploy', ['-c', '-t', '1']);
151+
return superspawn.spawn('ios-deploy', ['-c', '-t', '1'], { printCommand: true });
152152
}
153153

154154
/**
@@ -160,9 +160,9 @@ function checkDeviceConnected () {
160160
function deployToDevice (appPath, target, extraArgs) {
161161
// Deploying to device...
162162
if (target) {
163-
return superspawn.spawn('ios-deploy', ['--justlaunch', '-d', '-b', appPath, '-i', target].concat(extraArgs));
163+
return superspawn.spawn('ios-deploy', ['--justlaunch', '-d', '-b', appPath, '-i', target].concat(extraArgs), { printCommand: true });
164164
} else {
165-
return superspawn.spawn('ios-deploy', ['--justlaunch', '--no-wifi', '-d', '-b', appPath].concat(extraArgs));
165+
return superspawn.spawn('ios-deploy', ['--justlaunch', '--no-wifi', '-d', '-b', appPath].concat(extraArgs), { printCommand: true });
166166
}
167167
}
168168

0 commit comments

Comments
 (0)