amethyst/build.gradle

63 wiersze
2.1 KiB
Groovy

2023-07-30 22:10:23 +00:00
import org.jetbrains.kotlin.gradle.tasks.KotlinCompile
2023-01-11 18:31:20 +00:00
plugins {
2024-03-01 15:38:03 +00:00
alias(libs.plugins.androidApplication) apply false
alias(libs.plugins.jetbrainsKotlinAndroid) apply false
alias(libs.plugins.androidLibrary) apply false
alias(libs.plugins.jetbrainsKotlinJvm) apply false
alias(libs.plugins.androidBenchmark) apply false
alias(libs.plugins.diffplugSpotless) apply false
alias(libs.plugins.googleServices) apply false
2023-03-07 18:09:26 +00:00
}
2023-06-06 19:49:52 +00:00
subprojects {
2023-07-30 22:10:23 +00:00
tasks.withType(KotlinCompile).configureEach {
2023-06-06 19:49:52 +00:00
kotlinOptions {
if (project.findProperty("composeCompilerReports") == "true") {
freeCompilerArgs += [
"-P",
"plugin:androidx.compose.compiler.plugins.kotlin:reportsDestination=" +
project.buildDir.absolutePath + "/compose_compiler"
]
}
if (project.findProperty("composeCompilerMetrics") == "true") {
freeCompilerArgs += [
"-P",
"plugin:androidx.compose.compiler.plugins.kotlin:metricsDestination=" +
project.buildDir.absolutePath + "/compose_compiler"
]
}
}
}
2024-01-06 15:44:05 +00:00
apply plugin: 'com.diffplug.spotless'
spotless {
kotlin {
target '**/*.kt'
targetExclude("$buildDir/**/*.kt")
ktlint("1.1.0")
//ktfmt().googleStyle()
2024-01-06 15:44:32 +00:00
licenseHeaderFile rootProject.file('spotless/copyright.kt'), "package|import|class|object|sealed|open|interface|abstract "
2024-01-06 15:44:05 +00:00
}
groovyGradle {
target '*.gradle'
}
afterEvaluate {
tasks.named("preBuild") {
dependsOn("spotlessApply")
}
}
}
}
tasks.register('installGitHook', Copy) {
from new File(rootProject.rootDir, 'git-hooks/pre-commit')
from new File(rootProject.rootDir, 'git-hooks/pre-push')
into { new File(rootProject.rootDir, '.git/hooks') }
fileMode 0777
}
tasks.getByPath(':app:preBuild').dependsOn installGitHook