You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@cordova.apache.org by filmaj <gi...@git.apache.org> on 2017/03/08 17:24:02 UTC

[GitHub] cordova-android pull request #366: CB-12546: More robust support spawning th...

GitHub user filmaj opened a pull request:

    https://github.com/apache/cordova-android/pull/366

    CB-12546: More robust support spawning the emulator with newer Android SDK

    <!--
    Please make sure the checklist boxes are all checked before submitting the PR. The checklist
    is intended as a quick reference, for complete details please see our Contributor Guidelines:
    
    http://cordova.apache.org/contribute/contribute_guidelines.html
    
    Thanks!
    -->
    
    ### Platforms affected
    
    Android
    
    ### What does this PR do?
    
    Two things related to starting emulator:
    
    1. Adds more versatile support for the changing structure of the Android SDK. In particular, if spawning the `android` command exits with a non-zero status code (as it does in SDK Tools 25.3.1), attempts to use `avdmanager` and massages its output to conform to the old output of `android list avd`.
    2. Ensures to spawn the emulator with a `cwd` parameter, to workaround the SDK bug described here: https://code.google.com/p/android/issues/detail?id=235461
    
    ### What testing has been done on this change?
    
    Not enough! Unfortunately, I cannot downgrade my Android SDK to test that this works on older SDK versions. Thus why I attempted not to change any of the old logic leveraging the `android` binary, and rather just built support for the new SDK on top of the old one, trying to use feature / failure detection along the way.
    
    ### Checklist
    - [X] [CB-12546](https://issues.apache.org/jira/browse/CB-12546)
    - [X] Commit message follows the format: "CB-3232: (android) Fix bug with resolving file paths", where CB-xxxx is the JIRA ID & "android" is the platform affected.
    - [ ] Added automated test coverage as appropriate for this change.


You can merge this pull request into a Git repository by running:

    $ git pull https://github.com/filmaj/cordova-android CB-12546

Alternatively you can review and apply these changes as the patch at:

    https://github.com/apache/cordova-android/pull/366.patch

To close this pull request, make a commit to your master/trunk branch
with (at least) the following in the commit message:

    This closes #366
    
----
commit 73f28541abf9bd372cb2a5402e2ac3b326c15b94
Author: filmaj <ma...@gmail.com>
Date:   2017-03-08T01:04:11Z

    CB-12546: start of work on parsing emulator info from `avdmanager` output. work in progress.

commit 8fc099b8f1b4f7bfb748eb6655d6cd1d0aa3dbdf
Author: filmaj <ma...@gmail.com>
Date:   2017-03-08T17:12:44Z

    CB-12546: tweak parsing of `avdmanager` output to match the old output from `android list avd`. also explicitly set the CWD of the spawned emulator process to workaround a recent google android sdk bug.

----


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

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


[GitHub] cordova-android issue #366: CB-12546: More robust support spawning the emula...

Posted by filmaj <gi...@git.apache.org>.
Github user filmaj commented on the issue:

    https://github.com/apache/cordova-android/pull/366
  
    Ah, I forgot to ping you: please review @infil00p 


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

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


[GitHub] cordova-android issue #366: CB-12546: More robust support spawning the emula...

Posted by filmaj <gi...@git.apache.org>.
Github user filmaj commented on the issue:

    https://github.com/apache/cordova-android/pull/366
  
    OK I've rebased and tweaked based on some upcoming changes I'm prepping for CB-12554.
    
    @infil00p can you review one more time, please?


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

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


[GitHub] cordova-android issue #366: CB-12546: More robust support spawning the emula...

Posted by filmaj <gi...@git.apache.org>.
Github user filmaj commented on the issue:

    https://github.com/apache/cordova-android/pull/366
  
    OK, I had to add more robust support for automatically adding the location of the `avdmanager` and `sdkmanager` binaries to the PATH, and I broke the tests once more. At this point, I'm changing the behaviour so much that I don't feel comfortable pushing further updates to this without getting tests for this.
    
    I am going to look at test coverage for this today.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

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


[GitHub] cordova-android issue #366: CB-12546: More robust support spawning the emula...

Posted by filmaj <gi...@git.apache.org>.
Github user filmaj commented on the issue:

    https://github.com/apache/cordova-android/pull/366
  
    Alright @infil00p, fixed that up. Please review, thanks!


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

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


[GitHub] cordova-android issue #366: CB-12546: More robust support spawning the emula...

Posted by filmaj <gi...@git.apache.org>.
Github user filmaj commented on the issue:

    https://github.com/apache/cordova-android/pull/366
  
    I see. I will take a look at it on my Windows VM.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

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


[GitHub] cordova-android issue #366: CB-12546: More robust support spawning the emula...

Posted by filmaj <gi...@git.apache.org>.
Github user filmaj commented on the issue:

    https://github.com/apache/cordova-android/pull/366
  
    @infil00p OK, I'll try to get to the bottom of that. I'll ping you once more when I do.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

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


[GitHub] cordova-android issue #366: CB-12546: More robust support spawning the emula...

Posted by infil00p <gi...@git.apache.org>.
Github user infil00p commented on the issue:

    https://github.com/apache/cordova-android/pull/366
  
    This doesn't work in Windows, so there's still work to be done.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

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


[GitHub] cordova-android issue #366: CB-12546: More robust support spawning the emula...

Posted by codecov-io <gi...@git.apache.org>.
Github user codecov-io commented on the issue:

    https://github.com/apache/cordova-android/pull/366
  
    # [Codecov](https://codecov.io/gh/apache/cordova-android/pull/366?src=pr&el=h1) Report
    > Merging [#366](https://codecov.io/gh/apache/cordova-android/pull/366?src=pr&el=desc) into [master](https://codecov.io/gh/apache/cordova-android/commit/7d5afdebe1d3d1ecf1ca22473fbb798bc70f49ad?src=pr&el=desc) will **decrease** coverage by `1.5%`.
    > The diff coverage is `12.28%`.
    
    
    ```diff
    @@            Coverage Diff             @@
    ##           master     #366      +/-   ##
    ==========================================
    - Coverage   35.58%   34.08%   -1.51%     
    ==========================================
      Files          12       13       +1     
      Lines        1037     1112      +75     
      Branches      173      188      +15     
    ==========================================
    + Hits          369      379      +10     
    - Misses        668      733      +65
    ```
    
    
    | [Impacted Files](https://codecov.io/gh/apache/cordova-android/pull/366?src=pr&el=tree) | Coverage \u0394 | |
    |---|---|---|
    | [bin/templates/cordova/lib/emulator.js](https://codecov.io/gh/apache/cordova-android/compare/7d5afdebe1d3d1ecf1ca22473fbb798bc70f49ad...edb9b81eb7d4a7dc5f4fa61c3aec819d296a05e3?src=pr&el=tree#diff-YmluL3RlbXBsYXRlcy9jb3Jkb3ZhL2xpYi9lbXVsYXRvci5qcw==) | `13.25% <10.71%> (-0.64%)` | :x: |
    | [bin/templates/cordova/lib/android_sdk_version.js](https://codecov.io/gh/apache/cordova-android/compare/7d5afdebe1d3d1ecf1ca22473fbb798bc70f49ad...edb9b81eb7d4a7dc5f4fa61c3aec819d296a05e3?src=pr&el=tree#diff-YmluL3RlbXBsYXRlcy9jb3Jkb3ZhL2xpYi9hbmRyb2lkX3Nka192ZXJzaW9uLmpz) | `18.51% <100%> (�)` | |
    
    ------
    
    [Continue to review full report at Codecov](https://codecov.io/gh/apache/cordova-android/pull/366?src=pr&el=continue).
    > **Legend** - [Click here to learn more](https://docs.codecov.io/docs/codecov-delta)
    > `\u0394 = absolute <relative> (impact)`, `� = not affected`, `? = missing data`
    > Powered by [Codecov](https://codecov.io/gh/apache/cordova-android/pull/366?src=pr&el=footer). Last update [7d5afde...edb9b81](https://codecov.io/gh/apache/cordova-android/compare/7d5afdebe1d3d1ecf1ca22473fbb798bc70f49ad...edb9b81eb7d4a7dc5f4fa61c3aec819d296a05e3?el=footer&src=pr&el=lastupdated). Read the [comment docs](https://docs.codecov.io/docs/pull-request-comments).


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

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


[GitHub] cordova-android issue #366: CB-12546: More robust support spawning the emula...

Posted by filmaj <gi...@git.apache.org>.
Github user filmaj commented on the issue:

    https://github.com/apache/cordova-android/pull/366
  
    I'm actually going to close this pull request and re-open once I have added tests and thoroughly tested on both Windows and Mac.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

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


[GitHub] cordova-android issue #366: CB-12546: More robust support spawning the emula...

Posted by filmaj <gi...@git.apache.org>.
Github user filmaj commented on the issue:

    https://github.com/apache/cordova-android/pull/366
  
    > Related: I've been burned by this more times than I can count, maybe we should get rid of this check?
    
    Nah, I think it's a good check. It runs fast and it enforces a certain JS style - I think there's benefits to it. It was my bad to not run it.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

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


[GitHub] cordova-android issue #366: CB-12546: More robust support spawning the emula...

Posted by infil00p <gi...@git.apache.org>.
Github user infil00p commented on the issue:

    https://github.com/apache/cordova-android/pull/366
  
    @filmaj This needs to at least pass Appveyor before I we should really look at it.  I'm sure it works, but jshint is showing a lot of quote errors.  (Related: I've been burned by this more times than I can count, maybe we should get rid of this check?)


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

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


[GitHub] cordova-android pull request #366: CB-12546: More robust support spawning th...

Posted by filmaj <gi...@git.apache.org>.
Github user filmaj closed the pull request at:

    https://github.com/apache/cordova-android/pull/366


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

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