mirror of
https://github.com/apache/cordova-android.git
synced 2026-05-11 00:00:05 +08:00
CB-3445: android: Copy Gradle wrapper from Android SDK rather than bundling a JAR
This commit is contained in:
@@ -24,6 +24,7 @@ var shell = require('shelljs'),
|
||||
Q = require('q'),
|
||||
path = require('path'),
|
||||
fs = require('fs'),
|
||||
which = require('which'),
|
||||
ROOT = path.join(__dirname, '..', '..');
|
||||
|
||||
// Get valid target from framework/project.properties
|
||||
@@ -40,6 +41,23 @@ module.exports.get_target = function() {
|
||||
}
|
||||
}
|
||||
|
||||
// Returns a promise.
|
||||
module.exports.sdk_dir = function() {
|
||||
var d = Q.defer();
|
||||
which('android', function(err, path) {
|
||||
if (err) {
|
||||
d.reject(new Error('ERROR: Cannot find Android SDK. android command not found.'));
|
||||
} else {
|
||||
var toolsDir = path.substring(0, path.lastIndexOf('/'));
|
||||
if (toolsDir.substring(toolsDir.length-6) != "/tools") {
|
||||
d.reject(new Error('ERROR: Cannot find Android SDK. android command not found in tools dir.'));
|
||||
}
|
||||
d.resolve(toolsDir.substring(0, toolsDir.length-6));
|
||||
}
|
||||
});
|
||||
return d.promise;
|
||||
};
|
||||
|
||||
// Returns a promise.
|
||||
module.exports.check_ant = function() {
|
||||
var d = Q.defer();
|
||||
|
||||
Reference in New Issue
Block a user