You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cordova.apache.org by ra...@apache.org on 2020/07/08 22:07:42 UTC

[cordova-android] branch master updated: chore: remove unused emulator.create_image and its dependencies (#1019)

This is an automated email from the ASF dual-hosted git repository.

raphinesse pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/cordova-android.git


The following commit(s) were added to refs/heads/master by this push:
     new d7790ca  chore: remove unused emulator.create_image and its dependencies (#1019)
d7790ca is described below

commit d7790ca8bc64d7658b7aaac55d597f30e6991069
Author: Raphael von der GrĂ¼n <ra...@gmail.com>
AuthorDate: Thu Jul 9 00:07:33 2020 +0200

    chore: remove unused emulator.create_image and its dependencies (#1019)
---
 bin/templates/cordova/lib/emulator.js | 43 -----------------------------------
 1 file changed, 43 deletions(-)

diff --git a/bin/templates/cordova/lib/emulator.js b/bin/templates/cordova/lib/emulator.js
index 928ad44..fb0a5b0 100644
--- a/bin/templates/cordova/lib/emulator.js
+++ b/bin/templates/cordova/lib/emulator.js
@@ -220,21 +220,6 @@ module.exports.list_started = function () {
     return Adb.devices({ emulators: true });
 };
 
-// Returns a promise.
-// TODO: we should remove this, there's a more robust method under android_sdk.js
-module.exports.list_targets = function () {
-    return execa('android', ['list', 'targets'], { cwd: os.tmpdir() }).then(({ stdout: output }) => {
-        var target_out = output.split('\n');
-        var targets = [];
-        for (var i = target_out.length; i >= 0; i--) {
-            if (target_out[i].match(/id:/)) {
-                targets.push(targets[i].split(' ')[1]);
-            }
-        }
-        return targets;
-    });
-};
-
 /*
  * Gets unused port for android emulator, between 5554 and 5584
  * Returns a promise.
@@ -372,34 +357,6 @@ module.exports.wait_for_boot = function (emulator_id, time_remaining) {
     });
 };
 
-/*
- * Create avd
- * TODO : Enter the stdin input required to complete the creation of an avd.
- * Returns a promise.
- */
-module.exports.create_image = function (name, target) {
-    console.log('Creating new avd named ' + name);
-    if (target) {
-        return execa('android', ['create', 'avd', '--name', name, '--target', target]).then(null, function (error) {
-            console.error('ERROR : Failed to create emulator image : ');
-            console.error(' Do you have the latest android targets including ' + target + '?');
-            console.error(error.message);
-        });
-    } 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 execa('android', ['create', 'avd', '--name', name, '--target', this.list_targets()[0]]).then(function () {
-            // TODO: This seems like another error case, even though it always happens.
-            console.error('ERROR : Unable to create an avd emulator, no targets found.');
-            console.error('Ensure you have targets available by running the "android" command');
-            return Promise.reject(new CordovaError());
-        }, function (error) {
-            console.error('ERROR : Failed to create emulator image : ');
-            console.error(error.message);
-        });
-    }
-};
-
 module.exports.resolveTarget = function (target) {
     return this.list_started().then(function (emulator_list) {
         if (emulator_list.length < 1) {


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@cordova.apache.org
For additional commands, e-mail: commits-help@cordova.apache.org