From f5973b1b01a9653af0fb266a5a9783d1c181cf70 Mon Sep 17 00:00:00 2001 From: Severiano Jaramillo Date: Sun, 28 Apr 2024 19:51:02 -0700 Subject: [PATCH] Convert preferences module to Android library --- .fleet/receipt.json | 24 -------------- .fleet/run.json | 5 --- .fleet/settings.json | 3 -- app/build.gradle.kts | 4 +-- .../net/agorise/kee/MainActivity.kt | 0 .../kee/ui/component/nodestatus/NodeStatus.kt | 0 .../kee/ui/component/topappbar/TopAppBar.kt | 0 .../agorise/kee/ui/screen/home/HomeScreen.kt | 0 .../importaccount/ImportAccountScreen.kt | 0 .../importaccount/ImportAccountScreenModel.kt | 0 .../net/agorise/kee/ui/theme/Color.kt | 0 .../net/agorise/kee/ui/theme/Theme.kt | 0 build.gradle.kts | 2 +- gradle/libs.versions.toml | 2 +- .../preferences/build.gradle.kts | 32 ++++++------------- .../shared/preferences/KeePreferences.kt | 0 settings.gradle.kts | 2 +- 17 files changed, 14 insertions(+), 60 deletions(-) delete mode 100644 .fleet/receipt.json delete mode 100644 .fleet/run.json delete mode 100644 .fleet/settings.json rename app/src/main/{java => kotlin}/net/agorise/kee/MainActivity.kt (100%) rename app/src/main/{java => kotlin}/net/agorise/kee/ui/component/nodestatus/NodeStatus.kt (100%) rename app/src/main/{java => kotlin}/net/agorise/kee/ui/component/topappbar/TopAppBar.kt (100%) rename app/src/main/{java => kotlin}/net/agorise/kee/ui/screen/home/HomeScreen.kt (100%) rename app/src/main/{java => kotlin}/net/agorise/kee/ui/screen/importaccount/ImportAccountScreen.kt (100%) rename app/src/main/{java => kotlin}/net/agorise/kee/ui/screen/importaccount/ImportAccountScreenModel.kt (100%) rename app/src/main/{java => kotlin}/net/agorise/kee/ui/theme/Color.kt (100%) rename app/src/main/{java => kotlin}/net/agorise/kee/ui/theme/Theme.kt (100%) rename {shared => library}/preferences/build.gradle.kts (52%) rename {shared/preferences/src/commonMain => library/preferences/src/main}/kotlin/net/agorise/shared/preferences/KeePreferences.kt (100%) diff --git a/.fleet/receipt.json b/.fleet/receipt.json deleted file mode 100644 index 064059e..0000000 --- a/.fleet/receipt.json +++ /dev/null @@ -1,24 +0,0 @@ -// Project generated by Kotlin Multiplatform Wizard -{ - "spec": { - "template_id": "kmt", - "targets": { - "android": { - "ui": [ - "compose" - ] - }, - "ios": { - "ui": [ - "compose" - ] - }, - "desktop": { - "ui": [ - "compose" - ] - } - } - }, - "timestamp": "2024-03-04T14:16:27.193356112Z" -} \ No newline at end of file diff --git a/.fleet/run.json b/.fleet/run.json deleted file mode 100644 index 822a3ba..0000000 --- a/.fleet/run.json +++ /dev/null @@ -1,5 +0,0 @@ -{ - "configurations": [ - - ] -} \ No newline at end of file diff --git a/.fleet/settings.json b/.fleet/settings.json deleted file mode 100644 index 7b945d7..0000000 --- a/.fleet/settings.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "run.destination.stop.already.running": "Always" -} \ No newline at end of file diff --git a/app/build.gradle.kts b/app/build.gradle.kts index a495fed..e1c7cfa 100644 --- a/app/build.gradle.kts +++ b/app/build.gradle.kts @@ -1,6 +1,6 @@ plugins { alias(libs.plugins.androidApplication) - alias(libs.plugins.jetbrainsKotlinAndroid) + alias(libs.plugins.kotlinAndroid) } android { @@ -50,7 +50,7 @@ android { } dependencies { - implementation(projects.shared.preferences) + implementation(projects.library.preferences) implementation(projects.shared.stargate) implementation(platform(libs.compose.bom)) diff --git a/app/src/main/java/net/agorise/kee/MainActivity.kt b/app/src/main/kotlin/net/agorise/kee/MainActivity.kt similarity index 100% rename from app/src/main/java/net/agorise/kee/MainActivity.kt rename to app/src/main/kotlin/net/agorise/kee/MainActivity.kt diff --git a/app/src/main/java/net/agorise/kee/ui/component/nodestatus/NodeStatus.kt b/app/src/main/kotlin/net/agorise/kee/ui/component/nodestatus/NodeStatus.kt similarity index 100% rename from app/src/main/java/net/agorise/kee/ui/component/nodestatus/NodeStatus.kt rename to app/src/main/kotlin/net/agorise/kee/ui/component/nodestatus/NodeStatus.kt diff --git a/app/src/main/java/net/agorise/kee/ui/component/topappbar/TopAppBar.kt b/app/src/main/kotlin/net/agorise/kee/ui/component/topappbar/TopAppBar.kt similarity index 100% rename from app/src/main/java/net/agorise/kee/ui/component/topappbar/TopAppBar.kt rename to app/src/main/kotlin/net/agorise/kee/ui/component/topappbar/TopAppBar.kt diff --git a/app/src/main/java/net/agorise/kee/ui/screen/home/HomeScreen.kt b/app/src/main/kotlin/net/agorise/kee/ui/screen/home/HomeScreen.kt similarity index 100% rename from app/src/main/java/net/agorise/kee/ui/screen/home/HomeScreen.kt rename to app/src/main/kotlin/net/agorise/kee/ui/screen/home/HomeScreen.kt diff --git a/app/src/main/java/net/agorise/kee/ui/screen/importaccount/ImportAccountScreen.kt b/app/src/main/kotlin/net/agorise/kee/ui/screen/importaccount/ImportAccountScreen.kt similarity index 100% rename from app/src/main/java/net/agorise/kee/ui/screen/importaccount/ImportAccountScreen.kt rename to app/src/main/kotlin/net/agorise/kee/ui/screen/importaccount/ImportAccountScreen.kt diff --git a/app/src/main/java/net/agorise/kee/ui/screen/importaccount/ImportAccountScreenModel.kt b/app/src/main/kotlin/net/agorise/kee/ui/screen/importaccount/ImportAccountScreenModel.kt similarity index 100% rename from app/src/main/java/net/agorise/kee/ui/screen/importaccount/ImportAccountScreenModel.kt rename to app/src/main/kotlin/net/agorise/kee/ui/screen/importaccount/ImportAccountScreenModel.kt diff --git a/app/src/main/java/net/agorise/kee/ui/theme/Color.kt b/app/src/main/kotlin/net/agorise/kee/ui/theme/Color.kt similarity index 100% rename from app/src/main/java/net/agorise/kee/ui/theme/Color.kt rename to app/src/main/kotlin/net/agorise/kee/ui/theme/Color.kt diff --git a/app/src/main/java/net/agorise/kee/ui/theme/Theme.kt b/app/src/main/kotlin/net/agorise/kee/ui/theme/Theme.kt similarity index 100% rename from app/src/main/java/net/agorise/kee/ui/theme/Theme.kt rename to app/src/main/kotlin/net/agorise/kee/ui/theme/Theme.kt diff --git a/build.gradle.kts b/build.gradle.kts index 3e249e6..f025cb8 100644 --- a/build.gradle.kts +++ b/build.gradle.kts @@ -5,5 +5,5 @@ plugins { alias(libs.plugins.androidLibrary) apply false alias(libs.plugins.jetbrainsCompose) apply false alias(libs.plugins.kotlinMultiplatform) apply false - alias(libs.plugins.jetbrainsKotlinAndroid) apply false + alias(libs.plugins.kotlinAndroid) apply false } \ No newline at end of file diff --git a/gradle/libs.versions.toml b/gradle/libs.versions.toml index 2f03127..5d4d378 100644 --- a/gradle/libs.versions.toml +++ b/gradle/libs.versions.toml @@ -42,4 +42,4 @@ androidApplication = { id = "com.android.application", version.ref = "agp" } androidLibrary = { id = "com.android.library", version.ref = "agp" } jetbrainsCompose = { id = "org.jetbrains.compose", version.ref = "compose-plugin" } kotlinMultiplatform = { id = "org.jetbrains.kotlin.multiplatform", version.ref = "kotlin" } -jetbrainsKotlinAndroid = { id = "org.jetbrains.kotlin.android", version.ref = "kotlin" } +kotlinAndroid = { id = "org.jetbrains.kotlin.android", version.ref = "kotlin" } diff --git a/shared/preferences/build.gradle.kts b/library/preferences/build.gradle.kts similarity index 52% rename from shared/preferences/build.gradle.kts rename to library/preferences/build.gradle.kts index e0a7e98..ed85789 100644 --- a/shared/preferences/build.gradle.kts +++ b/library/preferences/build.gradle.kts @@ -1,28 +1,6 @@ plugins { - alias(libs.plugins.kotlinMultiplatform) alias(libs.plugins.androidLibrary) -} - -kotlin { - androidTarget { - compilations.all { - kotlinOptions { - jvmTarget = "11" - } - } - } - - jvm() - - iosX64() - iosArm64() - iosSimulatorArm64() - - sourceSets { - commonMain.dependencies { - implementation(libs.multiplatform.settings) - } - } + alias(libs.plugins.kotlinAndroid) } android { @@ -37,4 +15,12 @@ android { sourceCompatibility = JavaVersion.VERSION_11 targetCompatibility = JavaVersion.VERSION_11 } + + kotlinOptions { + jvmTarget = "11" + } +} + +dependencies { + implementation(libs.multiplatform.settings) } diff --git a/shared/preferences/src/commonMain/kotlin/net/agorise/shared/preferences/KeePreferences.kt b/library/preferences/src/main/kotlin/net/agorise/shared/preferences/KeePreferences.kt similarity index 100% rename from shared/preferences/src/commonMain/kotlin/net/agorise/shared/preferences/KeePreferences.kt rename to library/preferences/src/main/kotlin/net/agorise/shared/preferences/KeePreferences.kt diff --git a/settings.gradle.kts b/settings.gradle.kts index e1ba684..fe5acb5 100644 --- a/settings.gradle.kts +++ b/settings.gradle.kts @@ -20,5 +20,5 @@ dependencyResolutionManagement { include(":app") include(":shared:crypto") -include(":shared:preferences") +include(":library:preferences") include(":shared:stargate")