Commit Graph

28 Commits

Author SHA1 Message Date
Alexis THOMAS
841710edf7
fix: ANDROID_HOME is the new default, to check first and give advice (#1471) 2023-04-09 20:43:11 -03:00
エリス
bf9e4d8aab
fix!: set & use ANDROID_HOME as default (#1444)
* 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
2022-06-27 22:07:32 +09:00
エリス
a2bb7f1173
chore(npm): bump @cordova/eslint-config@^4.0.0 (#1421)
* chore(npm): bump @cordova/eslint-config@^4.0.0
* style(lint): apply auto corrections
* style(lint): convert hasAndroidHome var to let and hoisted
2022-04-18 10:39:54 +09:00
Raphael von der Grün
16ff6e1b2f
refactor!: do not copy JS lib to platform project (#1269) 2021-07-13 11:01:50 +02:00
Raphael von der Grün
1f0ea173b0
refactor: do not infer project root from script location (#1265)
* 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
2021-07-13 08:51:20 +02:00
jcesarmobile
8a9cb8f6b7
feat: remove java 1.8 version check (#1241) 2021-07-07 13:19:09 +02:00
Raphael von der Grün
2037b62f99
test(check_reqs): do not hardcode DEFAULT_TARGET_API (#1263)
Should have been part of #1212
2021-07-06 18:12:00 +02:00
Norman Breau
510596f515
feat!: unify & fix gradle library/tooling overrides (#1212)
* 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>
2021-07-06 15:38:28 +09:00
Raphael von der Grün
0f13f4a5ac
refactor(env/java): improve tests and implementation (#1246)
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
2021-06-23 18:22:04 +02:00
David
a45804329b
fix(requirements check): use regex to get java version from javac output (#1220)
* 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
2021-05-09 09:33:08 -03:00
Raphael von der Grün
9c3195c1ee
refactor!: drop support for android SDK tool (#1083)
* 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
2021-04-13 19:16:43 +09:00
エリス
dc8854d16c
feat: target sdk 30 w/ build-tool 30.0.3 (#1182) 2021-04-13 15:34:21 +09:00
Norman Breau
1ec87634d4
fix(regression): Cannot read version of undefined caused by Java refactor (https://github.com/apache/cordova-android/pull/1130#discussion_r563597125) (#1185) 2021-03-30 22:40:34 +09:00
エリス
6dcd67a902
fix: unit-test failure (#1184) 2021-03-30 18:46:43 +09:00
Norman Breau
774de78691
refactor: java checks (#1130)
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>
2021-03-27 10:05:50 -03:00
Raphael von der Grün
0e8234abfd
refactor(check_reqs): cleanup default Java location detection on Windows (#1102)
* 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
2020-11-19 21:08:43 +01:00
Raphael von der Grün
335b0f2575
test: fix unit test failures for certain random orders (#1094)
* 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
2020-10-19 10:38:37 +02:00
Norman Breau
16a88ec631
fix: ANDROID_SDK_ROOT variable (#951)
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
2020-04-15 23:43:17 -03:00
Norman Breau
3712619f5c
refactor: remove shelljs dependency (#842)
Co-authored-by: エリス <erisu@users.noreply.github.com>
2020-01-29 10:12:55 +09:00
Norman Breau
92268b2e76 fix: cordova requirements consider the android-targetSdkVersion (#849)
* Made cordova requirements consider the android-targetSdkVersion preference
* refator: get_target method
Added comments.
Added JSDoc block
Reduced error exit point to one spot

Co-authored-by: エリス <erisu@users.noreply.github.com>
2020-01-24 10:53:49 +09:00
エリス
0e6ad28e56
chore: drop q module (#833)
* 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>
2020-01-07 21:22:59 +09:00
Raphael von der Grün
ad742ec93c
Simplify and fix promise handling in specs (#787) 2019-07-17 14:56:36 +02:00
エリス
576edb53bb
Updated ANDROID_HOME Test to Follow #656 Change (#673) 2019-02-18 09:34:55 +09:00
Audrey So
ac4ac935f6 CB-12895 : added .eslintrc files to set up jasmine environment 2017-06-23 08:07:08 -07:00
Audrey So
d83d49d83b CB-12895 : fixed eslint errors 2017-06-23 08:07:08 -07:00
filmaj
3554267adf CB-12546: more specs for android_sdk and check_reqs. added fixtures for sdk targets. refactored target listing. 2017-03-20 10:09:45 -07:00
filmaj
d40c22441f CB-12546: move check_reqs to templates directory and update module references. 2017-03-20 10:08:36 -07:00
filmaj
eb6ada8091 CB-12546: more robust sdk location detection. ANDROID_HOME now can be set from location of either of adb, android or avdmanager commands. slightly rework logic of infering ANDROID_HOME + setting up PATH to hopefully separate the logic into clearer sections. check_reqs.check_android now validates SDK Tools 25.3.1 binaries/structure. added specs for check_reqs.check_android. move android sdk version script. expose some helper functions as module methods to help with mocking. 2017-03-20 10:08:35 -07:00