You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cordova.apache.org by GitBox <gi...@apache.org> on 2020/04/12 03:26:44 UTC
[GitHub] [cordova-android] breautek opened a new pull request #951: fix:
ANDROID_SDK_ROOT variable
breautek opened a new pull request #951: fix: ANDROID_SDK_ROOT variable
URL: https://github.com/apache/cordova-android/pull/951
<!--
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
### 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. -->
Fixes #949 which describes a functional issue
Fixes #670 which describes a cosmetic issue that is loosely related.
### Description
<!-- Describe your changes in detail -->
This PR does the following:
- Makes ANDROID_SDK_ROOT the primary variable to look for the Android SDK location.
- Makes ANDROID_HOME the fallback variable, if ANDROID_SDK_ROOT is not present/valid.
Gradle updates:
Note that the following gradle updates were required, otherwise the android gradle plugin did not honour the ANDROID_SDK_ROOT variable.
- Updates the framework's android studio's gradle plugin from version 3.3.0 to 3.5.3.
Not only this is required for android's gradle to obey ANDROID_SDK_ROOT, it is now in sync with the Android test project/
- Updates the Androidx test project to use gralde plugin from version 3.3.0 to 3.5.3, to match Android Test & framework.
- Consequentially, this required to also upgrade AndroidX test project to use Gradle 6.1, which also matches both the Android test project & framework
These changes above fixes #949
Additionally, since we update the environment variables dynamically, the environment variable printout produced misleading information.
The environment variable printout will now print out the variable as defined by the user (before the tooling messes with them). An additional log
is printed that tells the user exactly what Cordova is going to use for the Android SDK path. This should fix #670
Tests was also changed to mainly use `ANDROID_SDK_ROOT` instead of `ANDROID_HOME`. Additional tests were added to ensure things works with either variable, but `ANDROID_SDK_ROOT` now takes precedence over `ANDROID_HOME`, should both be defined.
### Testing
<!-- Please describe in detail how you tested your changes. -->
npm test passes successfully, both old and new.
I've ran npm test in every combination of:
- with `ANDROID_SDK_ROOT` / with `ANDROID_HOME`
- with `ANDROID_SDK_ROOT` / without `ANDROID_HOME`
- without `ANDROID_SDK_ROOT` / with `ANDROID_HOME`
- without `ANDROID_SDK_ROOT` / without `ANDROID_HOME`
Additionally, I've tested each of these combinations with a hello world cordova test app, to ensure `build` runs successfully.
This PR should be accompanied with a cordova-docs PR to update the [Environment Variables](https://cordova.apache.org/docs/en/latest/guide/platforms/android/index.html#setting-environment-variables) documentation, which has not been done yet.
### Checklist
- [x] I've run the tests to see all new and existing tests pass
- [x] I added automated test coverage as appropriate for this change
- [x] Commit is prefixed with `(platform)` if this change only applies to one platform (e.g. `(android)`)
- [x] If this Pull Request resolves an issue, I linked to the issue in the text above (and used the correct [keyword to close issues using keywords](https://help.github.com/articles/closing-issues-using-keywords/))
- [] I've updated the documentation if necessary
----------------------------------------------------------------
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:
users@infra.apache.org
With regards,
Apache Git Services
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@cordova.apache.org
For additional commands, e-mail: commits-help@cordova.apache.org
[GitHub] [cordova-android] breautek commented on issue #951: WIP: fix:
ANDROID_SDK_ROOT variable
Posted by GitBox <gi...@apache.org>.
breautek commented on issue #951: WIP: fix: ANDROID_SDK_ROOT variable
URL: https://github.com/apache/cordova-android/pull/951#issuecomment-612558895
Not sure why it's failling on mac, NodeJS on mac must behaves slightly different, will investigate tomorrow.
Also pondering forcing `ANDROID_HOME` from the environment after a correct sdk path is determined considering...
>If ANDROID_HOME is defined and contains a valid SDK installation, its value is used instead of the value in ANDROID_SDK_ROOT.
https://developer.android.com/studio/command-line/variables#android_sdk_root
----------------------------------------------------------------
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:
users@infra.apache.org
With regards,
Apache Git Services
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@cordova.apache.org
For additional commands, e-mail: commits-help@cordova.apache.org
[GitHub] [cordova-android] breautek commented on issue #951: WIP: fix:
ANDROID_SDK_ROOT variable
Posted by GitBox <gi...@apache.org>.
breautek commented on issue #951: WIP: fix: ANDROID_SDK_ROOT variable
URL: https://github.com/apache/cordova-android/pull/951#issuecomment-614338035
Putting this PR back to "WIP" since the latest rebase, this branch specifically does not pass a test for some reason... the test that is failing seems unrelated, so will need to investigate...
Oddly enough, it doesn't fail in the other 2 branches that this PR depends on, so it is something specific to this branch.
----------------------------------------------------------------
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:
users@infra.apache.org
With regards,
Apache Git Services
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@cordova.apache.org
For additional commands, e-mail: commits-help@cordova.apache.org
[GitHub] [cordova-android] codecov-io commented on issue #951: WIP: fix:
ANDROID_SDK_ROOT variable
Posted by GitBox <gi...@apache.org>.
codecov-io commented on issue #951: WIP: fix: ANDROID_SDK_ROOT variable
URL: https://github.com/apache/cordova-android/pull/951#issuecomment-613032081
# [Codecov](https://codecov.io/gh/apache/cordova-android/pull/951?src=pr&el=h1) Report
> Merging [#951](https://codecov.io/gh/apache/cordova-android/pull/951?src=pr&el=desc) into [master](https://codecov.io/gh/apache/cordova-android/commit/6402e7b75504bcfb9e52e0f3df4abe07c4cfef58&el=desc) will **increase** coverage by `0.56%`.
> The diff coverage is `86.84%`.
[![Impacted file tree graph](https://codecov.io/gh/apache/cordova-android/pull/951/graphs/tree.svg?width=650&height=150&src=pr&token=q14nMf6C5a)](https://codecov.io/gh/apache/cordova-android/pull/951?src=pr&el=tree)
```diff
@@ Coverage Diff @@
## master #951 +/- ##
==========================================
+ Coverage 65.53% 66.10% +0.56%
==========================================
Files 21 21
Lines 1828 1838 +10
==========================================
+ Hits 1198 1215 +17
+ Misses 630 623 -7
```
| [Impacted Files](https://codecov.io/gh/apache/cordova-android/pull/951?src=pr&el=tree) | Coverage Δ | |
|---|---|---|
| [bin/templates/cordova/lib/check\_reqs.js](https://codecov.io/gh/apache/cordova-android/pull/951/diff?src=pr&el=tree#diff-YmluL3RlbXBsYXRlcy9jb3Jkb3ZhL2xpYi9jaGVja19yZXFzLmpz) | `57.60% <86.84%> (+5.42%)` | :arrow_up: |
------
[Continue to review full report at Codecov](https://codecov.io/gh/apache/cordova-android/pull/951?src=pr&el=continue).
> **Legend** - [Click here to learn more](https://docs.codecov.io/docs/codecov-delta)
> `Δ = absolute <relative> (impact)`, `ø = not affected`, `? = missing data`
> Powered by [Codecov](https://codecov.io/gh/apache/cordova-android/pull/951?src=pr&el=footer). Last update [6402e7b...7634087](https://codecov.io/gh/apache/cordova-android/pull/951?src=pr&el=lastupdated). Read the [comment docs](https://docs.codecov.io/docs/pull-request-comments).
----------------------------------------------------------------
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:
users@infra.apache.org
With regards,
Apache Git Services
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@cordova.apache.org
For additional commands, e-mail: commits-help@cordova.apache.org
[GitHub] [cordova-android] breautek merged pull request #951: fix:
ANDROID_SDK_ROOT variable
Posted by GitBox <gi...@apache.org>.
breautek merged pull request #951: fix: ANDROID_SDK_ROOT variable
URL: https://github.com/apache/cordova-android/pull/951
----------------------------------------------------------------
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:
users@infra.apache.org
With regards,
Apache Git Services
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@cordova.apache.org
For additional commands, e-mail: commits-help@cordova.apache.org
[GitHub] [cordova-android] breautek opened a new pull request #951: fix:
ANDROID_SDK_ROOT variable
Posted by GitBox <gi...@apache.org>.
breautek opened a new pull request #951: fix: ANDROID_SDK_ROOT variable
URL: https://github.com/apache/cordova-android/pull/951
<!--
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
### 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. -->
Fixes #949 which describes a functional issue
Fixes #670 which describes a cosmetic issue that is loosely related.
### Description
<!-- Describe your changes in detail -->
This PR depends on two other PRs: #959 #960
This PR does the following:
- Makes ANDROID_SDK_ROOT the primary variable to look for the Android SDK location.
- Makes ANDROID_HOME the fallback variable, if ANDROID_SDK_ROOT is not present/valid.
~~Gradle updates:~~
~~Note that the following gradle updates were required, otherwise the android gradle plugin did not honour the ANDROID_SDK_ROOT variable.~~
- ~~Updates the framework's android studio's gradle plugin from version 3.3.0 to 3.5.3.
Not only this is required for android's gradle to obey ANDROID_SDK_ROOT, it is now in sync with the Android test project/~~
- ~~Updates the Androidx test project to use gralde plugin from version 3.3.0 to 3.5.3, to match Android Test & framework.~~
- ~~Consequentially, this required to also upgrade AndroidX test project to use Gradle 6.1, which also matches both the Android test project & framework~~
Gradle updates have been moved to independent PRs #959 #960
These changes above fixes #949
Additionally, since we update the environment variables dynamically, the environment variable printout produced misleading information.
The environment variable printout will now print out the variable as defined by the user (before the tooling messes with them). An additional log
is printed that tells the user exactly what Cordova is going to use for the Android SDK path. This should fix #670
Tests was also changed to mainly use `ANDROID_SDK_ROOT` instead of `ANDROID_HOME`. Additional tests were added to ensure things works with either variable, but `ANDROID_SDK_ROOT` now takes precedence over `ANDROID_HOME`, should both be defined.
### Testing
<!-- Please describe in detail how you tested your changes. -->
npm test passes successfully, both old and new.
I've ran npm test in every combination of:
- with `ANDROID_SDK_ROOT` / with `ANDROID_HOME`
- with `ANDROID_SDK_ROOT` / without `ANDROID_HOME`
- without `ANDROID_SDK_ROOT` / with `ANDROID_HOME`
- without `ANDROID_SDK_ROOT` / without `ANDROID_HOME`
Additionally, I've tested each of these combinations with a hello world cordova test app, to ensure `build` runs successfully.
This PR should be accompanied with a cordova-docs PR to update the [Environment Variables](https://cordova.apache.org/docs/en/latest/guide/platforms/android/index.html#setting-environment-variables) documentation, which has not been done yet.
### Checklist
- [x] I've run the tests to see all new and existing tests pass
- [x] I added automated test coverage as appropriate for this change
- [x] Commit is prefixed with `(platform)` if this change only applies to one platform (e.g. `(android)`)
- [x] If this Pull Request resolves an issue, I linked to the issue in the text above (and used the correct [keyword to close issues using keywords](https://help.github.com/articles/closing-issues-using-keywords/))
- [x] I've updated the documentation if necessary
----------------------------------------------------------------
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:
users@infra.apache.org
With regards,
Apache Git Services
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@cordova.apache.org
For additional commands, e-mail: commits-help@cordova.apache.org
[GitHub] [cordova-android] breautek closed pull request #951: fix:
ANDROID_SDK_ROOT variable
Posted by GitBox <gi...@apache.org>.
breautek closed pull request #951: fix: ANDROID_SDK_ROOT variable
URL: https://github.com/apache/cordova-android/pull/951
----------------------------------------------------------------
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:
users@infra.apache.org
With regards,
Apache Git Services
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@cordova.apache.org
For additional commands, e-mail: commits-help@cordova.apache.org