raphinesse opened a new pull request #1082:
URL: https://github.com/apache/cordova-android/pull/1082


   ### Motivation and Context
   <!-- Why is this change required? What problem does it solve? -->
   <!-- If it fixes an open issue, please link to the issue here. -->
   This change simplifies the code that determines on which target (device or 
emulator) the app should be installed and run on.
   
   This refactoring was triggered during a bigger refactoring (still WIP) that 
has the goal of doing something similar to 
https://github.com/apache/cordova-electron/pull/142 here.
   
   ### Description
   <!-- Describe your changes in detail -->
   The changes made here should not change the observable behavior of the code 
beyond changing what is logged to the console. The changes included are:
   
   - factor out `resolveInstallTarget` from `lib/run.run`
   - improve unit tests for the `lib/run` module
   - convert `resolveInstallTarget` to async/await
   - DRY logic in `resolveInstallTarget`
   
   The logic for selecting a install/run target is unchanged. Targets are tried 
to resolve in this order:
   
   - A connected device matching the given ID (if target ID given)
   - Any connected device (if `--emulator` option was not given)
   - A started emulator matching the given ID (if target ID given)
   - An existing emulator matching the given ID (will be started) (if target ID 
given)
   - An existing emulator that best matches the app's target API (will be 
started) (if `--device` option was not given)
   
   ### Testing
   <!-- Please describe in detail how you tested your changes. -->
   The unit tests for this module still pass.
   
   
   


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
[email protected]



---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to