From f45dd8187bbcf6d768ae0af9bf726751dc122af2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tobias=20L=C3=A4nge?= Date: Thu, 18 Jan 2024 14:30:56 +0100 Subject: [PATCH] Update target sdk and dependencies --- app/build.gradle | 49 ++++++++++++------- .../PFAPainDiaryApplication.kt | 4 +- .../backup/BackupRestorer.kt | 5 +- build.gradle | 14 +++--- 4 files changed, 44 insertions(+), 28 deletions(-) diff --git a/app/build.gradle b/app/build.gradle index b4d382d..daa1c9f 100644 --- a/app/build.gradle +++ b/app/build.gradle @@ -1,14 +1,16 @@ -apply plugin: 'com.android.application' -apply plugin: 'kotlin-android' -apply plugin: 'kotlin-kapt' +plugins { + id 'com.android.application' + id 'kotlin-android' + id 'kotlin-kapt' + id 'com.google.devtools.ksp' +} android { - compileSdkVersion 31 - defaultConfig { applicationId "org.secuso.privacyfriendlypaindiary" minSdkVersion 21 - targetSdkVersion 31 + targetSdkVersion 34 + compileSdk 34 versionCode 5 versionName "1.3.1" testInstrumentationRunner 'androidx.test.runner.AndroidJUnitRunner' @@ -24,6 +26,19 @@ android { abortOnError false } + compileOptions { + sourceCompatibility JavaVersion.VERSION_17 + targetCompatibility JavaVersion.VERSION_17 + } + + kotlinOptions { + jvmTarget = JavaVersion.VERSION_17.toString() + } + + kotlin { + jvmToolchain(17) + } + android.applicationVariants.configureEach { variant -> variant.outputs.all { def appName = "pfa-pain-diary" @@ -34,34 +49,34 @@ android { dependencies { implementation fileTree(dir: 'libs', include: ['*.jar']) - testImplementation 'junit:junit:4.12' - androidTestImplementation 'junit:junit:4.12' - androidTestImplementation('androidx.test.ext:junit:1.1.1') { + testImplementation 'junit:junit:4.13.2' + androidTestImplementation 'junit:junit:4.13.2' + androidTestImplementation('androidx.test.ext:junit:1.1.5') { exclude group: 'com.android.support', module: 'support-annotations' } androidTestImplementation('androidx.test:runner:1.5.2') androidTestImplementation('androidx.test:core:1.5.0') - implementation 'androidx.appcompat:appcompat:1.4.2' + implementation 'androidx.appcompat:appcompat:1.6.1' implementation 'androidx.legacy:legacy-support-v4:1.0.0' - implementation 'com.google.android.material:material:1.2.1' + implementation 'com.google.android.material:material:1.11.0' implementation 'com.prolificinteractive:material-calendarview:1.4.3' - implementation("com.github.bumptech.glide:glide:4.6.1") { + implementation("com.github.bumptech.glide:glide:4.11.0") { exclude group: "com.android.support" } - annotationProcessor 'com.github.bumptech.glide:compiler:4.6.1' + ksp 'com.github.bumptech.glide:compiler:4.9.0' - implementation "androidx.lifecycle:lifecycle-viewmodel-ktx:2.4.1" + implementation "androidx.lifecycle:lifecycle-viewmodel-ktx:2.7.0" - def room_version = "2.4.2" + def room_version = "2.6.1" implementation "androidx.room:room-runtime:$room_version" annotationProcessor "androidx.room:room-compiler:$room_version" - kapt "androidx.room:room-compiler:$room_version" + ksp "androidx.room:room-compiler:$room_version" implementation "androidx.room:room-ktx:$room_version" implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version" implementation project(path: ':backup-api') - def work_version = "2.7.1" + def work_version = "2.9.0" implementation "androidx.work:work-runtime:$work_version" implementation "androidx.work:work-runtime-ktx:$work_version" androidTestImplementation "androidx.work:work-testing:$work_version" diff --git a/app/src/main/java/org/secuso/privacyfriendlypaindiary/PFAPainDiaryApplication.kt b/app/src/main/java/org/secuso/privacyfriendlypaindiary/PFAPainDiaryApplication.kt index 187f6a0..29552cf 100644 --- a/app/src/main/java/org/secuso/privacyfriendlypaindiary/PFAPainDiaryApplication.kt +++ b/app/src/main/java/org/secuso/privacyfriendlypaindiary/PFAPainDiaryApplication.kt @@ -16,7 +16,5 @@ class PFAPainDiaryApplication : Application(), Configuration.Provider { BackupManager.backupRestorer = BackupRestorer() } - override fun getWorkManagerConfiguration(): Configuration { - return Configuration.Builder().setMinimumLoggingLevel(Log.INFO).build() - } + override val workManagerConfiguration = Configuration.Builder().setMinimumLoggingLevel(Log.INFO).build() } \ No newline at end of file diff --git a/app/src/main/java/org/secuso/privacyfriendlypaindiary/backup/BackupRestorer.kt b/app/src/main/java/org/secuso/privacyfriendlypaindiary/backup/BackupRestorer.kt index cd4aa06..0cc8947 100644 --- a/app/src/main/java/org/secuso/privacyfriendlypaindiary/backup/BackupRestorer.kt +++ b/app/src/main/java/org/secuso/privacyfriendlypaindiary/backup/BackupRestorer.kt @@ -38,7 +38,7 @@ class BackupRestorer : IBackupRestorer { version ).writableDatabase db.beginTransaction() - db.setVersion(version) + db.version = version readDatabaseContent(reader, db) db.setTransactionSuccessful() db.endTransaction() @@ -65,6 +65,7 @@ class BackupRestorer : IBackupRestorer { name, reader.nextBoolean() ) + "pref_reminder_time", "userID" -> prefEdit.putLong(name, reader.nextLong()) else -> throw RuntimeException("Unknown preference $name") } @@ -90,10 +91,12 @@ class BackupRestorer : IBackupRestorer { reader, pref ) + "preferences2" -> readPreferences( reader, pref2 ) + else -> throw RuntimeException("Can not parse type $type") } } diff --git a/build.gradle b/build.gradle index 646b43a..f0d6755 100644 --- a/build.gradle +++ b/build.gradle @@ -1,13 +1,13 @@ // Top-level build file where you can add configuration options common to all sub-projects/modules. buildscript { - ext.kotlin_version = '1.7.0' + ext.kotlin_version = '1.9.10' repositories { - jcenter() + mavenCentral() google() } dependencies { - classpath 'com.android.tools.build:gradle:8.1.2' + classpath 'com.android.tools.build:gradle:8.1.4' classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version" // NOTE: Do not place your application dependencies here; they belong @@ -15,13 +15,13 @@ buildscript { } } +plugins { + id 'com.google.devtools.ksp' version "$kotlin_version-1.0.13" apply false +} + allprojects { repositories { - jcenter() mavenCentral() - maven { - url "https://maven.google.com" - } google() } }