From df54fd6380a21a3073ea79138bb4544c8f1fad6d Mon Sep 17 00:00:00 2001 From: sds100 Date: Sat, 3 Aug 2024 18:49:07 +0200 Subject: [PATCH] chore: target Android 14, upgrade gradle version and kotlin version --- app/build.gradle | 24 +++++++++++++++---- .../accessibility/KeyCodeDescriptionMapper.kt | 2 +- build.gradle | 5 ++-- gradle/wrapper/gradle-wrapper.properties | 2 +- tools/make-emoji-keys/build.gradle | 4 ++-- 5 files changed, 27 insertions(+), 10 deletions(-) diff --git a/app/build.gradle b/app/build.gradle index ca5a42e58..f3bb2c5ab 100755 --- a/app/build.gradle +++ b/app/build.gradle @@ -1,14 +1,16 @@ apply plugin: 'com.android.application' apply plugin: 'kotlin-android' -apply plugin: 'kotlin-android-extensions' android { - compileSdkVersion 31 + + namespace "io.github.sds100.keymapper.inputmethod.latin" + compileSdk 34 + buildToolsVersion = '34.0.0' defaultConfig { applicationId "io.github.sds100.keymapper.inputmethod.latin" minSdkVersion 19 - targetSdkVersion 31 + targetSdkVersion 34 versionCode 19 versionName '1.4.5' } @@ -39,11 +41,25 @@ android { } } + buildFeatures { + aidl true + } + lintOptions { abortOnError false } ndkVersion '21.4.7075529' + + compileOptions { + sourceCompatibility JavaVersion.VERSION_17 + targetCompatibility JavaVersion.VERSION_17 + } + + kotlinOptions { + jvmTarget = "17" + } + androidResources { noCompress 'dict' } @@ -59,7 +75,7 @@ dependencies { implementation 'com.google.code.findbugs:jsr305:3.0.2' implementation 'androidx.legacy:legacy-support-v4:1.0.0' implementation 'androidx.recyclerview:recyclerview:1.2.1' // Replaces recyclerview:1.0.0 included by above dependency - implementation 'androidx.core:core-ktx:1.7.0' + implementation 'androidx.core:core-ktx:1.13.1' implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version" implementation 'androidx.viewpager2:viewpager2:1.0.0' } diff --git a/app/src/main/java/io/github/sds100/keymapper/inputmethod/accessibility/KeyCodeDescriptionMapper.kt b/app/src/main/java/io/github/sds100/keymapper/inputmethod/accessibility/KeyCodeDescriptionMapper.kt index 79e91939e..871314137 100644 --- a/app/src/main/java/io/github/sds100/keymapper/inputmethod/accessibility/KeyCodeDescriptionMapper.kt +++ b/app/src/main/java/io/github/sds100/keymapper/inputmethod/accessibility/KeyCodeDescriptionMapper.kt @@ -158,7 +158,7 @@ internal class KeyCodeDescriptionMapper private constructor() { private const val SPOKEN_EMOTICON_RESOURCE_NAME_PREFIX = "spoken_emoticon" private const val SPOKEN_EMOTICON_CODE_POINT_FORMAT = "_%02X" // The resource ID of the string spoken for obscured keys - private const val OBSCURED_KEY_RES_ID = R.string.spoken_description_dot + private val OBSCURED_KEY_RES_ID = R.string.spoken_description_dot val instance = KeyCodeDescriptionMapper() /** diff --git a/build.gradle b/build.gradle index 40d2bfe24..244f15cfd 100755 --- a/build.gradle +++ b/build.gradle @@ -1,13 +1,14 @@ // Top-level build file where you can add configuration options common to all sub-projects/modules. buildscript { - ext.kotlin_version = '1.6.20' + ext.kotlin_version = '1.8.20' + repositories { google() mavenCentral() } dependencies { - classpath 'com.android.tools.build:gradle:7.3.1' + classpath 'com.android.tools.build:gradle:8.4.2' classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version" // NOTE: Do not place your application dependencies here; they belong diff --git a/gradle/wrapper/gradle-wrapper.properties b/gradle/wrapper/gradle-wrapper.properties index ac87de860..1663a26fd 100755 --- a/gradle/wrapper/gradle-wrapper.properties +++ b/gradle/wrapper/gradle-wrapper.properties @@ -1,6 +1,6 @@ #Sun Jun 23 18:54:22 CEST 2024 distributionBase=GRADLE_USER_HOME distributionPath=wrapper/dists -distributionUrl=https\://services.gradle.org/distributions/gradle-7.4-bin.zip +distributionUrl=https\://services.gradle.org/distributions/gradle-8.6-bin.zip zipStoreBase=GRADLE_USER_HOME zipStorePath=wrapper/dists diff --git a/tools/make-emoji-keys/build.gradle b/tools/make-emoji-keys/build.gradle index 5237401e3..4d87285db 100644 --- a/tools/make-emoji-keys/build.gradle +++ b/tools/make-emoji-keys/build.gradle @@ -35,6 +35,6 @@ dependencies { java { - sourceCompatibility = JavaVersion.VERSION_1_8 - targetCompatibility = JavaVersion.VERSION_1_8 + sourceCompatibility JavaVersion.VERSION_17 + targetCompatibility JavaVersion.VERSION_17 } \ No newline at end of file