* fix: remove ANDROID_HOME's DEPRECATED text
* fix: check_gradle to check ANDROID_HOME first ANDROID_SDK_ROOT last
* fix: set ANDROID_HOME
* chore: deprecate flag on ANDROID_SDK_ROOT
* fix(Api): do not infer project root from script location
* fix(builders): do not infer project root from script location
* fix(target): do not infer project root from script location
* test(e2e): cleanup and extend E2E tests
- Renames the file with the only existing E2E test
- Makes existing test use the API instance returned by
`Api.createPlatform`
- Adds another test that ensures we can still require the API from
`platformProjectPath/cordova/Api.js`
* fix(check_reqs): do not infer project root from script location
* enhancement: Control SDK versions and other default projects in one place
* fix: target/compile sdk usage
* refactor: cleanup gradle process
* chore: cleanup and remove unused changes
* chore: remove more unneeded FILE_PATH
* chore: fix lint error
* revert change intended to be part of a different PR
* chore: apply changes to revert to fit new changes
* fix: Ensure proper types
* breaking: Removed TempateFile class
* Replaced the one and only usage of it with the properties-parser editor.
* Breaking change because we are converting a method into an asynchronous method.
* refactor: Use the sync version of properties editor
* Gh 1178 fix sdk use gradlearg fix (#2)
* fix: readd gradleArg support
* fix: variable name
* refactor: remove unused mock variables
* Update bin/templates/cordova/lib/builders/ProjectBuilder.js
* Update bin/lib/create.js
* fix: const naming (review suggestion)
* fix: use defaults for framework building
* chore: apply review suggestion
* chore: rename config.json & defaults.json (review suggestions)
* refactor: updateUserProjectGradleConfig method
* refactor: minor changes in updateUserProjectGradleConfig
* refactor: major changes in updateUserProjectGradleConfig
* fix: wrong handling of missing preferences
* fix: usage of undefined this
* fix(create.spec): mocking of getPreference
* test(check_reqs): reduce diff size
* refactor: add wrapper to load gradle config defaults
* fix(check_reqs): get_target
* Reads default SDK from default gradle config now
* fix(check_reqs.spec): return correct types from mocks
* revert to using get_target in create
* fix: e2e test
Co-authored-by: Erisu <ellis.bryan@gmail.com>
Co-authored-by: Raphael von der Grün <raphinesse@gmail.com>
This basically fixes up the changes from #1220.
* test(env/java): replace test that duplicates implementation
* test(env/java): stub _ensure to focus on unit under test
* test(env/java): add test for invalid output
* refactor(env/java): keep try block small
* refactor(env/java): shorten excessive comment
* fix(requirements check): use regex to get java version from javac output
* fix(lint): format code
* fix(node 10): remove optional chaining from version check
* refactor(emulator)!: remove support for legacy `android` binary
`emulator.list_images` now always uses the `avdmanager` binary.
* refactor(android_sdk)!: remove support for legacy `android` binary
`android_sdk.list_targets` now always uses the `avdmanager` binary.
* refactor(check_reqs)!: do not look for legacy `android` binary
* refactor: replace installation instructions involving `android` binary
Co-authored-by: エリス <erisu@users.noreply.github.com>
Co-authored-by: Raphael von der Grün <raphinesse@gmail.com>
Update spec/unit/java.spec.js
Co-authored-by: Raphael von der Grün <raphinesse@gmail.com>
Update spec/unit/java.spec.js
Co-authored-by: Raphael von der Grün <raphinesse@gmail.com>
Update bin/templates/cordova/lib/utils.js
Co-authored-by: Raphael von der Grün <raphinesse@gmail.com>
Update bin/templates/cordova/lib/check_reqs.js
Co-authored-by: Raphael von der Grün <raphinesse@gmail.com>
Update spec/unit/check_reqs.spec.js
Co-authored-by: Raphael von der Grün <raphinesse@gmail.com>
Update spec/unit/check_reqs.spec.js
Co-authored-by: Raphael von der Grün <raphinesse@gmail.com>
Co-authored-by: Raphael von der Grün <raphinesse@gmail.com>
* test(check_reqs): test default Java location detection on Windows
* refactor(check_reqs): use glob for default Java location detection on Windows
This changes the implementation to be closer to what it was before #842
with everything being in one place.
* fix: remove always-taken if statement
* feat: take both Program Files variants from env
* refactor(check_reqs): cosmetic changes
* test(Api): do not clobber global events.emit w/ spy
* test(Api): remove unnecessary rewiring
* test(check_reqs): add missing spyOn call
* test(check_reqs): fix process.env restoration
* test(check_reqs): restore module under test before each test
This commit 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
* chore: drop q module
* chore: fix & complete dropping q
* Fix faulty transformation of Q.when
* Simplify thenResolve transformation
* Removes unnecesary Promise wrapping in onFulfilled callback.
* Transform .done calls to .then or .catch
* The important thing is that we always handle rejections.
* Remove Q from specs
Requires Jasmine 3.5
* Replace Q.timeout w/ Promise.race & custom function
Co-authored-by: Raphael von der Grün <raphinesse@gmail.com>