Initial commit
This commit is contained in:
@@ -7,6 +7,7 @@ ktlint_standard_multiline-expression-wrapping = disabled
|
||||
ktlint_standard_backing-property-naming = disabled
|
||||
ktlint_standard_function-naming = disabled
|
||||
ktlint_standard_chain-method-continuation = disabled
|
||||
ktlint_standard_function-signature = disabled
|
||||
ktlint_chain_method_rule_force_multiline_when_chain_operator_count_greater_or_equal_than = 6
|
||||
|
||||
[**/build/**]
|
||||
|
||||
@@ -2,43 +2,41 @@ 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.dependencies
|
||||
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) {
|
||||
apply(libs.findPlugin("composeCompiler").get().get().pluginId)
|
||||
apply(libs.findPlugin("composeMultiplatform").get().get().pluginId)
|
||||
}
|
||||
override fun apply(target: Project) = with(target) {
|
||||
with(pluginManager) {
|
||||
apply(libs.findPlugin("composeCompiler").get().get().pluginId)
|
||||
apply(libs.findPlugin("composeMultiplatform").get().get().pluginId)
|
||||
}
|
||||
|
||||
val composeDeps = extensions.getByType<ComposeExtension>().dependencies
|
||||
val composeDeps = extensions.getByType<ComposeExtension>().dependencies
|
||||
|
||||
extensions.configure<KotlinMultiplatformExtension> {
|
||||
sourceSets.apply {
|
||||
androidMain {
|
||||
dependencies {
|
||||
implementation(composeDeps.preview)
|
||||
implementation(libs.findLibrary("libs.androidx.activity.compose").get())
|
||||
}
|
||||
extensions.configure<KotlinMultiplatformExtension> {
|
||||
sourceSets.apply {
|
||||
androidMain {
|
||||
dependencies {
|
||||
implementation(composeDeps.preview)
|
||||
implementation(libs.findLibrary("libs.androidx.activity.compose").get())
|
||||
}
|
||||
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)
|
||||
implementation(composeDeps.components.uiToolingPreview)
|
||||
}
|
||||
}
|
||||
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)
|
||||
implementation(composeDeps.components.uiToolingPreview)
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user