This is an automated email from the ASF dual-hosted git repository.

erisu pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/cordova-android.git


The following commit(s) were added to refs/heads/master by this push:
     new c2f315c0 feat: bump kotlin 1.9.24 & drop kotlin-android-extensions 
when kotlin >= 1.8.0 (#1543)
c2f315c0 is described below

commit c2f315c0ff32930a8306d82d7a6a87f2e354eb8f
Author: エリス <er...@users.noreply.github.com>
AuthorDate: Mon May 13 23:32:49 2024 +0900

    feat: bump kotlin 1.9.24 & drop kotlin-android-extensions when kotlin >= 
1.8.0 (#1543)
    
    * feat: bump kotlin 1.9.24 & don't apply kotlin-android-extensions when 
kotlin >= 1.8.0
---
 framework/cdv-gradle-config-defaults.json | 2 +-
 framework/cordova.gradle                  | 4 ++++
 templates/project/app/build.gradle        | 6 +++++-
 3 files changed, 10 insertions(+), 2 deletions(-)

diff --git a/framework/cdv-gradle-config-defaults.json 
b/framework/cdv-gradle-config-defaults.json
index 2895afc7..46e6513d 100644
--- a/framework/cdv-gradle-config-defaults.json
+++ b/framework/cdv-gradle-config-defaults.json
@@ -5,7 +5,7 @@
     "GRADLE_VERSION": "8.7",
     "MIN_BUILD_TOOLS_VERSION": "34.0.0",
     "AGP_VERSION": "8.3.0",
-    "KOTLIN_VERSION": "1.7.21",
+    "KOTLIN_VERSION": "1.9.24",
     "ANDROIDX_APP_COMPAT_VERSION": "1.6.1",
     "ANDROIDX_WEBKIT_VERSION": "1.6.0",
     "ANDROIDX_CORE_SPLASHSCREEN_VERSION": "1.0.0",
diff --git a/framework/cordova.gradle b/framework/cordova.gradle
index 8ce3b9f6..9b978398 100644
--- a/framework/cordova.gradle
+++ b/framework/cordova.gradle
@@ -43,6 +43,10 @@ Boolean isVersionValid(version) {
     return !(new Version(version)).isEqual('0.0.0')
 }
 
+Boolean isVersionGreaterThanEqual(versionX, versionY) {
+    return (new Version(versionX)) >= (new Version(versionY))
+}
+
 String doFindLatestInstalledBuildTools(String minBuildToolsVersionString) {
     def buildToolsDirContents
     try {
diff --git a/templates/project/app/build.gradle 
b/templates/project/app/build.gradle
index 4d531aae..19f97c21 100644
--- a/templates/project/app/build.gradle
+++ b/templates/project/app/build.gradle
@@ -21,7 +21,11 @@ apply plugin: 'com.android.application'
 
 if (cordovaConfig.IS_GRADLE_PLUGIN_KOTLIN_ENABLED) {
     apply plugin: 'kotlin-android'
-    apply plugin: 'kotlin-android-extensions'
+
+    if(!cdvHelpers.isVersionGreaterThanEqual(cordovaConfig.KOTLIN_VERSION, 
'1.8.0')) {
+        println "Kotlin version < 1.8.0 detected. Applying 
kotlin-android-extensions plugin."
+        apply plugin: 'kotlin-android-extensions'
+    }
 }
 
 buildscript {


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscr...@cordova.apache.org
For additional commands, e-mail: commits-h...@cordova.apache.org

Reply via email to