Skip to content

Commit

Permalink
kinject to kinject-core and created a bom
Browse files Browse the repository at this point in the history
  • Loading branch information
ScottPierce committed Jul 2, 2024
1 parent b875dba commit 2b2a817
Show file tree
Hide file tree
Showing 19 changed files with 56 additions and 7 deletions.
2 changes: 1 addition & 1 deletion benchmark/benchmark-shared/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ kotlin {

sourceSets {
commonMain.dependencies {
api(project(":kinject"))
api(project(":kinject-core"))
api(libs.koin.core)
}
}
Expand Down
2 changes: 1 addition & 1 deletion kinject-android/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,6 @@ android {
}

dependencies {
api(project(":kinject"))
api(project(":kinject-core"))
implementation(libs.androidx.lifecycle.viewmodel.android)
}
18 changes: 18 additions & 0 deletions kinject-bom/build.gradle.kts
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
plugins {
`java-platform`
alias(libs.plugins.gradleMavenPublish)
}

javaPlatform {
allowDependencies()
}

dependencies {
constraints {
api(project(":kinject-core"))
api(project(":kinject-android"))
api(project(":kinject-compose"))
api(project(":kinject-compose-viewmodel"))
api(project(":kinject-viewmodel"))
}
}
2 changes: 1 addition & 1 deletion kinject-compose/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,6 @@ composeCompiler {
}

dependencies {
implementation(project(":kinject"))
implementation(project(":kinject-core"))
implementation(libs.compose.runtime)
}
8 changes: 7 additions & 1 deletion kinject/build.gradle.kts → kinject-core/build.gradle.kts
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
import com.vanniktech.maven.publish.SonatypeHost
@file:OptIn(ExperimentalWasmDsl::class)

import org.jetbrains.kotlin.gradle.targets.js.dsl.ExperimentalWasmDsl

plugins {
alias(libs.plugins.kotlin.multiplatform)
Expand All @@ -11,6 +13,8 @@ kotlin {
browser()
nodejs()
}
wasmJs()
wasmWasi()
macosArm64()
macosX64()
iosX64()
Expand All @@ -20,6 +24,8 @@ kotlin {
tvosArm64()
tvosSimulatorArm64()

applyDefaultHierarchyTemplate()

sourceSets {
commonTest.dependencies {
implementation(kotlin("test"))
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
@file:Suppress("EXPECT_ACTUAL_CLASSIFIERS_ARE_IN_BETA_WARNING")

package kinject

import kotlin.reflect.KClass

internal actual object KinjectPlatform {
actual val KClass<*>.className: String
get() = this.simpleName ?: error("No qualified name found for '$this'")

actual inline fun <R> synchronized(lock: Any, func: () -> R): R = func()
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
@file:Suppress("EXPECT_ACTUAL_CLASSIFIERS_ARE_IN_BETA_WARNING")

package kinject

import kotlin.reflect.KClass

internal actual object KinjectPlatform {
actual val KClass<*>.className: String
get() = this.simpleName ?: error("No qualified name found for '$this'")

actual inline fun <R> synchronized(lock: Any, func: () -> R): R = func()
}
2 changes: 1 addition & 1 deletion kinject-viewmodel/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,6 @@ android {
}

dependencies {
api(project(":kinject"))
api(project(":kinject-core"))
implementation(libs.androidx.lifecycle.viewmodel.android)
}
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ android {
}

dependencies {
implementation(project(":kinject"))
implementation(project(":kinject-core"))
implementation(project(":kinject-compose"))
implementation(project(":kinject-compose-viewmodel"))

Expand Down
3 changes: 2 additions & 1 deletion settings.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -23,9 +23,10 @@ rootProject.name = "kinject"
include(":benchmark:benchmark-android")
include(":benchmark:benchmark-kotlin")
include(":benchmark:benchmark-shared")
include(":kinject")
include(":kinject-android")
include(":kinject-bom")
include(":kinject-compose")
include(":kinject-compose-viewmodel")
include(":kinject-core")
include(":kinject-viewmodel")
include(":sample:kinject-sample-android")

0 comments on commit 2b2a817

Please sign in to comment.