2025-09-22 16:35:28 -03:00
|
|
|
import dev.carlosmartino.plugins.libs
|
|
|
|
|
import org.gradle.api.Plugin
|
|
|
|
|
import org.gradle.api.Project
|
|
|
|
|
import org.gradle.kotlin.dsl.configure
|
|
|
|
|
import org.gradle.kotlin.dsl.getByType
|
|
|
|
|
import org.jetbrains.compose.ComposeExtension
|
|
|
|
|
import org.jetbrains.kotlin.gradle.dsl.KotlinMultiplatformExtension
|
|
|
|
|
|
|
|
|
|
class ComposeMultiplatformConventionPlugin : Plugin<Project> {
|
|
|
|
|
override fun apply(target: Project) =
|
|
|
|
|
with(target) {
|
|
|
|
|
with(pluginManager) {
|
2025-09-22 16:46:13 -03:00
|
|
|
apply(libs.findPlugin("composeCompiler").get().get().pluginId)
|
|
|
|
|
apply(libs.findPlugin("composeMultiplatform").get().get().pluginId)
|
2025-09-22 16:35:28 -03:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
val composeDeps = extensions.getByType<ComposeExtension>().dependencies
|
|
|
|
|
|
|
|
|
|
extensions.configure<KotlinMultiplatformExtension> {
|
|
|
|
|
sourceSets.apply {
|
|
|
|
|
commonMain {
|
|
|
|
|
dependencies {
|
|
|
|
|
implementation(composeDeps.runtime)
|
|
|
|
|
implementation(composeDeps.foundation)
|
|
|
|
|
implementation(composeDeps.material3)
|
|
|
|
|
implementation(composeDeps.ui)
|
|
|
|
|
implementation(composeDeps.uiUtil)
|
|
|
|
|
implementation(composeDeps.animation)
|
|
|
|
|
implementation(composeDeps.animationGraphics)
|
|
|
|
|
implementation(composeDeps.components.resources)
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|