amethyst/build.gradle

63 lines
2.1 KiB
Groovy
Raw Normal View History

2023-07-30 18:10:23 -04:00
import org.jetbrains.kotlin.gradle.tasks.KotlinCompile
2023-01-11 13:31:20 -05:00
plugins {
2024-03-01 10:38:03 -05: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 19:09:26 +01:00
}
2023-06-06 15:49:52 -04:00
subprojects {
2023-07-30 18:10:23 -04:00
tasks.withType(KotlinCompile).configureEach {
2023-06-06 15:49:52 -04: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 10:44:05 -05:00
apply plugin: 'com.diffplug.spotless'
spotless {
kotlin {
target '**/*.kt'
targetExclude("$buildDir/**/*.kt")
ktlint("1.1.0")
//ktfmt().googleStyle()
2024-01-06 10:44:32 -05:00
licenseHeaderFile rootProject.file('spotless/copyright.kt'), "package|import|class|object|sealed|open|interface|abstract "
2024-01-06 10:44:05 -05: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