Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

👍 FeaturePlugin を追加 #51

Merged
merged 1 commit into from
Nov 23, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 3 additions & 4 deletions build-logic/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -92,10 +92,9 @@ gradlePlugin {
}

// Conventions
register("androidFeature") {
id = "nito.convention.androidfeature"
implementationClass =
"club.nito.convention.AndroidFeaturePlugin"
register("feature") {
id = "nito.convention.feature"
implementationClass = "club.nito.convention.FeaturePlugin"
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -5,15 +5,16 @@ import org.gradle.api.Project
import org.gradle.kotlin.dsl.withType
import org.jetbrains.kotlin.gradle.tasks.KotlinCompile

class AndroidFeaturePlugin : Plugin<Project> {
class FeaturePlugin : Plugin<Project> {
override fun apply(target: Project) {
with(target) {
with(pluginManager) {
apply("nito.primitive.android")
apply("nito.primitive.android.kotlin")
apply("nito.primitive.android.compose")
apply("nito.primitive.android.hilt")
apply("nito.primitive.kmp")
apply("nito.primitive.kmp.android")
apply("nito.primitive.kmp.ios")
apply("nito.primitive.kmp.compose")
apply("nito.primitive.detekt")
apply("nito.primitive.kotest")
}

tasks.withType<KotlinCompile>().configureEach {
Expand All @@ -35,7 +36,7 @@ private fun Project.buildComposeMetricsParameters(): List<String> {
val metricsFolder = rootProject.buildDir.resolve("compose-metrics").resolve(relativePath)
metricParameters.add("-P")
metricParameters.add(
"plugin:androidx.compose.compiler.plugins.kotlin:metricsDestination=" + metricsFolder.absolutePath
"plugin:androidx.compose.compiler.plugins.kotlin:metricsDestination=" + metricsFolder.absolutePath,
)
}

Expand All @@ -45,7 +46,7 @@ private fun Project.buildComposeMetricsParameters(): List<String> {
val reportsFolder = rootProject.buildDir.resolve("compose-reports").resolve(relativePath)
metricParameters.add("-P")
metricParameters.add(
"plugin:androidx.compose.compiler.plugins.kotlin:reportsDestination=" + reportsFolder.absolutePath
"plugin:androidx.compose.compiler.plugins.kotlin:reportsDestination=" + reportsFolder.absolutePath,
)
}
return metricParameters.toList()
Expand Down
5 changes: 1 addition & 4 deletions feature/auth/build.gradle.kts
Original file line number Diff line number Diff line change
@@ -1,8 +1,5 @@
plugins {
id("nito.primitive.kmp")
id("nito.primitive.kmp.android")
id("nito.primitive.kmp.ios")
id("nito.primitive.kmp.compose")
id("nito.convention.feature")
}

android.namespace = "club.nito.feature.auth"
Expand Down
5 changes: 1 addition & 4 deletions feature/schedule/build.gradle.kts
Original file line number Diff line number Diff line change
@@ -1,8 +1,5 @@
plugins {
id("nito.primitive.kmp")
id("nito.primitive.kmp.android")
id("nito.primitive.kmp.ios")
id("nito.primitive.kmp.compose")
id("nito.convention.feature")
}

android.namespace = "club.nito.feature.schedule"
Expand Down
5 changes: 1 addition & 4 deletions feature/settings/build.gradle.kts
Original file line number Diff line number Diff line change
@@ -1,8 +1,5 @@
plugins {
id("nito.primitive.kmp")
id("nito.primitive.kmp.android")
id("nito.primitive.kmp.ios")
id("nito.primitive.kmp.compose")
id("nito.convention.feature")
}

android.namespace = "club.nito.feature.settings"
Expand Down
6 changes: 1 addition & 5 deletions feature/top/build.gradle.kts
Original file line number Diff line number Diff line change
@@ -1,9 +1,5 @@
plugins {
id("nito.primitive.kmp")
id("nito.primitive.kmp.android")
id("nito.primitive.kmp.ios")
id("nito.primitive.kmp.compose")
id("nito.primitive.kotest")
id("nito.convention.feature")
}

android.namespace = "club.nito.feature.top"
Expand Down