-
Notifications
You must be signed in to change notification settings - Fork 8
/
build.gradle
49 lines (45 loc) · 1.88 KB
/
build.gradle
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
import org.jetbrains.kotlin.gradle.tasks.KotlinCompile
// Top-level build file where you can add configuration options common to all sub-projects/modules.
plugins {
alias(libs.plugins.androidApplication) apply false
alias(libs.plugins.androidLibrary) apply false
alias(libs.plugins.jetbrainsKotlinAndroid) apply false
alias(libs.plugins.serialization) apply false
alias(libs.plugins.google.gms) version(libs.versions.gms) apply false
alias(libs.plugins.kotlin.ksp) version(libs.versions.ksp) apply false
alias(libs.plugins.gradle.ktlint) version(libs.versions.ktlint) apply false
}
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') }
filePermissions {
unix(0b111_111_111)
}
}
project(":app") {
tasks.matching { it.name == "preBuild" }.configureEach {
dependsOn(rootProject.tasks.named("installGitHook"))
}
}
subprojects {
tasks.withType(KotlinCompile).configureEach {
kotlinOptions {
var buildDirPath = project.layout.buildDirectory.get().asFile.absolutePath
if (project.findProperty("composeCompilerReports") == "true") {
freeCompilerArgs += listOf(
"-P",
"plugin:androidx.compose.compiler.plugins.kotlin:reportsDestination=" +
buildDirPath + "/compose_compiler"
)
}
if (project.findProperty("composeCompilerMetrics") == "true") {
freeCompilerArgs += listOf(
"-P",
"plugin:androidx.compose.compiler.plugins.kotlin:metricsDestination=" +
buildDirPath + "/compose_compiler"
)
}
}
}
}