mirror of
https://github.com/apache/cordova-android.git
synced 2026-02-21 00:02:46 +08:00
Compare commits
10 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
c0df73c3c1 | ||
|
|
211a7fc6a8 | ||
|
|
ce67804b65 | ||
|
|
f3ded26e35 | ||
|
|
4b688f8715 | ||
|
|
e3b3bcd75f | ||
|
|
5a7590397d | ||
|
|
af31c83ec1 | ||
|
|
bd94735ba2 | ||
|
|
46e47a3c5c |
@@ -20,6 +20,14 @@
|
||||
-->
|
||||
## Release Notes for Cordova (Android) ##
|
||||
|
||||
### 6.2.3 (May 2, 2017)
|
||||
* [CB-12640](https://issues.apache.org/jira/browse/CB-12640) better handling of unrecognized Android SDK commands on **Windows**.
|
||||
* [CB-12640](https://issues.apache.org/jira/browse/CB-12640) flipped avd parsing logic so that it always tries to use avdmanager to retrieve avds first, then falls back to android command if avdmanager cannot be found (and errors with ENOENT). updated tests - and added explicit tests to ensure to shell out to singular forms of sub-commands when executing `android`
|
||||
* [CB-12640](https://issues.apache.org/jira/browse/CB-12640) support for android sdk tools 26.0.1.
|
||||
|
||||
### 6.2.2 (Apr 24, 2017)
|
||||
* [CB-12697](https://issues.apache.org/jira/browse/CB-12697) Updated checked-in `node_modules`
|
||||
|
||||
### 6.2.1 (Apr 02, 2017)
|
||||
* [CB-12621](https://issues.apache.org/jira/browse/CB-12621) reverted elementtree dep to 0.1.6
|
||||
|
||||
|
||||
77
bin/templates/cordova/lib/android_sdk.js
vendored
77
bin/templates/cordova/lib/android_sdk.js
vendored
@@ -1,5 +1,3 @@
|
||||
|
||||
|
||||
/*
|
||||
Licensed to the Apache Software Foundation (ASF) under one
|
||||
or more contributor license agreements. See the NOTICE file
|
||||
@@ -68,65 +66,38 @@ module.exports.version_string_to_api_level = {
|
||||
'7.1.1': 25
|
||||
};
|
||||
|
||||
module.exports.list_targets_with_android = function() {
|
||||
return superspawn.spawn('android', ['list', 'targets'])
|
||||
.then(function(stdout) {
|
||||
var target_out = stdout.split('\n');
|
||||
var targets = [];
|
||||
for (var i = target_out.length - 1; i >= 0; i--) {
|
||||
if(target_out[i].match(/id:/)) {
|
||||
targets.push(target_out[i].match(/"(.+)"/)[1]);
|
||||
}
|
||||
function parse_targets(output) {
|
||||
var target_out = output.split('\n');
|
||||
var targets = [];
|
||||
for (var i = target_out.length - 1; i >= 0; i--) {
|
||||
if(target_out[i].match(/id:/)) { // if "id:" is in the line...
|
||||
targets.push(target_out[i].match(/"(.+)"/)[1]); //.. match whatever is in quotes.
|
||||
}
|
||||
return targets;
|
||||
});
|
||||
}
|
||||
return targets;
|
||||
}
|
||||
|
||||
module.exports.list_targets_with_android = function() {
|
||||
return superspawn.spawn('android', ['list', 'target'])
|
||||
.then(parse_targets);
|
||||
};
|
||||
|
||||
module.exports.list_targets_with_sdkmanager = function() {
|
||||
return superspawn.spawn('sdkmanager', ['--list'])
|
||||
.then(function(stdout) {
|
||||
var parsing_installed_packages = false;
|
||||
var lines = stdout.split('\n');
|
||||
var targets = [];
|
||||
for (var i = 0, l = lines.length; i < l; i++) {
|
||||
var line = lines[i];
|
||||
if (line.match(/Installed packages/)) {
|
||||
parsing_installed_packages = true;
|
||||
} else if (line.match(/Available Packages/) || line.match(/Available Updates/)) {
|
||||
// we are done working through installed packages, exit
|
||||
break;
|
||||
}
|
||||
if (parsing_installed_packages) {
|
||||
// Match stock android platform
|
||||
if (line.match(/platforms;android-\d+/)) {
|
||||
targets.push(line.match(/(android-\d+)/)[1]);
|
||||
}
|
||||
// Match Google APIs
|
||||
if (line.match(/addon-google_apis-google-\d+/)) {
|
||||
var description = lines[i + 1];
|
||||
// munge description to match output from old android sdk tooling
|
||||
var api_level = description.match(/Android (\d+)/); //[1];
|
||||
if (api_level) {
|
||||
targets.push('Google Inc.:Google APIs:' + api_level[1]);
|
||||
}
|
||||
}
|
||||
// TODO: match anything else?
|
||||
}
|
||||
}
|
||||
return targets;
|
||||
});
|
||||
module.exports.list_targets_with_avdmanager = function() {
|
||||
return superspawn.spawn('avdmanager', ['list', 'target'])
|
||||
.then(parse_targets);
|
||||
};
|
||||
|
||||
module.exports.list_targets = function() {
|
||||
return module.exports.list_targets_with_android()
|
||||
return module.exports.list_targets_with_avdmanager()
|
||||
.catch(function(err) {
|
||||
// there's a chance `android` no longer works.
|
||||
// lets see if `sdkmanager` is available and we can figure it out
|
||||
var avail_regex = /"?android"? command is no longer available/;
|
||||
if (err.code && ((err.stdout && err.stdout.match(avail_regex)) || (err.stderr && err.stderr.match(avail_regex)))) {
|
||||
return module.exports.list_targets_with_sdkmanager();
|
||||
// If there's an error, like avdmanager could not be found, we can try
|
||||
// as a last resort, to run `android`, in case this is a super old
|
||||
// SDK installation.
|
||||
if (err && (err.code == 'ENOENT' || (err.stderr && err.stderr.match(/not recognized/)))) {
|
||||
return module.exports.list_targets_with_android();
|
||||
} else throw err;
|
||||
}).then(function(targets) {
|
||||
})
|
||||
.then(function(targets) {
|
||||
if (targets.length === 0) {
|
||||
return Q.reject(new Error('No android targets (SDKs) installed!'));
|
||||
}
|
||||
|
||||
20
bin/templates/cordova/lib/emulator.js
vendored
20
bin/templates/cordova/lib/emulator.js
vendored
@@ -116,7 +116,7 @@ module.exports.list_images_using_avdmanager = function () {
|
||||
};
|
||||
|
||||
module.exports.list_images_using_android = function() {
|
||||
return superspawn.spawn('android', ['list', 'avds'])
|
||||
return superspawn.spawn('android', ['list', 'avd'])
|
||||
.then(function(output) {
|
||||
var response = output.split('\n');
|
||||
var emulator_list = [];
|
||||
@@ -171,20 +171,10 @@ module.exports.list_images_using_android = function() {
|
||||
}
|
||||
*/
|
||||
module.exports.list_images = function() {
|
||||
if (forgivingWhichSync('android')) {
|
||||
return module.exports.list_images_using_android()
|
||||
.catch(function(err) {
|
||||
// try to use `avdmanager` in case `android` reports it is no longer available.
|
||||
// this likely means the target machine is using a newer version of
|
||||
// the android sdk, and possibly `avdmanager` is available.
|
||||
if (err.code == 1 && err.stdout.indexOf('android command is no longer available')) {
|
||||
return module.exports.list_images_using_avdmanager();
|
||||
} else {
|
||||
throw err;
|
||||
}
|
||||
});
|
||||
} else if (forgivingWhichSync('avdmanager')) {
|
||||
if (forgivingWhichSync('avdmanager')) {
|
||||
return module.exports.list_images_using_avdmanager();
|
||||
} else if (forgivingWhichSync('android')) {
|
||||
return module.exports.list_images_using_android();
|
||||
} else {
|
||||
return Q().then(function() {
|
||||
throw new CordovaError('Could not find either `android` or `avdmanager` on your $PATH! Are you sure the Android SDK is installed and available?');
|
||||
@@ -228,6 +218,7 @@ module.exports.list_started = function() {
|
||||
};
|
||||
|
||||
// Returns a promise.
|
||||
// TODO: we should remove this, there's a more robust method under android_sdk.js
|
||||
module.exports.list_targets = function() {
|
||||
return superspawn.spawn('android', ['list', 'targets'], {cwd: os.tmpdir()})
|
||||
.then(function(output) {
|
||||
@@ -399,6 +390,7 @@ module.exports.create_image = function(name, target) {
|
||||
});
|
||||
} else {
|
||||
console.log('WARNING : Project target not found, creating avd with a different target but the project may fail to install.');
|
||||
// TODO: there's a more robust method for finding targets in android_sdk.js
|
||||
return superspawn.spawn('android', ['create', 'avd', '--name', name, '--target', this.list_targets()[0]])
|
||||
.then(function() {
|
||||
// TODO: This seems like another error case, even though it always happens.
|
||||
|
||||
@@ -20,7 +20,7 @@
|
||||
*/
|
||||
|
||||
// Coho updates this line:
|
||||
var VERSION = "6.2.2";
|
||||
var VERSION = "6.2.3";
|
||||
|
||||
module.exports.version = VERSION;
|
||||
|
||||
|
||||
14
bin/templates/project/assets/www/cordova.js
vendored
14
bin/templates/project/assets/www/cordova.js
vendored
@@ -1,5 +1,5 @@
|
||||
// Platform: android
|
||||
// 7c5fcc5a5adfbf3fb8ceaf36fbdd4bd970bd9c20
|
||||
// 7ef9f9c03167a4dde4372d869472241b6816fee9
|
||||
/*
|
||||
Licensed to the Apache Software Foundation (ASF) under one
|
||||
or more contributor license agreements. See the NOTICE file
|
||||
@@ -19,7 +19,7 @@
|
||||
under the License.
|
||||
*/
|
||||
;(function() {
|
||||
var PLATFORM_VERSION_BUILD_LABEL = '6.2.2';
|
||||
var PLATFORM_VERSION_BUILD_LABEL = '6.2.3';
|
||||
// file: src/scripts/require.js
|
||||
|
||||
/*jshint -W079 */
|
||||
@@ -330,7 +330,7 @@ module.exports = cordova;
|
||||
|
||||
});
|
||||
|
||||
// file: /Users/steveng/repo/cordova/cordova-android/cordova-js-src/android/nativeapiprovider.js
|
||||
// file: /Users/maj/src/cordova-android/cordova-js-src/android/nativeapiprovider.js
|
||||
define("cordova/android/nativeapiprovider", function(require, exports, module) {
|
||||
|
||||
/**
|
||||
@@ -353,7 +353,7 @@ module.exports = {
|
||||
|
||||
});
|
||||
|
||||
// file: /Users/steveng/repo/cordova/cordova-android/cordova-js-src/android/promptbasednativeapi.js
|
||||
// file: /Users/maj/src/cordova-android/cordova-js-src/android/promptbasednativeapi.js
|
||||
define("cordova/android/promptbasednativeapi", function(require, exports, module) {
|
||||
|
||||
/**
|
||||
@@ -886,7 +886,7 @@ module.exports = channel;
|
||||
|
||||
});
|
||||
|
||||
// file: /Users/steveng/repo/cordova/cordova-android/cordova-js-src/exec.js
|
||||
// file: /Users/maj/src/cordova-android/cordova-js-src/exec.js
|
||||
define("cordova/exec", function(require, exports, module) {
|
||||
|
||||
/**
|
||||
@@ -1649,7 +1649,7 @@ exports.reset();
|
||||
|
||||
});
|
||||
|
||||
// file: /Users/steveng/repo/cordova/cordova-android/cordova-js-src/platform.js
|
||||
// file: /Users/maj/src/cordova-android/cordova-js-src/platform.js
|
||||
define("cordova/platform", function(require, exports, module) {
|
||||
|
||||
// The last resume event that was received that had the result of a plugin call.
|
||||
@@ -1759,7 +1759,7 @@ function onMessageFromNative(msg) {
|
||||
|
||||
});
|
||||
|
||||
// file: /Users/steveng/repo/cordova/cordova-android/cordova-js-src/plugin/android/app.js
|
||||
// file: /Users/maj/src/cordova-android/cordova-js-src/plugin/android/app.js
|
||||
define("cordova/plugin/android/app", function(require, exports, module) {
|
||||
|
||||
var exec = require('cordova/exec');
|
||||
|
||||
@@ -40,7 +40,7 @@ apply plugin: 'com.github.dcendents.android-maven'
|
||||
apply plugin: 'com.jfrog.bintray'
|
||||
|
||||
group = 'org.apache.cordova'
|
||||
version = '6.2.2'
|
||||
version = '6.2.3'
|
||||
|
||||
android {
|
||||
compileSdkVersion cdvCompileSdkVersion
|
||||
@@ -127,9 +127,9 @@ bintray {
|
||||
licenses = ['Apache-2.0']
|
||||
labels = ['android', 'cordova', 'phonegap']
|
||||
version {
|
||||
name = '6.2.2'
|
||||
name = '6.2.3'
|
||||
released = new Date()
|
||||
vcsTag = '6.2.2'
|
||||
vcsTag = '6.2.3'
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -31,7 +31,7 @@ import android.webkit.WebChromeClient.CustomViewCallback;
|
||||
* are not expected to implement it.
|
||||
*/
|
||||
public interface CordovaWebView {
|
||||
public static final String CORDOVA_VERSION = "6.2.2";
|
||||
public static final String CORDOVA_VERSION = "6.2.3";
|
||||
|
||||
void init(CordovaInterface cordova, List<PluginEntry> pluginEntries, CordovaPreferences preferences);
|
||||
|
||||
|
||||
@@ -210,6 +210,11 @@ public class SystemWebViewEngine implements CordovaWebViewEngine {
|
||||
settings.setAppCachePath(databasePath);
|
||||
settings.setAppCacheEnabled(true);
|
||||
|
||||
// Enable scaling
|
||||
// Fix for CB-12015
|
||||
settings.setUseWideViewPort(true);
|
||||
settings.setLoadWithOverviewMode(true);
|
||||
|
||||
// Fix for CB-1405
|
||||
// Google issue 4641
|
||||
String defaultUserAgent = settings.getUserAgentString();
|
||||
|
||||
50
node_modules/big-integer/BigInteger.js
generated
vendored
50
node_modules/big-integer/BigInteger.js
generated
vendored
@@ -118,7 +118,7 @@ var bigInt = (function (undefined) {
|
||||
}
|
||||
|
||||
BigInteger.prototype.add = function (v) {
|
||||
var value, n = parseValue(v);
|
||||
var n = parseValue(v);
|
||||
if (this.sign !== n.sign) {
|
||||
return this.subtract(n.negate());
|
||||
}
|
||||
@@ -177,7 +177,7 @@ var bigInt = (function (undefined) {
|
||||
}
|
||||
|
||||
function subtractAny(a, b, sign) {
|
||||
var value, isSmall;
|
||||
var value;
|
||||
if (compareAbs(a, b) >= 0) {
|
||||
value = subtract(a,b);
|
||||
} else {
|
||||
@@ -326,7 +326,7 @@ var bigInt = (function (undefined) {
|
||||
}
|
||||
|
||||
BigInteger.prototype.multiply = function (v) {
|
||||
var value, n = parseValue(v),
|
||||
var n = parseValue(v),
|
||||
a = this.value, b = n.value,
|
||||
sign = this.sign !== n.sign,
|
||||
abs;
|
||||
@@ -826,23 +826,24 @@ var bigInt = (function (undefined) {
|
||||
BigInteger.prototype.modInv = function (n) {
|
||||
var t = bigInt.zero, newT = bigInt.one, r = parseValue(n), newR = this.abs(), q, lastT, lastR;
|
||||
while (!newR.equals(bigInt.zero)) {
|
||||
q = r.divide(newR);
|
||||
lastT = t;
|
||||
lastR = r;
|
||||
t = newT;
|
||||
r = newR;
|
||||
newT = lastT.subtract(q.multiply(newT));
|
||||
newR = lastR.subtract(q.multiply(newR));
|
||||
q = r.divide(newR);
|
||||
lastT = t;
|
||||
lastR = r;
|
||||
t = newT;
|
||||
r = newR;
|
||||
newT = lastT.subtract(q.multiply(newT));
|
||||
newR = lastR.subtract(q.multiply(newR));
|
||||
}
|
||||
if (!r.equals(1)) throw new Error(this.toString() + " and " + n.toString() + " are not co-prime");
|
||||
if (t.compare(0) === -1) {
|
||||
t = t.add(n);
|
||||
t = t.add(n);
|
||||
}
|
||||
if (this.isNegative()) {
|
||||
return t.negate();
|
||||
}
|
||||
return t;
|
||||
}
|
||||
};
|
||||
|
||||
SmallInteger.prototype.modInv = BigInteger.prototype.modInv;
|
||||
|
||||
BigInteger.prototype.next = function () {
|
||||
@@ -1036,8 +1037,7 @@ var bigInt = (function (undefined) {
|
||||
return low.add(typeof result === "number" ? new SmallInteger(result) : new BigInteger(result, false));
|
||||
}
|
||||
var parseBase = function (text, base) {
|
||||
var val = Integer[0], pow = Integer[1],
|
||||
length = text.length;
|
||||
var length = text.length;
|
||||
if (2 <= base && base <= 36) {
|
||||
if (length <= LOG_MAX_INT / Math.log(base)) {
|
||||
return new SmallInteger(parseInt(text, base));
|
||||
@@ -1059,13 +1059,17 @@ var bigInt = (function (undefined) {
|
||||
}
|
||||
else throw new Error(c + " is not a valid character");
|
||||
}
|
||||
digits.reverse();
|
||||
for (i = 0; i < digits.length; i++) {
|
||||
return parseBaseFromArray(digits, base, isNegative);
|
||||
};
|
||||
|
||||
function parseBaseFromArray(digits, base, isNegative) {
|
||||
var val = Integer[0], pow = Integer[1], i;
|
||||
for (i = digits.length - 1; i >= 0; i--) {
|
||||
val = val.add(digits[i].times(pow));
|
||||
pow = pow.times(base);
|
||||
}
|
||||
return isNegative ? val.negate() : val;
|
||||
};
|
||||
}
|
||||
|
||||
function stringify(digit) {
|
||||
var v = digit.value;
|
||||
@@ -1209,6 +1213,11 @@ var bigInt = (function (undefined) {
|
||||
Integer.lcm = lcm;
|
||||
Integer.isInstance = function (x) { return x instanceof BigInteger || x instanceof SmallInteger; };
|
||||
Integer.randBetween = randBetween;
|
||||
|
||||
Integer.fromArray = function (digits, base, isNegative) {
|
||||
return parseBaseFromArray(digits.map(parseValue), parseValue(base || 10), isNegative);
|
||||
};
|
||||
|
||||
return Integer;
|
||||
})();
|
||||
|
||||
@@ -1216,3 +1225,10 @@ var bigInt = (function (undefined) {
|
||||
if (typeof module !== "undefined" && module.hasOwnProperty("exports")) {
|
||||
module.exports = bigInt;
|
||||
}
|
||||
|
||||
//amd check
|
||||
if ( typeof define === "function" && define.amd ) {
|
||||
define( "big-integer", [], function() {
|
||||
return bigInt;
|
||||
});
|
||||
}
|
||||
|
||||
2
node_modules/big-integer/BigInteger.min.js
generated
vendored
2
node_modules/big-integer/BigInteger.min.js
generated
vendored
File diff suppressed because one or more lines are too long
7
node_modules/big-integer/README.md
generated
vendored
7
node_modules/big-integer/README.md
generated
vendored
@@ -421,6 +421,13 @@ Performs the bitwise XOR operation. The operands are treated as if they were rep
|
||||
|
||||
### Static Methods
|
||||
|
||||
#### `fromArray(digits, base = 10, isNegative?)`
|
||||
|
||||
Constructs a bigInt from an array of digits in base `base`. The optional `isNegative` flag will make the number negative.
|
||||
|
||||
- `bigInt.fromArray([1, 2, 3, 4, 5], 10)` => `12345`
|
||||
- `bigInt.fromArray([1, 0, 0], 2, true)` => `-4`
|
||||
|
||||
#### `gcd(a, b)`
|
||||
|
||||
Finds the greatest common denominator of `a` and `b`.
|
||||
|
||||
20
node_modules/big-integer/package.json
generated
vendored
20
node_modules/big-integer/package.json
generated
vendored
@@ -14,13 +14,13 @@
|
||||
]
|
||||
],
|
||||
"_from": "big-integer@>=1.6.7 <2.0.0",
|
||||
"_id": "big-integer@1.6.19",
|
||||
"_id": "big-integer@1.6.22",
|
||||
"_inCache": true,
|
||||
"_location": "/big-integer",
|
||||
"_nodeVersion": "6.9.4",
|
||||
"_npmOperationalInternal": {
|
||||
"host": "packages-12-west.internal.npmjs.com",
|
||||
"tmp": "tmp/big-integer-1.6.19.tgz_1491096256363_0.04815615131519735"
|
||||
"tmp": "tmp/big-integer-1.6.22.tgz_1493091323169_0.5048394540790468"
|
||||
},
|
||||
"_npmUser": {
|
||||
"name": "peterolson",
|
||||
@@ -40,8 +40,8 @@
|
||||
"_requiredBy": [
|
||||
"/bplist-parser"
|
||||
],
|
||||
"_resolved": "http://registry.npmjs.org/big-integer/-/big-integer-1.6.19.tgz",
|
||||
"_shasum": "4a5e915e3188c8708f254b356196f28542acc1e0",
|
||||
"_resolved": "https://registry.npmjs.org/big-integer/-/big-integer-1.6.22.tgz",
|
||||
"_shasum": "487c95fce886022ea48ff5f19e388932df46dd2e",
|
||||
"_shrinkwrap": null,
|
||||
"_spec": "big-integer@^1.6.7",
|
||||
"_where": "/Users/steveng/repo/cordova/cordova-android/node_modules/bplist-parser",
|
||||
@@ -63,17 +63,18 @@
|
||||
"karma": "^0.13.3",
|
||||
"karma-coverage": "^0.4.2",
|
||||
"karma-jasmine": "^0.3.6",
|
||||
"karma-phantomjs-launcher": "~0.1"
|
||||
"karma-phantomjs-launcher": "~0.1",
|
||||
"uglifyjs": "^2.4.10"
|
||||
},
|
||||
"directories": {},
|
||||
"dist": {
|
||||
"shasum": "4a5e915e3188c8708f254b356196f28542acc1e0",
|
||||
"tarball": "https://registry.npmjs.org/big-integer/-/big-integer-1.6.19.tgz"
|
||||
"shasum": "487c95fce886022ea48ff5f19e388932df46dd2e",
|
||||
"tarball": "https://registry.npmjs.org/big-integer/-/big-integer-1.6.22.tgz"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">=0.6"
|
||||
},
|
||||
"gitHead": "f0f751478d6623a84a5ed9618d94937829bbd015",
|
||||
"gitHead": "40483b881b4380931e5af6f2f8a161b6caa71690",
|
||||
"homepage": "https://github.com/peterolson/BigInteger.js#readme",
|
||||
"keywords": [
|
||||
"math",
|
||||
@@ -102,7 +103,8 @@
|
||||
"url": "git+ssh://git@github.com/peterolson/BigInteger.js.git"
|
||||
},
|
||||
"scripts": {
|
||||
"minify": "uglifyjs BigInteger.js -o BigInteger.min.js",
|
||||
"test": "karma start my.conf.js"
|
||||
},
|
||||
"version": "1.6.19"
|
||||
"version": "1.6.22"
|
||||
}
|
||||
|
||||
1
node_modules/brace-expansion/README.md
generated
vendored
1
node_modules/brace-expansion/README.md
generated
vendored
@@ -5,6 +5,7 @@ as known from sh/bash, in JavaScript.
|
||||
|
||||
[](http://travis-ci.org/juliangruber/brace-expansion)
|
||||
[](https://www.npmjs.org/package/brace-expansion)
|
||||
[](https://greenkeeper.io/)
|
||||
|
||||
[](https://ci.testling.com/juliangruber/brace-expansion)
|
||||
|
||||
|
||||
2
node_modules/brace-expansion/index.js
generated
vendored
2
node_modules/brace-expansion/index.js
generated
vendored
@@ -106,7 +106,7 @@ function expand(str, isTop) {
|
||||
var isNumericSequence = /^-?\d+\.\.-?\d+(?:\.\.-?\d+)?$/.test(m.body);
|
||||
var isAlphaSequence = /^[a-zA-Z]\.\.[a-zA-Z](?:\.\.-?\d+)?$/.test(m.body);
|
||||
var isSequence = isNumericSequence || isAlphaSequence;
|
||||
var isOptions = /^(.*,)+(.+)?$/.test(m.body);
|
||||
var isOptions = m.body.indexOf(',') >= 0;
|
||||
if (!isSequence && !isOptions) {
|
||||
// {a},b}
|
||||
if (m.post.match(/,.*\}/)) {
|
||||
|
||||
24
node_modules/brace-expansion/package.json
generated
vendored
24
node_modules/brace-expansion/package.json
generated
vendored
@@ -14,19 +14,19 @@
|
||||
]
|
||||
],
|
||||
"_from": "brace-expansion@>=1.0.0 <2.0.0",
|
||||
"_id": "brace-expansion@1.1.6",
|
||||
"_id": "brace-expansion@1.1.7",
|
||||
"_inCache": true,
|
||||
"_location": "/brace-expansion",
|
||||
"_nodeVersion": "4.4.7",
|
||||
"_nodeVersion": "7.8.0",
|
||||
"_npmOperationalInternal": {
|
||||
"host": "packages-16-east.internal.npmjs.com",
|
||||
"tmp": "tmp/brace-expansion-1.1.6.tgz_1469047715600_0.9362958471756428"
|
||||
"host": "packages-12-west.internal.npmjs.com",
|
||||
"tmp": "tmp/brace-expansion-1.1.7.tgz_1491552830231_0.7213963181711733"
|
||||
},
|
||||
"_npmUser": {
|
||||
"name": "juliangruber",
|
||||
"email": "julian@juliangruber.com"
|
||||
},
|
||||
"_npmVersion": "2.15.8",
|
||||
"_npmVersion": "4.2.0",
|
||||
"_phantomChildren": {},
|
||||
"_requested": {
|
||||
"raw": "brace-expansion@^1.0.0",
|
||||
@@ -40,8 +40,8 @@
|
||||
"_requiredBy": [
|
||||
"/minimatch"
|
||||
],
|
||||
"_resolved": "http://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.6.tgz",
|
||||
"_shasum": "7197d7eaa9b87e648390ea61fc66c84427420df9",
|
||||
"_resolved": "http://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.7.tgz",
|
||||
"_shasum": "3effc3c50e000531fb720eaff80f0ae8ef23cf59",
|
||||
"_shrinkwrap": null,
|
||||
"_spec": "brace-expansion@^1.0.0",
|
||||
"_where": "/Users/steveng/repo/cordova/cordova-android/node_modules/minimatch",
|
||||
@@ -59,14 +59,15 @@
|
||||
},
|
||||
"description": "Brace expansion as known from sh/bash",
|
||||
"devDependencies": {
|
||||
"matcha": "^0.7.0",
|
||||
"tape": "^4.6.0"
|
||||
},
|
||||
"directories": {},
|
||||
"dist": {
|
||||
"shasum": "7197d7eaa9b87e648390ea61fc66c84427420df9",
|
||||
"tarball": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.6.tgz"
|
||||
"shasum": "3effc3c50e000531fb720eaff80f0ae8ef23cf59",
|
||||
"tarball": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.7.tgz"
|
||||
},
|
||||
"gitHead": "791262fa06625e9c5594cde529a21d82086af5f2",
|
||||
"gitHead": "892512024872ca7680554be90f6e8ce065053372",
|
||||
"homepage": "https://github.com/juliangruber/brace-expansion",
|
||||
"keywords": [],
|
||||
"license": "MIT",
|
||||
@@ -89,6 +90,7 @@
|
||||
"url": "git://github.com/juliangruber/brace-expansion.git"
|
||||
},
|
||||
"scripts": {
|
||||
"bench": "matcha test/perf/bench.js",
|
||||
"gentest": "bash test/generate.sh",
|
||||
"test": "tape test/*.js"
|
||||
},
|
||||
@@ -108,5 +110,5 @@
|
||||
"android-browser/4.2..latest"
|
||||
]
|
||||
},
|
||||
"version": "1.1.6"
|
||||
"version": "1.1.7"
|
||||
}
|
||||
|
||||
7
node_modules/cordova-common/RELEASENOTES.md
generated
vendored
7
node_modules/cordova-common/RELEASENOTES.md
generated
vendored
@@ -20,6 +20,13 @@
|
||||
-->
|
||||
# Cordova-common Release Notes
|
||||
|
||||
### 2.0.2 (Apr 14, 2017)
|
||||
* [CB-11233](https://issues.apache.org/jira/browse/CB-11233) - Support installing frameworks into 'Embedded Binaries' section of the Xcode project
|
||||
* [CB-10438](https://issues.apache.org/jira/browse/CB-10438) - Install correct dependency version. Removed shell.remove, added pkg.json to dependency tests 1-3, and updated install.js (.replace) to fix tests in uninstall.spec.js and update to workw with jasmine 2.0
|
||||
* [CB-11120](https://issues.apache.org/jira/browse/CB-11120) - Allow short/display name in config.xml
|
||||
* [CB-11346](https://issues.apache.org/jira/browse/CB-11346) - Remove known platforms check
|
||||
* [CB-11977](https://issues.apache.org/jira/browse/CB-11977) - updated engines and enginescript for common, fetch, and serve
|
||||
|
||||
### 2.0.1 (Mar 09, 2017)
|
||||
* [CB-12557](https://issues.apache.org/jira/browse/CB-12557) add both stdout and stderr properties to the error object passed to superspawn reject handler.
|
||||
|
||||
|
||||
27
node_modules/cordova-common/package.json
generated
vendored
27
node_modules/cordova-common/package.json
generated
vendored
@@ -14,19 +14,19 @@
|
||||
]
|
||||
],
|
||||
"_from": "cordova-common@>=2.0.1 <3.0.0",
|
||||
"_id": "cordova-common@2.0.1",
|
||||
"_id": "cordova-common@2.0.2",
|
||||
"_inCache": true,
|
||||
"_location": "/cordova-common",
|
||||
"_nodeVersion": "6.9.4",
|
||||
"_nodeVersion": "4.7.3",
|
||||
"_npmOperationalInternal": {
|
||||
"host": "packages-18-east.internal.npmjs.com",
|
||||
"tmp": "tmp/cordova-common-2.0.1.tgz_1489432932737_0.5238456283695996"
|
||||
"host": "packages-12-west.internal.npmjs.com",
|
||||
"tmp": "tmp/cordova-common-2.0.2.tgz_1492453798445_0.6290795875247568"
|
||||
},
|
||||
"_npmUser": {
|
||||
"name": "filmaj",
|
||||
"email": "maj.fil@gmail.com"
|
||||
"name": "shazron",
|
||||
"email": "shazron@gmail.com"
|
||||
},
|
||||
"_npmVersion": "3.10.10",
|
||||
"_npmVersion": "2.15.11",
|
||||
"_phantomChildren": {},
|
||||
"_requested": {
|
||||
"raw": "cordova-common@^2.0.1",
|
||||
@@ -40,8 +40,8 @@
|
||||
"_requiredBy": [
|
||||
"/"
|
||||
],
|
||||
"_resolved": "http://registry.npmjs.org/cordova-common/-/cordova-common-2.0.1.tgz",
|
||||
"_shasum": "99af318d7cb8988047cfe37bb9f25ea881d52815",
|
||||
"_resolved": "http://registry.npmjs.org/cordova-common/-/cordova-common-2.0.2.tgz",
|
||||
"_shasum": "57467976b8afd5e0bd0a13111b66a420441601cb",
|
||||
"_shrinkwrap": null,
|
||||
"_spec": "cordova-common@^2.0.1",
|
||||
"_where": "/Users/steveng/repo/cordova/cordova-android",
|
||||
@@ -78,11 +78,12 @@
|
||||
},
|
||||
"directories": {},
|
||||
"dist": {
|
||||
"shasum": "99af318d7cb8988047cfe37bb9f25ea881d52815",
|
||||
"tarball": "https://registry.npmjs.org/cordova-common/-/cordova-common-2.0.1.tgz"
|
||||
"shasum": "57467976b8afd5e0bd0a13111b66a420441601cb",
|
||||
"tarball": "https://registry.npmjs.org/cordova-common/-/cordova-common-2.0.2.tgz"
|
||||
},
|
||||
"engineStrict": true,
|
||||
"engines": {
|
||||
"node": ">=0.9.9"
|
||||
"node": ">=4.0.0"
|
||||
},
|
||||
"license": "Apache-2.0",
|
||||
"main": "cordova-common.js",
|
||||
@@ -129,5 +130,5 @@
|
||||
"jshint": "jshint src && jshint spec",
|
||||
"test": "npm run jshint && npm run jasmine"
|
||||
},
|
||||
"version": "2.0.1"
|
||||
"version": "2.0.2"
|
||||
}
|
||||
|
||||
10
node_modules/cordova-common/src/ConfigParser/ConfigParser.js
generated
vendored
10
node_modules/cordova-common/src/ConfigParser/ConfigParser.js
generated
vendored
@@ -116,6 +116,16 @@ ConfigParser.prototype = {
|
||||
var el = findOrCreate(this.doc, 'name');
|
||||
el.text = name;
|
||||
},
|
||||
shortName: function() {
|
||||
return this.doc.find('name').attrib['short'] || this.name();
|
||||
},
|
||||
setShortName: function(shortname) {
|
||||
var el = findOrCreate(this.doc, 'name');
|
||||
if (!el.text) {
|
||||
el.text = shortname;
|
||||
}
|
||||
el.attrib['short'] = shortname;
|
||||
},
|
||||
description: function() {
|
||||
return getNodeTextSafe(this.doc.find('description'));
|
||||
},
|
||||
|
||||
2
node_modules/cordova-common/src/PluginInfo/PluginInfo.js
generated
vendored
2
node_modules/cordova-common/src/PluginInfo/PluginInfo.js
generated
vendored
@@ -108,6 +108,7 @@ function PluginInfo(dirname) {
|
||||
function _parseDependency(tag) {
|
||||
var dep =
|
||||
{ id : tag.attrib.id
|
||||
, version: tag.attrib.version || ''
|
||||
, url : tag.attrib.url || ''
|
||||
, subdir : tag.attrib.subdir || ''
|
||||
, commit : tag.attrib.commit
|
||||
@@ -318,6 +319,7 @@ function PluginInfo(dirname) {
|
||||
type: el.attrib.type,
|
||||
parent: el.attrib.parent,
|
||||
custom: isStrTrue(el.attrib.custom),
|
||||
embed: isStrTrue(el.attrib.embed),
|
||||
src: el.attrib.src,
|
||||
spec: el.attrib.spec,
|
||||
weak: isStrTrue(el.attrib.weak),
|
||||
|
||||
1
node_modules/cordova-common/src/events.js
generated
vendored
1
node_modules/cordova-common/src/events.js
generated
vendored
@@ -20,6 +20,7 @@
|
||||
var EventEmitter = require('events').EventEmitter;
|
||||
|
||||
var INSTANCE = new EventEmitter();
|
||||
INSTANCE.setMaxListeners(20);
|
||||
var EVENTS_RECEIVER;
|
||||
|
||||
module.exports = INSTANCE;
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "cordova-android",
|
||||
"version": "6.2.2",
|
||||
"version": "6.2.3",
|
||||
"description": "cordova-android release",
|
||||
"bin": {
|
||||
"create": "bin/create"
|
||||
|
||||
7
spec/fixtures/sdk25.3-avdmanager_list_target.txt
vendored
Normal file
7
spec/fixtures/sdk25.3-avdmanager_list_target.txt
vendored
Normal file
@@ -0,0 +1,7 @@
|
||||
Available Android targets:
|
||||
----------
|
||||
id: 1 or "android-25"
|
||||
Name: Android API 25
|
||||
Type: Platform
|
||||
API level: 25
|
||||
Revision: 3
|
||||
1137
spec/fixtures/sdkmanager_list.txt
vendored
1137
spec/fixtures/sdkmanager_list.txt
vendored
File diff suppressed because it is too large
Load Diff
@@ -26,10 +26,16 @@ var Q = require("q");
|
||||
|
||||
describe("android_sdk", function () {
|
||||
describe("list_targets_with_android", function() {
|
||||
it("should invoke `android` with the `list target` command and _not_ the `list targets` command, as the plural form is not supported in some Android SDK Tools versions", function() {
|
||||
var deferred = Q.defer();
|
||||
spyOn(superspawn, "spawn").and.returnValue(deferred.promise);
|
||||
android_sdk.list_targets_with_android();
|
||||
expect(superspawn.spawn).toHaveBeenCalledWith("android", ["list", "target"]);
|
||||
});
|
||||
it("should parse and return results from `android list targets` command", function(done) {
|
||||
var deferred = Q.defer();
|
||||
spyOn(superspawn, "spawn").and.returnValue(deferred.promise);
|
||||
deferred.resolve(fs.readFileSync(path.join("spec", "fixtures", "android_list_targets.txt"), "utf-8"));
|
||||
deferred.resolve(fs.readFileSync(path.join("spec", "fixtures", "sdk25.2-android_list_targets.txt"), "utf-8"));
|
||||
return android_sdk.list_targets_with_android()
|
||||
.then(function(list) {
|
||||
[ "Google Inc.:Google APIs:23",
|
||||
@@ -53,26 +59,14 @@ describe("android_sdk", function () {
|
||||
});
|
||||
});
|
||||
});
|
||||
describe("list_targets_with_sdkmanager", function() {
|
||||
it("should parse and return results from `sdkmanager --list` command", function(done) {
|
||||
describe("list_targets_with_avdmanager", function() {
|
||||
it("should parse and return results from `avdmanager list target` command", function(done) {
|
||||
var deferred = Q.defer();
|
||||
spyOn(superspawn, "spawn").and.returnValue(deferred.promise);
|
||||
deferred.resolve(fs.readFileSync(path.join("spec", "fixtures", "sdkmanager_list.txt"), "utf-8"));
|
||||
return android_sdk.list_targets_with_sdkmanager()
|
||||
deferred.resolve(fs.readFileSync(path.join("spec", "fixtures", "sdk25.3-avdmanager_list_target.txt"), "utf-8"));
|
||||
return android_sdk.list_targets_with_avdmanager()
|
||||
.then(function(list) {
|
||||
[ "Google Inc.:Google APIs:19",
|
||||
"Google Inc.:Google APIs:21",
|
||||
"Google Inc.:Google APIs:22",
|
||||
"Google Inc.:Google APIs:23",
|
||||
"Google Inc.:Google APIs:24",
|
||||
"android-19",
|
||||
"android-21",
|
||||
"android-22",
|
||||
"android-23",
|
||||
"android-24",
|
||||
"android-25" ].forEach(function(target) {
|
||||
expect(list).toContain(target);
|
||||
});
|
||||
expect(list).toContain("android-25");
|
||||
}).fail(function(err) {
|
||||
console.log(err);
|
||||
expect(err).toBeUndefined();
|
||||
@@ -82,32 +76,48 @@ describe("android_sdk", function () {
|
||||
});
|
||||
});
|
||||
describe("list_targets", function() {
|
||||
it("should parse Android SDK installed target information with `android` command first", function() {
|
||||
it("should parse Android SDK installed target information with `avdmanager` command first", function() {
|
||||
var deferred = Q.defer();
|
||||
var android_spy = spyOn(android_sdk, "list_targets_with_android").and.returnValue(deferred.promise);
|
||||
var avdmanager_spy = spyOn(android_sdk, "list_targets_with_avdmanager").and.returnValue(deferred.promise);
|
||||
android_sdk.list_targets();
|
||||
expect(android_spy).toHaveBeenCalled();
|
||||
expect(avdmanager_spy).toHaveBeenCalled();
|
||||
});
|
||||
it("should parse Android SDK installed target information with `avdmanager` command if list_targets_with_android fails due to `android` command being obsolete", function(done) {
|
||||
it("should parse Android SDK installed target information with `android` command if list_targets_with_avdmanager fails with ENOENT", function(done) {
|
||||
var deferred = Q.defer();
|
||||
spyOn(android_sdk, "list_targets_with_android").and.returnValue(deferred.promise);
|
||||
spyOn(android_sdk, "list_targets_with_avdmanager").and.returnValue(deferred.promise);
|
||||
deferred.reject({
|
||||
code: 1,
|
||||
stdout: "The android command is no longer available."
|
||||
code: "ENOENT"
|
||||
});
|
||||
var twoferred = Q.defer();
|
||||
twoferred.resolve(["target1"]);
|
||||
var sdkmanager_spy = spyOn(android_sdk, "list_targets_with_sdkmanager").and.returnValue(twoferred.promise);
|
||||
var avdmanager_spy = spyOn(android_sdk, "list_targets_with_android").and.returnValue(twoferred.promise);
|
||||
return android_sdk.list_targets()
|
||||
.then(function(targets) {
|
||||
expect(sdkmanager_spy).toHaveBeenCalled();
|
||||
expect(avdmanager_spy).toHaveBeenCalled();
|
||||
expect(targets[0]).toEqual("target1");
|
||||
done();
|
||||
});
|
||||
});
|
||||
it("should parse Android SDK installed target information with `android` command if list_targets_with_avdmanager fails with not-recognized error (Windows)", function(done) {
|
||||
var deferred = Q.defer();
|
||||
spyOn(android_sdk, "list_targets_with_avdmanager").and.returnValue(deferred.promise);
|
||||
deferred.reject({
|
||||
code: 1,
|
||||
stderr: "'avdmanager' is not recognized as an internal or external commmand,\r\noperable program or batch file.\r\n"
|
||||
});
|
||||
var twoferred = Q.defer();
|
||||
twoferred.resolve(["target1"]);
|
||||
var avdmanager_spy = spyOn(android_sdk, "list_targets_with_android").and.returnValue(twoferred.promise);
|
||||
return android_sdk.list_targets()
|
||||
.then(function(targets) {
|
||||
expect(avdmanager_spy).toHaveBeenCalled();
|
||||
expect(targets[0]).toEqual("target1");
|
||||
done();
|
||||
});
|
||||
});
|
||||
it("should throw an error if no Android targets were found.", function(done) {
|
||||
var deferred = Q.defer();
|
||||
spyOn(android_sdk, "list_targets_with_android").and.returnValue(deferred.promise);
|
||||
spyOn(android_sdk, "list_targets_with_avdmanager").and.returnValue(deferred.promise);
|
||||
deferred.resolve([]);
|
||||
return android_sdk.list_targets()
|
||||
.then(function(targets) {
|
||||
|
||||
@@ -16,8 +16,8 @@
|
||||
specific language governing permissions and limitations
|
||||
under the License.
|
||||
*/
|
||||
var cc = require("cordova-common");
|
||||
var emu = require("../../bin/templates/cordova/lib/emulator");
|
||||
var superspawn = require("cordova-common").superspawn;
|
||||
var Q = require("q");
|
||||
var fs = require("fs");
|
||||
var path = require("path");
|
||||
@@ -27,8 +27,8 @@ describe("emulator", function () {
|
||||
describe("list_images_using_avdmanager", function() {
|
||||
it("should properly parse details of SDK Tools 25.3.1 `avdmanager` output", function(done) {
|
||||
var deferred = Q.defer();
|
||||
spyOn(cc.superspawn, "spawn").and.returnValue(deferred.promise);
|
||||
deferred.resolve(fs.readFileSync(path.join("spec", "fixtures", "avdmanager_list_avd.txt"), "utf-8"));
|
||||
spyOn(superspawn, "spawn").and.returnValue(deferred.promise);
|
||||
deferred.resolve(fs.readFileSync(path.join("spec", "fixtures", "sdk25.3-avdmanager_list_avd.txt"), "utf-8"));
|
||||
return emu.list_images_using_avdmanager()
|
||||
.then(function(list) {
|
||||
expect(list).toBeDefined();
|
||||
@@ -44,10 +44,16 @@ describe("emulator", function () {
|
||||
});
|
||||
});
|
||||
describe("list_images_using_android", function() {
|
||||
it("should invoke `android` with the `list avd` command and _not_ the `list avds` command, as the plural form is not supported in some Android SDK Tools versions", function() {
|
||||
var deferred = Q.defer();
|
||||
spyOn(superspawn, "spawn").and.returnValue(deferred.promise);
|
||||
emu.list_images_using_android();
|
||||
expect(superspawn.spawn).toHaveBeenCalledWith("android", ["list", "avd"]);
|
||||
});
|
||||
it("should properly parse details of SDK Tools pre-25.3.1 `android list avd` output", function(done) {
|
||||
var deferred = Q.defer();
|
||||
spyOn(cc.superspawn, "spawn").and.returnValue(deferred.promise);
|
||||
deferred.resolve(fs.readFileSync(path.join("spec", "fixtures", "android_list_avd.txt"), "utf-8"));
|
||||
spyOn(superspawn, "spawn").and.returnValue(deferred.promise);
|
||||
deferred.resolve(fs.readFileSync(path.join("spec", "fixtures", "sdk25.2-android_list_avd.txt"), "utf-8"));
|
||||
return emu.list_images_using_android()
|
||||
.then(function(list) {
|
||||
expect(list).toBeDefined();
|
||||
@@ -70,41 +76,30 @@ describe("emulator", function () {
|
||||
return cmd;
|
||||
});
|
||||
});
|
||||
it("should try to parse AVD information using `android`", function() {
|
||||
it("should try to parse AVD information using `avdmanager` first", function() {
|
||||
spyOn(shelljs, "which").and.callFake(function(cmd) {
|
||||
if (cmd == "android") {
|
||||
if (cmd == "avdmanager") {
|
||||
return true;
|
||||
} else {
|
||||
return false;
|
||||
}
|
||||
});
|
||||
var android_spy = spyOn(emu, "list_images_using_android").and.returnValue({catch:function(){}});
|
||||
emu.list_images();
|
||||
expect(android_spy).toHaveBeenCalled();
|
||||
});
|
||||
it("should catch if `android` exits with non-zero code and specific stdout, and delegate to `avdmanager` if it can find it", function() {
|
||||
spyOn(shelljs, "which").and.callFake(function(cmd) {
|
||||
if (cmd == "android") {
|
||||
return true;
|
||||
} else {
|
||||
return false;
|
||||
}
|
||||
});
|
||||
var avdmanager_spy = spyOn(emu, "list_images_using_avdmanager");
|
||||
// Fake out the old promise to feign a failed `android` command
|
||||
spyOn(emu, "list_images_using_android").and.returnValue({
|
||||
catch:function(cb) {
|
||||
cb({
|
||||
code: 1,
|
||||
stdout: ["The android command is no longer available.",
|
||||
"For manual SDK and AVD management, please use Android Studio.",
|
||||
"For command-line tools, use tools/bin/sdkmanager and tools/bin/avdmanager"].join("\n")
|
||||
});
|
||||
}
|
||||
});
|
||||
var avdmanager_spy = spyOn(emu, "list_images_using_avdmanager").and.returnValue({catch:function(){}});
|
||||
emu.list_images();
|
||||
expect(avdmanager_spy).toHaveBeenCalled();
|
||||
});
|
||||
it("should delegate to `android` if `avdmanager` cant be found and `android` can", function() {
|
||||
spyOn(shelljs, "which").and.callFake(function(cmd) {
|
||||
if (cmd == "avdmanager") {
|
||||
return false;
|
||||
} else {
|
||||
return true;
|
||||
}
|
||||
});
|
||||
var android_spy = spyOn(emu, "list_images_using_android");
|
||||
emu.list_images();
|
||||
expect(android_spy).toHaveBeenCalled();
|
||||
});
|
||||
it("should throw an error if neither `avdmanager` nor `android` are able to be found", function(done) {
|
||||
spyOn(shelljs, "which").and.returnValue(false);
|
||||
return emu.list_images()
|
||||
|
||||
Reference in New Issue
Block a user