From 0e515f217c5fa40095335e29b2b574755f1cd34b Mon Sep 17 00:00:00 2001 From: Severiano Jaramillo Date: Mon, 29 Apr 2024 09:05:42 -0700 Subject: [PATCH] Convert stargate module to Jvm library --- app/build.gradle.kts | 2 +- build.gradle.kts | 1 + gradle/libs.versions.toml | 1 + library/stargate/build.gradle.kts | 14 ++++++ .../net/agorise/shared/stargate/DeroNode.kt | 0 .../agorise/shared/stargate/StargateBridge.kt | 0 .../shared/stargate/mnemonics/Mnemonics.kt | 0 .../stargate/mnemonics/MnemonicsEnglish.kt | 0 .../stargate/mnemonics/MnemonicsLanguage.kt | 0 .../stargate/mnemonics/MnemonicsSpanish.kt | 0 .../mnemonics/MnemonicsDataProvider.kt | 0 .../stargate/mnemonics/MnemonicsTest.kt | 0 settings.gradle.kts | 2 +- shared/stargate/build.gradle.kts | 49 ------------------- 14 files changed, 18 insertions(+), 51 deletions(-) create mode 100644 library/stargate/build.gradle.kts rename {shared/stargate/src/commonMain => library/stargate/src/main}/kotlin/net/agorise/shared/stargate/DeroNode.kt (100%) rename {shared/stargate/src/commonMain => library/stargate/src/main}/kotlin/net/agorise/shared/stargate/StargateBridge.kt (100%) rename {shared/stargate/src/commonMain => library/stargate/src/main}/kotlin/net/agorise/shared/stargate/mnemonics/Mnemonics.kt (100%) rename {shared/stargate/src/commonMain => library/stargate/src/main}/kotlin/net/agorise/shared/stargate/mnemonics/MnemonicsEnglish.kt (100%) rename {shared/stargate/src/commonMain => library/stargate/src/main}/kotlin/net/agorise/shared/stargate/mnemonics/MnemonicsLanguage.kt (100%) rename {shared/stargate/src/commonMain => library/stargate/src/main}/kotlin/net/agorise/shared/stargate/mnemonics/MnemonicsSpanish.kt (100%) rename {shared/stargate/src/commonTest => library/stargate/src/test}/kotlin/net/agorise/shared/stargate/mnemonics/MnemonicsDataProvider.kt (100%) rename {shared/stargate/src/commonTest => library/stargate/src/test}/kotlin/net/agorise/shared/stargate/mnemonics/MnemonicsTest.kt (100%) delete mode 100644 shared/stargate/build.gradle.kts diff --git a/app/build.gradle.kts b/app/build.gradle.kts index e1c7cfa..69a4f33 100644 --- a/app/build.gradle.kts +++ b/app/build.gradle.kts @@ -51,7 +51,7 @@ android { dependencies { implementation(projects.library.preferences) - implementation(projects.shared.stargate) + implementation(projects.library.stargate) implementation(platform(libs.compose.bom)) implementation(libs.androidx.activity.compose) diff --git a/build.gradle.kts b/build.gradle.kts index 6e8ab86..122aea9 100644 --- a/build.gradle.kts +++ b/build.gradle.kts @@ -5,4 +5,5 @@ plugins { alias(libs.plugins.androidLibrary) apply false alias(libs.plugins.kotlinMultiplatform) apply false alias(libs.plugins.kotlinAndroid) apply false + alias(libs.plugins.kotlinJvm) apply false } diff --git a/gradle/libs.versions.toml b/gradle/libs.versions.toml index 47ab3ed..b0b4f17 100644 --- a/gradle/libs.versions.toml +++ b/gradle/libs.versions.toml @@ -40,3 +40,4 @@ androidApplication = { id = "com.android.application", version.ref = "agp" } androidLibrary = { id = "com.android.library", version.ref = "agp" } kotlinMultiplatform = { id = "org.jetbrains.kotlin.multiplatform", version.ref = "kotlin" } kotlinAndroid = { id = "org.jetbrains.kotlin.android", version.ref = "kotlin" } +kotlinJvm = { id = "org.jetbrains.kotlin.jvm", version.ref = "kotlin" } diff --git a/library/stargate/build.gradle.kts b/library/stargate/build.gradle.kts new file mode 100644 index 0000000..46909b0 --- /dev/null +++ b/library/stargate/build.gradle.kts @@ -0,0 +1,14 @@ +plugins { + alias(libs.plugins.kotlinJvm) +} + +dependencies { + implementation(projects.shared.crypto) + + implementation(libs.cryptography.bigint) + implementation(libs.ktor.client.cio) + implementation(libs.ktor.client.core) + implementation(libs.ktor.client.websockets) + + testImplementation(libs.kotlin.test) +} diff --git a/shared/stargate/src/commonMain/kotlin/net/agorise/shared/stargate/DeroNode.kt b/library/stargate/src/main/kotlin/net/agorise/shared/stargate/DeroNode.kt similarity index 100% rename from shared/stargate/src/commonMain/kotlin/net/agorise/shared/stargate/DeroNode.kt rename to library/stargate/src/main/kotlin/net/agorise/shared/stargate/DeroNode.kt diff --git a/shared/stargate/src/commonMain/kotlin/net/agorise/shared/stargate/StargateBridge.kt b/library/stargate/src/main/kotlin/net/agorise/shared/stargate/StargateBridge.kt similarity index 100% rename from shared/stargate/src/commonMain/kotlin/net/agorise/shared/stargate/StargateBridge.kt rename to library/stargate/src/main/kotlin/net/agorise/shared/stargate/StargateBridge.kt diff --git a/shared/stargate/src/commonMain/kotlin/net/agorise/shared/stargate/mnemonics/Mnemonics.kt b/library/stargate/src/main/kotlin/net/agorise/shared/stargate/mnemonics/Mnemonics.kt similarity index 100% rename from shared/stargate/src/commonMain/kotlin/net/agorise/shared/stargate/mnemonics/Mnemonics.kt rename to library/stargate/src/main/kotlin/net/agorise/shared/stargate/mnemonics/Mnemonics.kt diff --git a/shared/stargate/src/commonMain/kotlin/net/agorise/shared/stargate/mnemonics/MnemonicsEnglish.kt b/library/stargate/src/main/kotlin/net/agorise/shared/stargate/mnemonics/MnemonicsEnglish.kt similarity index 100% rename from shared/stargate/src/commonMain/kotlin/net/agorise/shared/stargate/mnemonics/MnemonicsEnglish.kt rename to library/stargate/src/main/kotlin/net/agorise/shared/stargate/mnemonics/MnemonicsEnglish.kt diff --git a/shared/stargate/src/commonMain/kotlin/net/agorise/shared/stargate/mnemonics/MnemonicsLanguage.kt b/library/stargate/src/main/kotlin/net/agorise/shared/stargate/mnemonics/MnemonicsLanguage.kt similarity index 100% rename from shared/stargate/src/commonMain/kotlin/net/agorise/shared/stargate/mnemonics/MnemonicsLanguage.kt rename to library/stargate/src/main/kotlin/net/agorise/shared/stargate/mnemonics/MnemonicsLanguage.kt diff --git a/shared/stargate/src/commonMain/kotlin/net/agorise/shared/stargate/mnemonics/MnemonicsSpanish.kt b/library/stargate/src/main/kotlin/net/agorise/shared/stargate/mnemonics/MnemonicsSpanish.kt similarity index 100% rename from shared/stargate/src/commonMain/kotlin/net/agorise/shared/stargate/mnemonics/MnemonicsSpanish.kt rename to library/stargate/src/main/kotlin/net/agorise/shared/stargate/mnemonics/MnemonicsSpanish.kt diff --git a/shared/stargate/src/commonTest/kotlin/net/agorise/shared/stargate/mnemonics/MnemonicsDataProvider.kt b/library/stargate/src/test/kotlin/net/agorise/shared/stargate/mnemonics/MnemonicsDataProvider.kt similarity index 100% rename from shared/stargate/src/commonTest/kotlin/net/agorise/shared/stargate/mnemonics/MnemonicsDataProvider.kt rename to library/stargate/src/test/kotlin/net/agorise/shared/stargate/mnemonics/MnemonicsDataProvider.kt diff --git a/shared/stargate/src/commonTest/kotlin/net/agorise/shared/stargate/mnemonics/MnemonicsTest.kt b/library/stargate/src/test/kotlin/net/agorise/shared/stargate/mnemonics/MnemonicsTest.kt similarity index 100% rename from shared/stargate/src/commonTest/kotlin/net/agorise/shared/stargate/mnemonics/MnemonicsTest.kt rename to library/stargate/src/test/kotlin/net/agorise/shared/stargate/mnemonics/MnemonicsTest.kt diff --git a/settings.gradle.kts b/settings.gradle.kts index fe5acb5..9477365 100644 --- a/settings.gradle.kts +++ b/settings.gradle.kts @@ -21,4 +21,4 @@ dependencyResolutionManagement { include(":app") include(":shared:crypto") include(":library:preferences") -include(":shared:stargate") +include(":library:stargate") diff --git a/shared/stargate/build.gradle.kts b/shared/stargate/build.gradle.kts deleted file mode 100644 index becc940..0000000 --- a/shared/stargate/build.gradle.kts +++ /dev/null @@ -1,49 +0,0 @@ -plugins { - alias(libs.plugins.kotlinMultiplatform) - alias(libs.plugins.androidLibrary) -} - -kotlin { - androidTarget { - compilations.all { - kotlinOptions { - jvmTarget = "11" - } - } - } - - jvm() - - iosX64() - iosArm64() - iosSimulatorArm64() - - sourceSets { - commonMain.dependencies { - implementation(projects.shared.crypto) - - implementation(libs.cryptography.bigint) - implementation(libs.ktor.client.cio) - implementation(libs.ktor.client.core) - implementation(libs.ktor.client.websockets) - } - - commonTest.dependencies { - implementation(libs.kotlin.test) - } - } -} - -android { - namespace = "net.agorise.shared.stargate" - compileSdk = libs.versions.android.compileSdk.get().toInt() - - defaultConfig { - minSdk = libs.versions.android.minSdk.get().toInt() - } - - compileOptions { - sourceCompatibility = JavaVersion.VERSION_11 - targetCompatibility = JavaVersion.VERSION_11 - } -}