build: build-logic 约定插件 (mcl.*)
This commit is contained in:
79
build-logic/convention/build.gradle.kts
Normal file
79
build-logic/convention/build.gradle.kts
Normal file
@@ -0,0 +1,79 @@
|
||||
import org.jetbrains.kotlin.gradle.dsl.JvmTarget
|
||||
|
||||
plugins {
|
||||
`kotlin-dsl`
|
||||
}
|
||||
|
||||
group = "com.mingyuan.androidclient.buildlogic"
|
||||
|
||||
// build-logic targets the JDK used to run Gradle (17), unrelated to the device/runtime JDK.
|
||||
java {
|
||||
sourceCompatibility = JavaVersion.VERSION_17
|
||||
targetCompatibility = JavaVersion.VERSION_17
|
||||
}
|
||||
|
||||
kotlin {
|
||||
compilerOptions {
|
||||
jvmTarget = JvmTarget.JVM_17
|
||||
}
|
||||
}
|
||||
|
||||
dependencies {
|
||||
compileOnly(libs.android.gradlePlugin)
|
||||
compileOnly(libs.kotlin.gradlePlugin)
|
||||
compileOnly(libs.ksp.gradlePlugin)
|
||||
compileOnly(libs.room.gradlePlugin)
|
||||
compileOnly(libs.spotless.gradlePlugin)
|
||||
}
|
||||
|
||||
tasks {
|
||||
validatePlugins {
|
||||
enableStricterValidation = true
|
||||
failOnWarning = true
|
||||
}
|
||||
}
|
||||
|
||||
gradlePlugin {
|
||||
plugins {
|
||||
register("androidApplication") {
|
||||
id = libs.plugins.mcl.android.application.asProvider().get().pluginId
|
||||
implementationClass = "AndroidApplicationConventionPlugin"
|
||||
}
|
||||
register("androidApplicationCompose") {
|
||||
id = libs.plugins.mcl.android.application.compose.get().pluginId
|
||||
implementationClass = "AndroidApplicationComposeConventionPlugin"
|
||||
}
|
||||
register("androidLibrary") {
|
||||
id = libs.plugins.mcl.android.library.asProvider().get().pluginId
|
||||
implementationClass = "AndroidLibraryConventionPlugin"
|
||||
}
|
||||
register("androidLibraryCompose") {
|
||||
id = libs.plugins.mcl.android.library.compose.get().pluginId
|
||||
implementationClass = "AndroidLibraryComposeConventionPlugin"
|
||||
}
|
||||
register("androidFeature") {
|
||||
id = libs.plugins.mcl.android.feature.get().pluginId
|
||||
implementationClass = "AndroidFeatureConventionPlugin"
|
||||
}
|
||||
register("androidHilt") {
|
||||
id = libs.plugins.mcl.android.hilt.get().pluginId
|
||||
implementationClass = "AndroidHiltConventionPlugin"
|
||||
}
|
||||
register("androidRoom") {
|
||||
id = libs.plugins.mcl.android.room.get().pluginId
|
||||
implementationClass = "AndroidRoomConventionPlugin"
|
||||
}
|
||||
register("androidLint") {
|
||||
id = libs.plugins.mcl.android.lint.get().pluginId
|
||||
implementationClass = "AndroidLintConventionPlugin"
|
||||
}
|
||||
register("kotlinLibrary") {
|
||||
id = libs.plugins.mcl.kotlin.library.get().pluginId
|
||||
implementationClass = "JvmLibraryConventionPlugin"
|
||||
}
|
||||
register("root") {
|
||||
id = libs.plugins.mcl.root.get().pluginId
|
||||
implementationClass = "RootPlugin"
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user