You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@cordova.apache.org by daserge <gi...@git.apache.org> on 2016/02/16 17:29:10 UTC

[GitHub] cordova-android pull request: CB-10628 Fix emulate android --targe...

GitHub user daserge opened a pull request:

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

    CB-10628 Fix emulate android --target

    [Jira issue](https://issues.apache.org/jira/browse/CB-10628)

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

    $ git pull https://github.com/MSOpenTech/cordova-android CB-10628

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

    https://github.com/apache/cordova-android/pull/260.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 #260
    
----
commit faecaed409f7c9736882ba29601f6d3976ea2ce0
Author: daserge <v-...@microsoft.com>
Date:   2016-02-16T16:20:49Z

    CB-10628 Fix emulate android --target

----


---
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: CB-10628 Fix emulate android --targe...

Posted by daserge <gi...@git.apache.org>.
Github user daserge commented on the pull request:

    https://github.com/apache/cordova-android/pull/260#issuecomment-185384284
  
    I will take a look at this once more tomorrow.


---
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: CB-10628 Fix emulate android --targe...

Posted by daserge <gi...@git.apache.org>.
Github user daserge commented on the pull request:

    https://github.com/apache/cordova-android/pull/260#issuecomment-185698067
  
    @nikhilkh, please take a look.


---
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: CB-10628 Fix emulate android --targe...

Posted by nikhilkh <gi...@git.apache.org>.
Github user nikhilkh commented on the pull request:

    https://github.com/apache/cordova-android/pull/260#issuecomment-184884824
  
    How can we test this?


---
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: CB-10628 Fix emulate android --targe...

Posted by vladimir-kotikov <gi...@git.apache.org>.
Github user vladimir-kotikov commented on a diff in the pull request:

    https://github.com/apache/cordova-android/pull/260#discussion_r53140038
  
    --- Diff: bin/templates/cordova/lib/run.js ---
    @@ -41,8 +41,9 @@ var path  = require('path'),
     
         var self = this;
     
    -    var install_target = runOptions.device ? '--device' :
    -        runOptions.emulator ? '--emulator' :
    +    var install_target = !runOptions.target ?
    --- End diff --
    
    IMO this statement looks very complex - there is 3 ternary operators in one expression. Could you please try to simplify this


---
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: CB-10628 Fix emulate android --targe...

Posted by nikhilkh <gi...@git.apache.org>.
Github user nikhilkh commented on the pull request:

    https://github.com/apache/cordova-android/pull/260#issuecomment-185830008
  
    LGTM


---
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: CB-10628 Fix emulate android --targe...

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

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


---
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: CB-10628 Fix emulate android --targe...

Posted by daserge <gi...@git.apache.org>.
Github user daserge commented on the pull request:

    https://github.com/apache/cordova-android/pull/260#issuecomment-185680615
  
    Worked on this with @vladimir-kotikov - there is a way to solve this using `require.cache` but it looks like an overkill for this case. 
    Decided to require `check_reqs` at runtime instead.


---
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: CB-10628 Fix emulate android --targe...

Posted by daserge <gi...@git.apache.org>.
Github user daserge commented on the pull request:

    https://github.com/apache/cordova-android/pull/260#issuecomment-185383888
  
    @vladimir-kotikov, addressed, thanks.
    @nikhilkh, I've tried to test private `getInstallTarget` with `rewire` but faced an issue caused by the fact that the test-time directory structure differs from the run-time one (so that `check-reqs` fails to load when rewire requires run -> emulator -> check_reqs):
    
    ```javascript
    var rewire = require("rewire");
    var run = rewire("../../bin/templates/cordova/lib/run");
    var getInstallTarget = run.__get__("getInstallTarget");
    
    describe("run", function () {
      describe("getInstallTarget", function() {
        var targetOpts = { target: "emu" };
        var deviceOpts = { device: true };
        var emulatorOpts = { emulator: true };
        var emptyOpts = {};
    
        it("should select correct target based on the run opts", function() {
            expect(getInstallTarget(targetOpts)).toBe("emu");
            expect(getInstallTarget(deviceOpts)).toBe("--device");
            expect(getInstallTarget(emulatorOpts)).toBe("--emulator");
            expect(getInstallTarget(emptyOpts)).toBeUndefined();
        });
      });
    });
    ```


---
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