You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@cordova.apache.org by russaa <gi...@git.apache.org> on 2017/07/19 14:25:51 UTC

[GitHub] cordova-android pull request #396: CB-12677: (android) added option for expl...

GitHub user russaa opened a pull request:

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

    CB-12677: (android) added option for explicitly specifying path to An…

    <!--
    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?
    Adds the option for explicitly specifying the path to Android Studio via env variable.
    
    Automatic detection of the _Android Studio_ path currently only works, if it is installed in the default location.
    
    The option to specify the path via an env variable offers a simple solution, in cases where automatic detection does not work.
    
    This solution relates to [issue & discussion CB-12677](https://issues.apache.org/jira/browse/CB-12677).
    
    ### What testing has been done on this change?
    manually tested
    
    ### Checklist
    - [x] [Reported an issue](http://cordova.apache.org/contribute/issues.html) in the JIRA database
    - [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/mmig/cordova-android CB-12677

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

    https://github.com/apache/cordova-android/pull/396.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 #396
    
----
commit 4bf60983ff7e698f279e7790cc2e8947bd4bf754
Author: russa <aa...@dfki.de>
Date:   2017-07-19T13:56:42Z

    CB-12677: (android) added option for explicitly specifying path to Android Studio via env variable

----


---
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 #396: CB-12677: (android) added option for explicitly ...

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

    https://github.com/apache/cordova-android/pull/396
  
    Did you see the fix @purplecabbage did to pull this info from the Windows registry for Windows users? We're probably going to go with that solution for Windows because of the whole PATH issue.  Mac OS and Linux users are able to install Gradle without a problem.  There are already other issues with using or requiring Android Studio as a dependency, such as the fact that some people don't ever use the IDE


---
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 #396: CB-12677: (android) added option for explicitly ...

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

    https://github.com/apache/cordova-android/pull/396
  
    I'm not sure this is needed as we already do plenty of checking for the `ANDROID_HOME` environment variable. If you set that env var to the location of your Android SDK (whether or not it is the one bundled with Android Studio does not matter), that should be enough to help cordova figure out where the relevant Android tools are.


---
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 #396: CB-12677: (android) added option for explicitly ...

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

    https://github.com/apache/cordova-android/pull/396
  
    @infil00p I was not aware of this patch (I believe it is CB-12065 #387).
    
    I guess it would solve the issue for Windows right now -- but does not address the PATH problem (for Windows) in future versions of `cordova-android`, when `gradle` becomes a requirement.
    
    So in view of this future change, I would argue for the (additional) use of env variables (i.e. offer users to specify an env variable), because
     * it's basically platform independent, in difference to #387, which is fully automatic, but only works on Windows -- e.g. with env variables, if you have `gradle` and Android Studio installed on a *nix system, you can configure Cordova to use Android Studio's `gradle` quite easily
     * it's a low maintenance mechanism (i.e. implementation requires mostly no adjustments, when software paths/structures change), since users are responsible for providing the correct path
    
    So I would very much like to have the option, to specify the `gradle` location via an env variable in the future (i.e. when `gradle` will be declared a requirement), instead of having to install `gradle` separately, and put it into the PATH variable.


---
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 #396: CB-12677: (android) added option for explicitly ...

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

    https://github.com/apache/cordova-android/pull/396
  
    We are going to make Gradle a requirement.  Using Android Studio's copy of Gradle was a stop-gap solution to get builds working again, and we should really stop doing 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 issue #396: CB-12677: (android) added option for explicitly ...

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

    https://github.com/apache/cordova-android/pull/396
  
    Guys I need this pr to be merged. I am developing on Ubuntu 16.04 and installed Android Studio. 
    The problem is `check_reqs.js` never found my Android Studio.
    And another thing, we think the Android will be the 'Application' directory, so if not then no body would understand whats the actual problem.
    And about canary (Two Android Studio in Application directory Mac OS), I think we should inform users about that in the Documentation. In this case its throwing `EACCESS` which is just point user to different task. 


---
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 #396: CB-12677: (android) added option for explicitly ...

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

    https://github.com/apache/cordova-android/pull/396
  
    it is for detecting `Android Studio`, i.e. for detecting `gradle` in cases where the already-built-in-detection does not work -- so `ANDROID_HOME` is not necessarily a help here, as it points to the SDK which could be at an entirely different location.
    
    For example, when `Android Studio` is installed in some custom location, the already-built-in-detection fails, as described in the linked issue [CB-12677](https://issues.apache.org/jira/browse/CB-12677).


---
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 #396: CB-12677: (android) added option for explicitly ...

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

    https://github.com/apache/cordova-android/pull/396
  
    I have to say, I like the current solution better (using `gradle` from Android Studio):
    
     1. you are not required to install something, that you may already have installed
     2. if you are building/debugging the Cordova app with Android Studio, you can be sure that builds are same (as you are using the same version of `gradle`)
     3. users who prefer to install `gradle` separately still have this option
    
    If you want to get rid of the automatic-detection (because it may become cumbersome to maintain) I would still like to have the option of using Android Studio's `gradle` by pointing to its place via the env variable.   
    Its code should be fairly easy to maintain, since the user is responsible to specify the correct path, i.e. the detection routine only needs to look into the env variable and does not need to be adjusted to changing path structures etc. itself.  
    Although the mechanism then should maybe be changed, so that the env variable needs to point the `gradle` directory directly, instead of the Android Studio directory (which it does now), e.g. change the env variable to something like `GRADLE_HOME` and the path would need to point, e.g. to the `gradle` sub-directory of the Android Studio directory.
    
    
    As an additional reason:  
    I assume the _"install `gradle` separately/as requirement"_ option also means, that you must have `gradle` in your PATH env variable.
    
    On Windows, this is a concern for me, as the PATH variable has a maximum length -- which I, for instance, are always about to exceed. So I try to not have paths there, if I can avoid 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