Open breautek opened 6 months ago
Attention: 3 lines
in your changes are missing coverage. Please review.
Comparison is base (
4742358
) 72.35% compared to head (c94b62c
) 72.60%.
Files | Patch % | Lines |
---|---|---|
lib/builders/ProjectBuilder.js | 62.50% | 3 Missing :warning: |
:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.
Platforms affected
Android
Motivation and Context
Adds in support for the next android platform
Closes https://github.com/apache/cordova-android/issues/1661 Closes https://github.com/apache/cordova-android/pull/1596
Description
This PR supercedes and includes https://github.com/apache/cordova-android/pull/1596
This PR does a few different things to provide API 34 support which will be noted below.
Default Configuration Changes
Target SDK: 34 Gradle Version: 8.5 AGP Version: 8.2.1 Kotlin JVM Target: 1.8 (If kotlin is enabled) Min Build Tools: 34
Java Changes
~Source/Target compatibility we changed from Java 8 to 17 on both the framework and app template projects.~
Source & Target compatibility have been reverted back to 8, but 2 new preferences are added to allow developers to experiment:
AndroidJavaSourceCompatibility
andAndroidJavaTargetCompatibility
which adjusts the respective gradle compile options. By default, these values are 8, which is the same values used before.BuildConfig
Previously this I believe was implicitly enabled, but now needs to be explictly enabled otherwise the following may occur
I however did encounter this on a simple project, so it might be required depending on what the plugins does.
AGP 8.2
This is the minimum version required for API 34 builds. Attempting build against API 34 on earlier versions will produce warnings and/or errors.
Gradle
-b
flagThis flag has been deprecated and scheduled to be removed in gradle's next major release. The gradle projects must follow a standard structure now. Cordova's generated project already follows the standard structure thus for
cordova build
commands the-b
append can simply just be removed, we don't need to explicitly declare thebuild.gradle
file.It was also used against the
wrapper.gradle
file which changes are noted below.gradle.wrapper
The "intentionally empty" gradle.wrapper file has been removed.
We no longer manually manage gradle versions. Instead, we let gradle do it for us by utilising their
--gradle-version
argument. A new function was introduced to replace the oldrunGradleWrapper
to:By default, this will be
8.4
as defined in the defaults json config file, but may be overwritten byGradleVersion
preference, orCORDOVA_ANDROID_GRADLE_DISTRIBUTION_URL
environment variable.If
CORDOVA_ANDROID_GRADLE_DISTRIBUTION_URL
is defined, the preference will be ignored and--distribution-url
will be used instead, maintaining the ability for corporations to install their own gradle wrapper from their own source.Android Studio
The recommended Android Studio to use with AGP 8.2 is Android Studio Hedgehog.
CI
JDK was updated from 11 to 17, which is a requirement to build for API 34
Testing
Ran NPM test Ran in sample cordova hello world app Ran in one of my projects
Pending Tasks:
These are tasks that are still need to be done before this PR is ready for review.
AndroidJavaTargetCompatibility
preference value, as they should be equal.Checklist
(platform)
if this change only applies to one platform (e.g.(android)
)