mirror of
https://github.com/apache/cordova-android.git
synced 2025-01-31 17:32:51 +08:00
CB-7321 Don't require ant for create script
This commit is contained in:
parent
4319447cb5
commit
95aa5c9f1c
@ -55,7 +55,7 @@ module.exports.get_target = function() {
|
||||
}
|
||||
}
|
||||
|
||||
// Returns a promise.
|
||||
// Returns a promise. Called only by build and clean commands.
|
||||
module.exports.check_ant = function() {
|
||||
return tryCommand('ant -version', 'Failed to run "ant -version", make sure you have ant installed and added to your PATH.');
|
||||
}
|
||||
@ -123,6 +123,6 @@ module.exports.check_android = function() {
|
||||
|
||||
// Returns a promise.
|
||||
module.exports.run = function() {
|
||||
return Q.all([this.check_ant(), this.check_java(), this.check_android()]);
|
||||
return Q.all([this.check_java(), this.check_android()]);
|
||||
}
|
||||
|
||||
|
6
bin/templates/cordova/lib/build.js
vendored
6
bin/templates/cordova/lib/build.js
vendored
@ -25,6 +25,7 @@ var shell = require('shelljs'),
|
||||
path = require('path'),
|
||||
fs = require('fs'),
|
||||
ROOT = path.join(__dirname, '..', '..');
|
||||
var check_reqs = require('./check_reqs');
|
||||
|
||||
|
||||
function hasCustomRules() {
|
||||
@ -60,9 +61,12 @@ module.exports.run = function(build_type) {
|
||||
return Q.reject('Build option \'' + build_type + '\' not recognized.');
|
||||
}
|
||||
// Without our custom_rules.xml, we need to clean before building.
|
||||
var ret = Q();
|
||||
var ret;
|
||||
if (!hasCustomRules()) {
|
||||
// clean will call check_ant() for us.
|
||||
ret = require('./clean').run();
|
||||
} else {
|
||||
ret = check_reqs.check_ant();
|
||||
}
|
||||
return ret.then(function() {
|
||||
return spawn('ant', args);
|
||||
|
6
bin/templates/cordova/lib/clean.js
vendored
6
bin/templates/cordova/lib/clean.js
vendored
@ -22,6 +22,7 @@
|
||||
var build = require('./build'),
|
||||
spawn = require('./spawn'),
|
||||
path = require('path');
|
||||
var check_reqs = require('./check_reqs');
|
||||
|
||||
/*
|
||||
* Cleans the project using ant
|
||||
@ -29,7 +30,10 @@ var build = require('./build'),
|
||||
*/
|
||||
module.exports.run = function() {
|
||||
var args = build.getAntArgs('clean');
|
||||
return spawn('ant', args);
|
||||
return check_reqs.check_ant()
|
||||
.then(function() {
|
||||
return spawn('ant', args);
|
||||
});
|
||||
}
|
||||
|
||||
module.exports.help = function() {
|
||||
|
Loading…
Reference in New Issue
Block a user