mirror of
https://github.com/apache/cordova-android.git
synced 2025-02-26 03:53:09 +08:00
CB-13404: add android-versions to bundledDependencies. Ignore best emulator selection when parsed AVD information does not include API level in the target
This commit is contained in:
parent
6fa16b615b
commit
1f12fdbeea
6
bin/templates/cordova/lib/emulator.js
vendored
6
bin/templates/cordova/lib/emulator.js
vendored
@ -207,11 +207,11 @@ module.exports.best_image = function () {
|
|||||||
|
|
||||||
var closest = 9999;
|
var closest = 9999;
|
||||||
var best = images[0];
|
var best = images[0];
|
||||||
var project_target = check_reqs.get_target().replace('android-', '');
|
var project_target = parseInt(check_reqs.get_target().replace('android-', ''));
|
||||||
for (var i in images) {
|
for (var i in images) {
|
||||||
var target = images[i].target;
|
var target = images[i].target;
|
||||||
if (target) {
|
if (target && target.indexOf('API level') > -1) {
|
||||||
var num = target.split('(API level ')[1].replace(')', '');
|
var num = parseInt(target.split('(API level ')[1].replace(')', ''));
|
||||||
if (num === project_target) {
|
if (num === project_target) {
|
||||||
return images[i];
|
return images[i];
|
||||||
} else if (project_target - num < closest && project_target > num) {
|
} else if (project_target - num < closest && project_target > num) {
|
||||||
|
@ -29,7 +29,7 @@
|
|||||||
"author": "Apache Software Foundation",
|
"author": "Apache Software Foundation",
|
||||||
"license": "Apache-2.0",
|
"license": "Apache-2.0",
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"android-versions": "^1.2.0",
|
"android-versions": "^1.2.1",
|
||||||
"cordova-common": "^2.1.0",
|
"cordova-common": "^2.1.0",
|
||||||
"elementtree": "0.1.6",
|
"elementtree": "0.1.6",
|
||||||
"nopt": "^3.0.1",
|
"nopt": "^3.0.1",
|
||||||
@ -38,6 +38,7 @@
|
|||||||
"shelljs": "^0.5.3"
|
"shelljs": "^0.5.3"
|
||||||
},
|
},
|
||||||
"bundledDependencies": [
|
"bundledDependencies": [
|
||||||
|
"android-versions",
|
||||||
"cordova-common",
|
"cordova-common",
|
||||||
"elementtree",
|
"elementtree",
|
||||||
"nopt",
|
"nopt",
|
||||||
|
Loading…
Reference in New Issue
Block a user