diff --git a/bin/templates/cordova/lib/build.js b/bin/templates/cordova/lib/build.js index 7e0df2f3..6336ecf5 100644 --- a/bin/templates/cordova/lib/build.js +++ b/bin/templates/cordova/lib/build.js @@ -74,7 +74,12 @@ 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 = path.join(ROOT, 'ant-build'); + var binDir = ''; + if(!hasCustomRules()) { + binDir = path.join(ROOT, 'bin'); + } else { + binDir = path.join(ROOT, 'ant-build'); + } if (fs.existsSync(binDir)) { var candidates = fs.readdirSync(binDir).filter(function(p) { // Need to choose between release and debug .apk. @@ -87,13 +92,13 @@ module.exports.get_apk = function() { a.t < b.t ? 1 : 0; }); if (candidates.length === 0) { - console.error('ERROR : No .apk found in \'ant-build\' directory'); + console.error('ERROR : No .apk found in ' + binDir + ' directory'); process.exit(2); } console.log('Using apk: ' + candidates[0].p); return candidates[0].p; } else { - console.error('ERROR : unable to find project ant-build directory, could not locate .apk'); + console.error('ERROR : unable to find project ' + binDir + ' directory, could not locate .apk'); process.exit(2); } }