Skip to content

Commit

Permalink
Merge pull request #1 from doTTTTT/feature/room-alpha06
Browse files Browse the repository at this point in the history
Feature/room alpha06
  • Loading branch information
doTTTTT authored Aug 12, 2024
2 parents 57cbeae + 48bb4af commit 7b288ba
Show file tree
Hide file tree
Showing 5 changed files with 81 additions and 88 deletions.
13 changes: 6 additions & 7 deletions build.gradle.kts
Original file line number Diff line number Diff line change
@@ -1,10 +1,9 @@
plugins {
//trick: for the same plugin versions in all sub-modules
alias(libs.plugins.androidApplication).apply(false)
alias(libs.plugins.androidLibrary).apply(false)
alias(libs.plugins.kotlinAndroid).apply(false)
alias(libs.plugins.kotlinMultiplatform).apply(false)
alias(libs.plugins.kotlin.compose.compiler).apply(false)
alias(libs.plugins.android.application).apply(false)
alias(libs.plugins.android.library).apply(false)

kotlin("native.cocoapods") version "2.0.0" apply false
alias(libs.plugins.kotlin.android).apply(false)
alias(libs.plugins.kotlin.multiplatform).apply(false)
alias(libs.plugins.kotlin.compose.compiler).apply(false)
alias(libs.plugins.kotlin.cocoapods).apply(false)
}
10 changes: 5 additions & 5 deletions composeApp/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,13 @@ import org.jetbrains.kotlin.gradle.dsl.JvmTarget
import org.jetbrains.kotlin.gradle.plugin.mpp.NativeBuildType

plugins {
alias(libs.plugins.kotlinMultiplatform)
alias(libs.plugins.androidApplication)
alias(libs.plugins.android.application)

alias(libs.plugins.kotlin.multiplatform)
alias(libs.plugins.kotlin.compose.core)
alias(libs.plugins.kotlin.compose.compiler)
alias(libs.plugins.kotlin.serialization)

kotlin("native.cocoapods") version "2.0.0"
alias(libs.plugins.kotlin.cocoapods)
}

kotlin {
Expand Down Expand Up @@ -56,7 +56,7 @@ kotlin {
}
commonMain.dependencies {

implementation(libs.lorraine)
implementation(projects.lorraine)

implementation(compose.runtime)
implementation(compose.foundation)
Expand Down
72 changes: 45 additions & 27 deletions gradle/libs.versions.toml
Original file line number Diff line number Diff line change
@@ -1,33 +1,37 @@
[versions]
agp = "8.4.1"
kotlin = "2.0.0"
ktor = "2.3.11"
agp = "8.4.2"
android-compileSdk = "34"
android-minSdk = "24"
android-targetSdk = "34"
androidx-room = "2.7.0-alpha06"
androidx-sqlite = "2.5.0-alpha06"
androidx-work = "2.9.1"
kotlin-core = "2.0.0"
kotlin-compose = "1.6.11"
kotlin-coroutine = "1.9.0-RC"
kotlin-serialization = "1.7.0"
ktor = "2.3.12"
ksp = "2.0.0-1.0.24"
compose = "1.6.8"
compose-compiler = "1.5.4"
compose-material3 = "1.2.1"
connectivity = "1.1.0"
androidx-activityCompose = "1.9.0"
androidx-activityCompose = "1.9.1"
lifecycleViewmodel = "2.8.0"
lorraine = "0.0.1"
android-compileSdk = "34"
android-minSdk = "24"
android-targetSdk = "34"
navigationCompose = "2.7.0-alpha07"
publish = "0.29.0"
squareup-okio = "3.9.0"

[libraries]
androidx-activity-compose = { module = "androidx.activity:activity-compose", version.ref = "androidx-activityCompose" }
androidx-room-runtime = { module = "androidx.room:room-runtime", version.ref = "androidx-room" }
androidx-room-compiler = { module = "androidx.room:room-compiler", version.ref = "androidx-room" }
androidx-sqlite = { module = "androidx.sqlite:sqlite-bundled", version.ref = "androidx-sqlite" }
androidx-work-runtime = { module = "androidx.work:work-runtime-ktx", version.ref = "androidx-work" }

compose-ui = { module = "androidx.compose.ui:ui", version.ref = "compose" }
compose-ui-tooling = { module = "androidx.compose.ui:ui-tooling", version.ref = "compose" }
compose-ui-tooling-preview = { module = "androidx.compose.ui:ui-tooling-preview", version.ref = "compose" }
compose-foundation = { module = "androidx.compose.foundation:foundation", version.ref = "compose" }
compose-material3 = { module = "androidx.compose.material3:material3", version.ref = "compose-material3" }

connectivity-core = { module = "dev.jordond.connectivity:connectivity-core", version.ref = "connectivity" }
connectivity-device = { module = "dev.jordond.connectivity:connectivity-device", version.ref = "connectivity" }
connectivity-apple = { module = "dev.jordond.connectivity:connectivity-apple", version.ref = "connectivity" }

kotlin-test = { module = "org.jetbrains.kotlin:kotlin-test", version.ref = "kotlin" }
kotlin-test = { module = "org.jetbrains.kotlin:kotlin-test", version.ref = "kotlin-core" }
kotlin-coroutine-core = { module = "org.jetbrains.kotlinx:kotlinx-coroutines-core", version.ref = "kotlin-coroutine" }
kotlin-serialization-core = { module = "org.jetbrains.kotlinx:kotlinx-serialization-json", version.ref = "kotlin-serialization" }

ktor-core = { group = "io.ktor", name = "ktor-client-core", version.ref = "ktor" }
ktor-serializarion = { group = "io.ktor", name = "ktor-serialization-kotlinx-json", version.ref = "ktor"}
Expand All @@ -41,12 +45,26 @@ kotlin-navigation-compose = { module = "org.jetbrains.androidx.navigation:naviga

lorraine = { module = "io.github.dottttt.lorraine:lorraine", version.ref = "lorraine" }

squareup-okio = { module = "com.squareup.okio:okio", version.ref = "squareup-okio" }

[bundles]

test-unit = ["kotlin-test"]

[plugins]
androidApplication = { id = "com.android.application", version.ref = "agp" }
androidLibrary = { id = "com.android.library", version.ref = "agp" }
kotlinAndroid = { id = "org.jetbrains.kotlin.android", version.ref = "kotlin" }
kotlinMultiplatform = { id = "org.jetbrains.kotlin.multiplatform", version.ref = "kotlin" }
kotlinCocoapods = { id = "org.jetbrains.kotlin.native.cocoapods", version.ref = "kotlin" }
kotlin-compose-core = { id = "org.jetbrains.compose", version = "1.6.11" }
kotlin-compose-compiler = { id = "org.jetbrains.kotlin.plugin.compose", version.ref = "kotlin" }
kotlin-serialization = { id = "org.jetbrains.kotlin.plugin.serialization", version.ref = "kotlin" }
android-application = { id = "com.android.application", version.ref = "agp" }
android-library = { id = "com.android.library", version.ref = "agp" }

androidx-room = { id = "androidx.room", version.ref = "androidx-room" }

kotlin-android = { id = "org.jetbrains.kotlin.android", version.ref = "kotlin-core" }
kotlin-multiplatform = { id = "org.jetbrains.kotlin.multiplatform", version.ref = "kotlin-core" }
kotlin-cocoapods = { id = "org.jetbrains.kotlin.native.cocoapods", version.ref = "kotlin-core" }
kotlin-compose-core = { id = "org.jetbrains.compose", version.ref = "kotlin-compose" }
kotlin-compose-compiler = { id = "org.jetbrains.kotlin.plugin.compose", version.ref = "kotlin-core" }
kotlin-serialization = { id = "org.jetbrains.kotlin.plugin.serialization", version.ref = "kotlin-core" }

ksp = { id = "com.google.devtools.ksp", version.ref = "ksp" }

publish = { id = "com.vanniktech.maven.publish", version.ref = "publish" }

68 changes: 22 additions & 46 deletions lorraine/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -3,28 +3,18 @@ import org.jetbrains.kotlin.gradle.ExperimentalKotlinGradlePluginApi
import org.jetbrains.kotlin.gradle.dsl.JvmTarget
import org.jetbrains.kotlin.gradle.plugin.mpp.NativeBuildType

val coroutineVersion = "1.9.0-RC"
val roomVersion = "2.7.0-alpha05"
val workVersion = "2.9.0"
val serializationVersion = "1.7.0"
val sqliteVersion = "2.5.0-alpha05"
val okioVersion = "3.8.0"

plugins {
id("org.jetbrains.kotlin.multiplatform") version "2.0.0"
id("org.jetbrains.kotlin.plugin.serialization") version "2.0.0"

id("com.google.devtools.ksp") version "2.0.0-1.0.24"
alias(libs.plugins.android.library)

id("com.android.library") version "8.4.1"
alias(libs.plugins.kotlin.multiplatform)
alias(libs.plugins.kotlin.serialization)
alias(libs.plugins.kotlin.cocoapods)

id("androidx.room") version "2.7.0-alpha05"
alias(libs.plugins.ksp)

kotlin("native.cocoapods").version("2.0.0")
alias(libs.plugins.androidx.room)

id("com.vanniktech.maven.publish") version "0.28.0"

`maven-publish`
alias(libs.plugins.publish)
}

group = "io.github.dottttt.lorraine"
Expand Down Expand Up @@ -54,15 +44,15 @@ kotlin {
iosSimulatorArm64()
).forEach {
it.binaries.framework {
baseName = "kmp-workmanager"
baseName = "lorraine"
isStatic = true
}
}

cocoapods {
version = "1.0"
summary = "Some description for a Kotlin/Native module"
homepage = "Link to a Kotlin/Native module homepage"
version = "0.0.1"
summary = "NO_DESCRIPTION"
homepage = "NO_HOMEPAGE"
ios.deploymentTarget = "15.0"

framework {
Expand All @@ -76,30 +66,24 @@ kotlin {
xcodeConfigurationToNativeBuildType["CUSTOM_RELEASE"] = NativeBuildType.RELEASE
}

//noinspection UseTomlInstead
sourceSets {
commonMain.dependencies {
implementation("org.jetbrains.kotlinx:kotlinx-coroutines-core:$coroutineVersion")
implementation("org.jetbrains.kotlinx:kotlinx-serialization-json:$serializationVersion")
implementation(libs.kotlin.coroutine.core)
implementation(libs.kotlin.serialization.core)

api("androidx.room:room-runtime:$roomVersion")
implementation(libs.androidx.room.runtime)

implementation("androidx.sqlite:sqlite-bundled:$sqliteVersion")
implementation("com.squareup.okio:okio:$okioVersion")
implementation(libs.androidx.sqlite)

// implementation(libs.connectivity.core)
// implementation(libs.connectivity.device)

implementation(kotlin("reflect"))
implementation(libs.squareup.okio)
}

commonTest.dependencies {
// implementation(libs.kotlin.test)
implementation(libs.bundles.test.unit)
}

androidMain.dependencies {
implementation("androidx.work:work-runtime-ktx:$workVersion")
}
iosMain.dependencies {
// implementation(libs.connectivity.apple)
implementation(libs.androidx.work.runtime)
}
}
}
Expand All @@ -111,9 +95,9 @@ room {
dependencies {
add(
"kspCommonMainMetadata",
"androidx.room:room-compiler:$roomVersion"
libs.androidx.room.compiler
) // Run KSP on [commonMain] code
add("kspAndroid", "androidx.room:room-compiler:$roomVersion")
add("kspAndroid", libs.androidx.room.compiler)
}

android {
Expand Down Expand Up @@ -195,12 +179,4 @@ mavenPublishing {

publishToMavenCentral(SonatypeHost.CENTRAL_PORTAL)
signAllPublications()
}

publishing {
repositories {
maven {

}
}
}
6 changes: 3 additions & 3 deletions lorraine/lorraine.podspec
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
Pod::Spec.new do |spec|
spec.name = 'lorraine'
spec.version = '1.0'
spec.homepage = 'Link to a Kotlin/Native module homepage'
spec.version = '0.0.1'
spec.homepage = 'NO_HOMEPAGE'
spec.source = { :http=> ''}
spec.authors = ''
spec.license = ''
spec.summary = 'Some description for a Kotlin/Native module'
spec.summary = 'NO_DESCRIPTION'
spec.vendored_frameworks = 'build/cocoapods/framework/Lorraine.framework'
spec.libraries = 'c++'
spec.ios.deployment_target = '15.0'
Expand Down

0 comments on commit 7b288ba

Please sign in to comment.