From 3f983633fe3d0b4522ea3e4ee4ca7ccd23cf3a26 Mon Sep 17 00:00:00 2001 From: Erik Eelde Date: Sat, 30 Sep 2023 08:58:21 +0200 Subject: [PATCH] More fixi --- build-logic/conventions/build.gradle.kts | 1 + build.gradle.kts | 3 +-- gradle/libs.versions.toml | 8 ++++---- modules/applications/build.gradle.kts | 3 ++- modules/booleanconfiguration/build.gradle.kts | 3 ++- modules/configurations/build.gradle.kts | 3 ++- modules/database/build.gradle.kts | 3 ++- modules/enumconfiguration/build.gradle.kts | 3 ++- modules/help/build.gradle.kts | 3 ++- modules/integerconfiguration/build.gradle.kts | 3 ++- modules/provider/build.gradle.kts | 3 ++- modules/stringconfiguration/build.gradle.kts | 3 ++- toggles-app/build.gradle.kts | 9 +++++---- toggles-core/api/toggles-core.api | 16 ++++++++++++++++ .../se/eelde/toggles/prefs/TogglesPreferences.kt | 8 ++++---- .../toggles/prefs/TogglesPreferencesImpl.kt | 1 - 16 files changed, 49 insertions(+), 24 deletions(-) diff --git a/build-logic/conventions/build.gradle.kts b/build-logic/conventions/build.gradle.kts index 5826a3fb..3349beba 100644 --- a/build-logic/conventions/build.gradle.kts +++ b/build-logic/conventions/build.gradle.kts @@ -15,6 +15,7 @@ dependencies { implementation(libs.io.gitlab.arturbosch.detekt.detekt.gradle.plugin) implementation(libs.com.android.tools.build.gradle) implementation(libs.org.jetbrains.kotlin.kotlin.gradle.plugin) + implementation("com.google.devtools.ksp:com.google.devtools.ksp.gradle.plugin:1.9.10-1.0.13") // https://github.com/gradle/gradle/issues/15383 implementation(files(libs.javaClass.superclass.protectionDomain.codeSource.location)) diff --git a/build.gradle.kts b/build.gradle.kts index 659b875b..ae119cd9 100644 --- a/build.gradle.kts +++ b/build.gradle.kts @@ -25,8 +25,7 @@ plugins { // https://github.com/Kotlin/KEEP/blob/master/proposals/explicit-api-mode.md alias(libs.plugins.com.github.triplet.play) apply (false) id("toggles.ownership-conventions") - alias(libs.plugins.com.android.library) apply false - alias(libs.plugins.org.jetbrains.kotlin.android) apply false + id("com.google.devtools.ksp") version "1.9.10-1.0.13" apply false } fun isNonStable(version: String): Boolean { diff --git a/gradle/libs.versions.toml b/gradle/libs.versions.toml index 14725e8b..224dc043 100644 --- a/gradle/libs.versions.toml +++ b/gradle/libs.versions.toml @@ -13,12 +13,12 @@ androidx-room = "2.6.0-alpha03" androidx-savedstate = "1.2.1" androidx-test = "1.5.0" androidx-vectordrawable = "1.1.0" -com-google-dagger = "2.47" +com-google-dagger = "2.48" com-squareup-leakcanary = "2.8.1" com-squareup-moshi = "1.15.0" dokka = "1.8.20" kotlin = "1.9.10" -org-jetbrains-kotlinx = "1.7.1" +org-jetbrains-kotlinx = "1.7.3" agp = "8.1.2" org-jetbrains-kotlin-android = "1.9.0" junit = "4.13.2" @@ -195,11 +195,11 @@ material = { group = "com.google.android.material", name = "material", version.r com-github-ben-manes-versions = "com.github.ben-manes.versions:0.47.0" com-github-triplet-play = "com.github.triplet.play:3.8.4" com-gladed-androidgitversion = "com.gladed.androidgitversion:0.4.14" -com-google-dagger-hilt-android = "com.google.dagger.hilt.android:2.47" +com-google-dagger-hilt-android = { id = "com.google.dagger.hilt.android", version.ref = "com-google-dagger" } com-google-firebase-crashlytics = "com.google.firebase.crashlytics:2.9.8" com-google-gms-google-services = "com.google.gms.google-services:4.3.15" com-vanniktech-maven-publish = "com.vanniktech.maven.publish:0.25.3" -dagger-hilt-android-plugin = "dagger.hilt.android.plugin:2.47" +dagger-hilt-android-plugin = { id = "dagger.hilt.android.plugin:2.48", version.ref = "com-google-dagger" } nl-littlerobots-version-catalog-update = "nl.littlerobots.version-catalog-update:0.8.1" org-jetbrains-dokka = { id = "org.jetbrains.dokka", version.ref = "dokka" } org-jetbrains-kotlinx-binary-compatibility-validator = "org.jetbrains.kotlinx.binary-compatibility-validator:0.13.2" diff --git a/modules/applications/build.gradle.kts b/modules/applications/build.gradle.kts index c5d422c8..41e51775 100644 --- a/modules/applications/build.gradle.kts +++ b/modules/applications/build.gradle.kts @@ -1,6 +1,7 @@ plugins { id("toggles.android.module-conventions") id("toggles.ownership-conventions") + id("com.google.devtools.ksp") } android { @@ -27,5 +28,5 @@ dependencies { implementation(libs.androidx.compose.ui.ui.tooling.preview) implementation(libs.androidx.startup.startup.runtime) implementation(libs.com.google.dagger.hilt.android) - kapt(libs.com.google.dagger.hilt.compiler) + ksp(libs.com.google.dagger.hilt.compiler) } \ No newline at end of file diff --git a/modules/booleanconfiguration/build.gradle.kts b/modules/booleanconfiguration/build.gradle.kts index 50d3d89d..d9d37f39 100644 --- a/modules/booleanconfiguration/build.gradle.kts +++ b/modules/booleanconfiguration/build.gradle.kts @@ -1,6 +1,7 @@ plugins { id("toggles.android.module-conventions") id("toggles.ownership-conventions") + id("com.google.devtools.ksp") } android { @@ -29,5 +30,5 @@ dependencies { implementation(libs.androidx.startup.startup.runtime) implementation(libs.com.google.dagger.hilt.android) implementation(libs.se.eelde.toggles.toggles.core) - kapt(libs.com.google.dagger.hilt.compiler) + ksp(libs.com.google.dagger.hilt.compiler) } \ No newline at end of file diff --git a/modules/configurations/build.gradle.kts b/modules/configurations/build.gradle.kts index 8db64397..d920d38c 100644 --- a/modules/configurations/build.gradle.kts +++ b/modules/configurations/build.gradle.kts @@ -1,6 +1,7 @@ plugins { id("toggles.android.module-conventions") id("toggles.ownership-conventions") + id("com.google.devtools.ksp") } android { @@ -30,5 +31,5 @@ dependencies { implementation(libs.androidx.compose.ui.ui.tooling.preview) implementation(libs.androidx.startup.startup.runtime) implementation(libs.com.google.dagger.hilt.android) - kapt(libs.com.google.dagger.hilt.compiler) + ksp(libs.com.google.dagger.hilt.compiler) } \ No newline at end of file diff --git a/modules/database/build.gradle.kts b/modules/database/build.gradle.kts index d43d1ebe..730f2c2d 100644 --- a/modules/database/build.gradle.kts +++ b/modules/database/build.gradle.kts @@ -1,6 +1,7 @@ plugins { id("toggles.android.module-conventions") id("toggles.ownership-conventions") + id("com.google.devtools.ksp") } class RoomSchemaArgProvider( @@ -43,7 +44,7 @@ dependencies { implementation(libs.androidx.room.room.paging) implementation(libs.androidx.room.room.runtime) implementation(libs.androidx.room.room.ktx) - kapt(libs.androidx.room.room.compiler) + ksp(libs.androidx.room.room.compiler) implementation(libs.se.eelde.toggles.toggles.core) implementation(libs.androidx.core.core.ktx) implementation(libs.androidx.appcompat) diff --git a/modules/enumconfiguration/build.gradle.kts b/modules/enumconfiguration/build.gradle.kts index 50d3d89d..d9d37f39 100644 --- a/modules/enumconfiguration/build.gradle.kts +++ b/modules/enumconfiguration/build.gradle.kts @@ -1,6 +1,7 @@ plugins { id("toggles.android.module-conventions") id("toggles.ownership-conventions") + id("com.google.devtools.ksp") } android { @@ -29,5 +30,5 @@ dependencies { implementation(libs.androidx.startup.startup.runtime) implementation(libs.com.google.dagger.hilt.android) implementation(libs.se.eelde.toggles.toggles.core) - kapt(libs.com.google.dagger.hilt.compiler) + ksp(libs.com.google.dagger.hilt.compiler) } \ No newline at end of file diff --git a/modules/help/build.gradle.kts b/modules/help/build.gradle.kts index 762c9503..bef1b2e1 100644 --- a/modules/help/build.gradle.kts +++ b/modules/help/build.gradle.kts @@ -1,6 +1,7 @@ plugins { id("toggles.android.module-conventions") id("toggles.ownership-conventions") + id("com.google.devtools.ksp") } android { @@ -26,5 +27,5 @@ dependencies { implementation(libs.androidx.compose.ui.ui.tooling.preview) implementation(libs.androidx.startup.startup.runtime) implementation(libs.com.google.dagger.hilt.android) - kapt(libs.com.google.dagger.hilt.compiler) + ksp(libs.com.google.dagger.hilt.compiler) } \ No newline at end of file diff --git a/modules/integerconfiguration/build.gradle.kts b/modules/integerconfiguration/build.gradle.kts index 50d3d89d..d9d37f39 100644 --- a/modules/integerconfiguration/build.gradle.kts +++ b/modules/integerconfiguration/build.gradle.kts @@ -1,6 +1,7 @@ plugins { id("toggles.android.module-conventions") id("toggles.ownership-conventions") + id("com.google.devtools.ksp") } android { @@ -29,5 +30,5 @@ dependencies { implementation(libs.androidx.startup.startup.runtime) implementation(libs.com.google.dagger.hilt.android) implementation(libs.se.eelde.toggles.toggles.core) - kapt(libs.com.google.dagger.hilt.compiler) + ksp(libs.com.google.dagger.hilt.compiler) } \ No newline at end of file diff --git a/modules/provider/build.gradle.kts b/modules/provider/build.gradle.kts index 1e3705f3..3b12ae51 100644 --- a/modules/provider/build.gradle.kts +++ b/modules/provider/build.gradle.kts @@ -1,6 +1,7 @@ plugins { id("toggles.android.module-conventions") id("toggles.ownership-conventions") + id("com.google.devtools.ksp") } android { @@ -30,5 +31,5 @@ dependencies { implementation(libs.androidx.compose.ui.ui.tooling.preview) implementation(libs.androidx.startup.startup.runtime) implementation(libs.com.google.dagger.hilt.android) - kapt(libs.com.google.dagger.hilt.compiler) + ksp(libs.com.google.dagger.hilt.compiler) } \ No newline at end of file diff --git a/modules/stringconfiguration/build.gradle.kts b/modules/stringconfiguration/build.gradle.kts index 50d3d89d..d9d37f39 100644 --- a/modules/stringconfiguration/build.gradle.kts +++ b/modules/stringconfiguration/build.gradle.kts @@ -1,6 +1,7 @@ plugins { id("toggles.android.module-conventions") id("toggles.ownership-conventions") + id("com.google.devtools.ksp") } android { @@ -29,5 +30,5 @@ dependencies { implementation(libs.androidx.startup.startup.runtime) implementation(libs.com.google.dagger.hilt.android) implementation(libs.se.eelde.toggles.toggles.core) - kapt(libs.com.google.dagger.hilt.compiler) + ksp(libs.com.google.dagger.hilt.compiler) } \ No newline at end of file diff --git a/toggles-app/build.gradle.kts b/toggles-app/build.gradle.kts index fb809d4a..e0bea97d 100644 --- a/toggles-app/build.gradle.kts +++ b/toggles-app/build.gradle.kts @@ -10,6 +10,7 @@ plugins { id("com.google.firebase.crashlytics") id("app.cash.licensee") id("se.premex.gross") version "0.1.0" + id("com.google.devtools.ksp") } val versionFile = File("versions.properties") @@ -143,16 +144,16 @@ dependencies { implementation(libs.com.google.firebase.firebase.analytics.ktx) implementation(libs.com.google.dagger.hilt.android) - kapt(libs.com.google.dagger.hilt.android.compiler) - kapt(libs.androidx.hilt.hilt.compiler) + ksp(libs.com.google.dagger.hilt.android.compiler) + ksp(libs.androidx.hilt.hilt.compiler) testImplementation(libs.com.google.dagger.hilt.android.testing) - kaptTest(libs.com.google.dagger.hilt.android.compiler) + kspTest(libs.com.google.dagger.hilt.android.compiler) implementation(libs.androidx.lifecycle.lifecycle.common.java8) implementation(libs.com.google.dagger) - kapt(libs.com.google.dagger.dagger.compiler) + ksp(libs.com.google.dagger.dagger.compiler) implementation(libs.androidx.appcompat) implementation(libs.androidx.recyclerview) diff --git a/toggles-core/api/toggles-core.api b/toggles-core/api/toggles-core.api index af57db77..96fd5ce3 100644 --- a/toggles-core/api/toggles-core.api +++ b/toggles-core/api/toggles-core.api @@ -20,6 +20,8 @@ public final class se/eelde/toggles/core/ColumnNames$ToggleValue { public final class se/eelde/toggles/core/Toggle { public static final field Companion Lse/eelde/toggles/core/Toggle$Companion; public synthetic fun (JLjava/lang/String;Ljava/lang/String;Ljava/lang/String;Lkotlin/jvm/internal/DefaultConstructorMarker;)V + public final fun copy (JLjava/lang/String;Ljava/lang/String;Ljava/lang/String;)Lse/eelde/toggles/core/Toggle; + public static synthetic fun copy$default (Lse/eelde/toggles/core/Toggle;JLjava/lang/String;Ljava/lang/String;Ljava/lang/String;ILjava/lang/Object;)Lse/eelde/toggles/core/Toggle; public fun equals (Ljava/lang/Object;)Z public static final fun fromContentValues (Landroid/content/ContentValues;)Lse/eelde/toggles/core/Toggle; public static final fun fromCursor (Landroid/database/Cursor;)Lse/eelde/toggles/core/Toggle; @@ -36,10 +38,18 @@ public final class se/eelde/toggles/core/Toggle { public final class se/eelde/toggles/core/Toggle$Builder { public fun ()V public final fun build ()Lse/eelde/toggles/core/Toggle; + public final fun getId ()J + public final fun getKey ()Ljava/lang/String; + public final fun getType ()Ljava/lang/String; + public final fun getValue ()Ljava/lang/String; public final fun setId (J)Lse/eelde/toggles/core/Toggle$Builder; + public final synthetic fun setId (J)V public final fun setKey (Ljava/lang/String;)Lse/eelde/toggles/core/Toggle$Builder; + public final synthetic fun setKey (Ljava/lang/String;)V public final fun setType (Ljava/lang/String;)Lse/eelde/toggles/core/Toggle$Builder; + public final synthetic fun setType (Ljava/lang/String;)V public final fun setValue (Ljava/lang/String;)Lse/eelde/toggles/core/Toggle$Builder; + public final synthetic fun setValue (Ljava/lang/String;)V } public final class se/eelde/toggles/core/Toggle$Companion { @@ -72,9 +82,15 @@ public final class se/eelde/toggles/core/ToggleValue { public final class se/eelde/toggles/core/ToggleValue$Builder { public fun ()V public final fun build ()Lse/eelde/toggles/core/ToggleValue; + public final fun getConfigurationId ()J + public final fun getId ()J + public final fun getValue ()Ljava/lang/String; public final fun setConfigurationId (J)Lse/eelde/toggles/core/ToggleValue$Builder; + public final synthetic fun setConfigurationId (J)V public final fun setId (J)Lse/eelde/toggles/core/ToggleValue$Builder; + public final synthetic fun setId (J)V public final fun setValue (Ljava/lang/String;)Lse/eelde/toggles/core/ToggleValue$Builder; + public final synthetic fun setValue (Ljava/lang/String;)V } public final class se/eelde/toggles/core/TogglesProviderContract { diff --git a/toggles-prefs-noop/src/main/java/se/eelde/toggles/prefs/TogglesPreferences.kt b/toggles-prefs-noop/src/main/java/se/eelde/toggles/prefs/TogglesPreferences.kt index d26568a1..54e1b618 100644 --- a/toggles-prefs-noop/src/main/java/se/eelde/toggles/prefs/TogglesPreferences.kt +++ b/toggles-prefs-noop/src/main/java/se/eelde/toggles/prefs/TogglesPreferences.kt @@ -2,8 +2,8 @@ package se.eelde.toggles.prefs @Suppress("LibraryEntitiesShouldNotBePublic") public interface TogglesPreferences { - fun getBoolean(key: String, defValue: Boolean): Boolean - fun getInt(key: String, defValue: Int): Int - fun getString(key: String, defValue: String): String - fun > getEnum(key: String, type: Class, defValue: T): T + public fun getBoolean(key: String, defValue: Boolean): Boolean + public fun getInt(key: String, defValue: Int): Int + public fun getString(key: String, defValue: String): String + public fun > getEnum(key: String, type: Class, defValue: T): T } diff --git a/toggles-prefs/src/main/java/se/eelde/toggles/prefs/TogglesPreferencesImpl.kt b/toggles-prefs/src/main/java/se/eelde/toggles/prefs/TogglesPreferencesImpl.kt index 3569644f..fe1e50b3 100644 --- a/toggles-prefs/src/main/java/se/eelde/toggles/prefs/TogglesPreferencesImpl.kt +++ b/toggles-prefs/src/main/java/se/eelde/toggles/prefs/TogglesPreferencesImpl.kt @@ -12,7 +12,6 @@ public class TogglesPreferencesImpl(context: Context) : TogglesPreferences { private val context = context.applicationContext private val contentResolver: ContentResolver = this.context.contentResolver - override fun getBoolean(key: String, defValue: Boolean): Boolean { var toggle = getToggle( contentResolver = contentResolver,