mirror of
https://github.com/apache/cordova-android.git
synced 2025-02-20 23:56:20 +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 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) {
|
||||
var target = images[i].target;
|
||||
if (target) {
|
||||
var num = target.split('(API level ')[1].replace(')', '');
|
||||
if (target && target.indexOf('API level') > -1) {
|
||||
var num = parseInt(target.split('(API level ')[1].replace(')', ''));
|
||||
if (num === project_target) {
|
||||
return images[i];
|
||||
} else if (project_target - num < closest && project_target > num) {
|
||||
|
@ -29,7 +29,7 @@
|
||||
"author": "Apache Software Foundation",
|
||||
"license": "Apache-2.0",
|
||||
"dependencies": {
|
||||
"android-versions": "^1.2.0",
|
||||
"android-versions": "^1.2.1",
|
||||
"cordova-common": "^2.1.0",
|
||||
"elementtree": "0.1.6",
|
||||
"nopt": "^3.0.1",
|
||||
@ -38,6 +38,7 @@
|
||||
"shelljs": "^0.5.3"
|
||||
},
|
||||
"bundledDependencies": [
|
||||
"android-versions",
|
||||
"cordova-common",
|
||||
"elementtree",
|
||||
"nopt",
|
||||
|
Loading…
Reference in New Issue
Block a user