Commit Graph

173 Commits

Author SHA1 Message Date
Norman Breau
c9e7c59986
fix(GH-1616): Fix monochrome checks (#1632) 2023-07-13 13:18:54 -03:00
エリス
7da13ccf77
feat: add listTarget api (#1602)
* feat: add listTarget api
* test: write Platform API target list specs
2023-05-08 22:27:17 +09:00
Norman Breau
3343c3bb34
fix: Gradle Args parsing (#1606)
* fix: Gradle Args parsing

* refactor: Applied ARGVParser.parseArgsStringToArgv -> parseArgsStringToArgv suggestion

* test: Added deeper testing for gradle argument parsing
2023-04-22 17:00:51 -03:00
エリス
a9d4d4ebd2
feat!: bump Gradle 7.6 & AGP 7.4.2 (#1539)
* feat: bump gradle 7.6
* feat: bump android gradle plugin 7.3.1
* feat: bump android gradle plugin 7.4.2
* fix!: move android package name to build.gradle namespace
* fix!: remove deprecated package name from AndroidManifest
* fix: package name
* fix: rename CordovaGradleConfigParser's _save to write
* test: fix CordovaGradleConfigParser related specs
* fix: test refactoring for gradle namespace
* fix: accidental variable naming mixing

---------

Co-authored-by: Norman Breau <norman@nbsolutions.ca>
2023-04-12 14:39:47 +09:00
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
Mahendra Liya
016018513e
feat: add monochrome app icon support (#1550)
* Added the monochrome version for Cordova's icon

* android: modified the ic_launcher.xml to include the monochrome drawable

* android: replaced monochrome image with  rasterized images

* android: Added support for custom monochrome icons defined in config.xml

* android: Updated Tests

* android: wrapped inside if(monochrome)

* android: Update templates/project/res/mipmap-hdpi-v26/ic_launcher.xml

Co-authored-by: エリス <erisu@users.noreply.github.com>

* Update lib/prepare.js

Co-authored-by: エリス <erisu@users.noreply.github.com>

* android: Update templates/project/res/mipmap-ldpi-v26/ic_launcher.xml

Co-authored-by: エリス <erisu@users.noreply.github.com>

* android: Update templates/project/res/mipmap-mdpi-v26/ic_launcher.xml

Co-authored-by: エリス <erisu@users.noreply.github.com>

* android Update templates/project/res/mipmap-xhdpi-v26/ic_launcher.xml

Co-authored-by: エリス <erisu@users.noreply.github.com>

* android: Update templates/project/res/mipmap-xxhdpi-v26/ic_launcher.xml

Co-authored-by: エリス <erisu@users.noreply.github.com>

* android: Update templates/project/res/mipmap-xxxhdpi-v26/ic_launcher.xml

Co-authored-by: エリス <erisu@users.noreply.github.com>

* android: Update lib/prepare.js

Co-authored-by: エリス <erisu@users.noreply.github.com>

* Resolved lint errors

* fix: test failure

---------

Co-authored-by: エリス <erisu@users.noreply.github.com>
2023-04-09 20:41:38 -03:00
jcesarmobile
8a1ffeeafd
chore: Use gradle 7.4.2 distribution url (#1491) 2022-09-16 09:33:15 +02:00
エリス
273d1bdecd
chore: display warning on deprecated <splash> tag usage (#1451)
* chore: display warning on deprecated <splash> tag usage
* test: create spy on warnForDeprecatedSplashScreen
2022-06-30 20:00:25 +09:00
エリス
606e9c4826
feat!: android 12 splash screen (#1441)
* chore!: remove old splashscreen logic
* feat(splashscreen): add backwards compatibility
* chore: remove unused method
* chore: prefix splashscreen_background with cdv_
* feat: support android 12 splashscreen api configs
* feat: improve & refactor the logic for android splashscreen api 12
* feat: splashscreen copy image resources
* feat: splashscreen branding image & xml cleanup
* fix: splashscreen cleanup & branding conditions
* fix: splashscreen @color usage
* feat: update default Apache Cordova splash screen
* chore: add missing asf header
* fix: splashscreen image size
* chore: use Theme.SplashScreen.IconBackground as default parent to support windowSplashScreenIconBackgroundColor
* fix: center default test image by correct pivot
* fix: fs-extra copySync
* feat: re-add AutoHideSplashScreen and SplashScreenDelay preference support
* chore: move splashscreen into CordovaActivity
* feat: support splashscreen.hide & centralize to SplashScreenPlugin
* chore: cleanup SplashScreenPlugin
* feat: support fade, default auto hide on onPageFinished, support delays, refactor
* refactor: cleanup splash screen
* refactor: cleanup remove unused import
* chore: add show method as unsupported
* test: create a spy on updateProjectSplashScreen
* style: add ending new line
* chore: improve logging to warn when image path is missing
* chore: split windowSplashScreenAnimatedIcon and windowSplashScreenBrandingImage case and added branding warning
* chore: improve when to display warning
* fix: add splashscreen dependency to app as well
* chore: move the core-splashscreen dep lower

Co-authored-by: Niklas Merz <niklasmerz@linux.com>
2022-06-30 10:49:10 +09: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
wedgberto
cb494ff9b1
fix(android): move MainActivity.java to folder that tracks the app package name (widget id) (#1154)
* move mainactivity.java

* unit test for moving mainactivity.java

* fix new unit test

* eslint fixes

* add explicit elementtree npm dependency

Co-authored-by: David Wedgbury <david.wedgbury@telent.com>
2022-05-18 11:11:31 -03: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
Tiago Pereira
f100809bf3
fix: escape strings.xml app name (#1384) 2022-02-08 11:29:36 +09:00
Alexis THOMAS
13bd3f4a9f
feat: unify create default values & stop project name transform (#1213) 2021-08-13 12:52:30 +09:00
Alexis THOMAS
09c75237d9
fix: display project name in Android Studio (#1214) 2021-08-13 12:08:18 +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
Raphael von der Grün
70a1eff705
refactor: use target SDK of built APK to determine best emulator (#1267)
* refactor(emulator): require emulatorId in emulator.run

* refactor: use effective targetSdk to find best emulator
2021-07-12 09:48:36 +02:00
Raphael von der Grün
fb36e03aeb
refactor(run)!: cleanup run method (#1266)
* refactor(run)!: get rid of emit-and-throw & throw-literal antipatterns

* refactor(run)!: convert run method to async/await

* refactor(run): require build module in advance

* refactor(run): minor cleanup

* refactor(run): drop always-undefined option arch

`parseBuildOptions` only sets `arch` if something truthy is passed for
parameter `resolvedTarget` to which we pass `null`.

* refactor(run): destructure buildOptions
2021-07-11 15:47:07 +02:00
jcesarmobile
8a9cb8f6b7
feat: remove java 1.8 version check (#1241) 2021-07-07 13:19:09 +02:00
エリス
b8d32d7c60
feat: bump gradle@7.1.1 (#1257) 2021-07-07 11:11:24 +09: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
Raphael von der Grün
facffb0809
refactor!: remove most platform binaries (#1100)
* Remove binaries cordova/lib/*

* Remove binary bin/android_sdk_version

* Remove binary bin/update script

* Remove binary bin/check_reqs

* Remove binary bin/create script

* Remove binary cordova/build

* Remove binary cordova/run

* Remove binary cordova/clean

* Remove binary cordova/log

* Remove unused module cordova/loggingHelper

* Update README

* Restore target-listing binaries used by CLI

Usage: cordova-lib/src/cordova/targets.js

* Restore binary bin/android_sdk_version for CLI compatibility

This is used in CLI to implement an Android SDK version check for plugins.
See https://cordova.apache.org/docs/en/latest/plugin_ref/spec.html#engines-and-engine

* Remove version.bat
2021-07-06 15:37:46 +02:00
Raphael von der Grün
6f35d0b2b7
refactor(check_reqs): drop originalError param from check_android_target (#1260) 2021-07-06 13:33:26 +02:00
Raphael von der Grün
334d02d26e
tests(prepare): factor out common vars (#1259) 2021-07-06 13:01:37 +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
エリス
47aa116b1d
breaking: drop jcenter & update dependencies (#1251) 2021-07-03 13:04:13 +09:00
jcesarmobile
01569ce71a
feat!: upgrade android gradle plugin to 4.2.1 (#1232) 2021-07-01 16:50:39 +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
Norman Breau
6d803e2f72
Bugfix/java checks (#1228)
* fix: Java version parsing if java executable prints out additional information with --version

* fix: Ensure JAVA_HOME path comes first in the PATH environment

* refactor: Removed redundent code in favour of keeping a change introduced from another PR
2021-05-09 17:52:35 -03:00
Norman Breau
ae4dba2bb8
feat: CORDOVA_JAVA_HOME env variable (#1229)
* feat: CORDOVA_JAVA_HOME env variable

* refactor: Improve CORDOVA_JAVA_HOME env test

* fix(test) path separator issue
2021-05-09 17:02:25 -03: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
エリス
19bbf1e8c1
test(AndroidManifest): update theme to Theme.AppCompat.NoActionBar (#1207) 2021-04-16 18:32:46 +09: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
エリス
6588994586
feat!: upgrade android gradle plugin@4.1.3 (#1198)
* feat: upgrade gradle-plugin@4.1.3 (#1175)

Co-authored-by: Mosab A <47486787+mosabab@users.noreply.github.com>
2021-04-13 16:43:30 +09:00
エリス
dc8854d16c
feat: target sdk 30 w/ build-tool 30.0.3 (#1182) 2021-04-13 15:34:21 +09:00
Raphael von der Grün
c04ea9b1c0
refactor: unify target resolution for devices & emulators (#1101)
* refactor: unify target resolution for devices & emulators
* fix: use unified target methods in platform-centric bins
2021-04-09 15:37:56 +09:00
エリス
9071d5131a
Revert "[Frequent Updates] Gradle 6.6.1 & Android Gradle Plugin 4.0.1 & com.jfrog.bintray.gradle 1.8.5 (#1079)" (#1193)
This reverts commit 33476b4754.
2021-04-09 11:23:23 +09:00
エリス
04b0106bca
Revert "feat: upgrade gradle-plugin@4.1.3 (#1175)" (#1189)
This reverts commit 1430304d36.
2021-04-08 14:04:26 +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
Mosab A
1430304d36
feat: upgrade gradle-plugin@4.1.3 (#1175)
* Update build.gradle

* Update build.gradle

* Update build.gradle

* Update build.gradle

* Update build.gradle

* Update build.gradle
2021-03-27 10:36:39 -03:00
Shashank Agrawal
23a1710557
feat(android-studio): display app name as project name (#1173)
* (android) Feature: Write name of the Android app to .idea/.name for Android Studio #1172

* Missing space before function parentheses.

* Add test for writeNameForAndroidStudio #1172

* Use ES6 for new code. Code DRYness in test spec. #1172
2021-03-27 10:06:26 -03: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
Pieter Van Poyer
7428bd3a7f
Features/webp support for splashscreen (#1113)
* - linting
- platform independent paths in testing
- addes some unittest
- remove duplication + add comments
- delete webp's if png's added, delete png's if webp' added.
- Update bin/templates/cordova/lib/prepare.js Co-authored-by: エリス <erisu@users.noreply.github.com>
- fix https://github.com/apache/cordova-plugin-splashscreen/issues/257 webp support for android

* revert changes

* refactor: use source extension for target in getImageResourcePath

* fix(prepare): include more extensions in initial splash-screen resource map

* tests(prepare): quick-fix for tests

* backward slashes must be changed to forward slashes for fast-glob package.

Co-authored-by: Raphael von der Grün <raphinesse@gmail.com>
2020-12-16 17:21:35 -04:00
Raphael von der Grün
b245337501
refactor(ProjectBuilder): clean up output file collection code (#1099)
* refactor(ProjectBuilder): less repetitive fileSorter

This reverts the fileSorter to the state from before #937, but using our
own simple re-implementation of `compare-func`.

* fix(ProjectBuilder): apply sort RegExp to basename only

* refactor(ProjectBuilder): use fast-glob instead of hand-rolled equivalent

* refactor(ProjectBuilder): factor out common isPathArchSpecific

* refactor(ProjectBuilder): use includes instead of indexOf

* refactor(ProjectBuilder): move sorting into findOutputFilesHelper

* refactor(ProjectBuilder): simplify findOutputFiles signature
2020-11-21 10:44:56 +01:00
Raphael von der Grün
bb7d733cde
refactor: unify installation on devices & emulators (#1123)
* refactor: unify installation on devices & emulators

This change replaces the almost identical methods `device.install` and
`emulator.install` with the generic `target.install`.

* fix: use unified installation in platform-centric bins
2020-11-20 22:12:18 +01:00
Raphael von der Grün
aa679ea1d6
feat(Adb): list devices _and_ emulators in one go (#1125) 2020-11-19 21:30:56 +01: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
671e1fd1c6
refactor: remove copied Adb.install from emulator.install (#1108)
`emulator.install` contains a copy of the code of `Adb.install` just to
be able to pass custom options to `execa`.

This change removes that duplicated code in favor of a new option in
`Adb.install` that allows to pass options through to `execa`.
2020-11-17 09:06:44 +01:00