diff --git a/bin/lib/create.js b/bin/lib/create.js index dbdb84f3..1ddab04b 100755 --- a/bin/lib/create.js +++ b/bin/lib/create.js @@ -89,7 +89,9 @@ function runAndroidUpdate(projectPath, target_api, shared) { function copyAntRules(projectPath) { var srcDir = path.join(ROOT, 'bin', 'templates', 'project'); - shell.cp('-f', path.join(srcDir, 'custom_rules.xml'), projectPath); + if (fs.existsSync(path.join(srcDir, 'custom_rules.xml'))) { + shell.cp('-f', path.join(srcDir, 'custom_rules.xml'), projectPath); + } } function copyScripts(projectPath) { diff --git a/bin/templates/cordova/lib/build.js b/bin/templates/cordova/lib/build.js index 9e5172cc..5f100e21 100644 --- a/bin/templates/cordova/lib/build.js +++ b/bin/templates/cordova/lib/build.js @@ -28,9 +28,6 @@ var shell = require('shelljs'), ROOT = path.join(__dirname, '..', '..'); -function hasCustomRules() { - return fs.existsSync(path.join(ROOT, 'custom_rules.xml')); -} module.exports.getAntArgs = function(cmd) { var args = [cmd, '-f', path.join(ROOT, 'build.xml')]; try { @@ -39,10 +36,6 @@ module.exports.getAntArgs = function(cmd) { } catch(e) { // Can't find android; don't push arg: assume all is okay } - // custom_rules.xml is required for incremental builds. - if (hasCustomRules()) { - args.push('-Dout.dir=ant-build', '-Dgen.absolute.dir=ant-gen'); - } return args; }; @@ -66,11 +59,7 @@ module.exports.run = function(build_type) { default : return Q.reject('Build option \'' + build_type + '\' not recognized.'); } - // Without our custom_rules.xml, we need to clean before building. var ret = Q(); - if (!hasCustomRules()) { - ret = require('./clean').run(); - } return ret.then(function() { return spawn('ant', args); }); @@ -81,12 +70,7 @@ module.exports.run = function(build_type) { * the script will error out. (should we error or just return undefined?) */ module.exports.get_apk = function() { - var binDir = ''; - if(!hasCustomRules()) { - binDir = path.join(ROOT, 'bin'); - } else { - binDir = path.join(ROOT, 'ant-build'); - } + var binDir = path.join(ROOT, 'bin'); if (fs.existsSync(binDir)) { var candidates = fs.readdirSync(binDir).filter(function(p) { // Need to choose between release and debug .apk. @@ -117,4 +101,4 @@ module.exports.help = function() { console.log(' \'--release\': will build project using ant release'); console.log(' \'--nobuild\': will skip build process (can be used with run command)'); process.exit(0); -} +}; diff --git a/bin/templates/project/custom_rules.xml b/bin/templates/project/custom_rules.xml deleted file mode 100644 index 4b20e221..00000000 --- a/bin/templates/project/custom_rules.xml +++ /dev/null @@ -1,21 +0,0 @@ - - - - - - - - - - - - - - - - - - - - -