This repository has been archived by the owner on Oct 11, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 1
/
build.gradle.kts
45 lines (40 loc) · 1.67 KB
/
build.gradle.kts
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
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.android.application) apply false
alias(libs.plugins.jetbrains.kotlin.android) apply false
alias(libs.plugins.compose.compiler) apply false
alias(libs.plugins.ktlint) apply false
alias(libs.plugins.serialization) apply false
id("org.jetbrains.kotlin.kapt") version "2.0.0" apply false
}
tasks.register<Copy>("installGitHook") {
from(File(rootProject.rootDir, "git-hooks/pre-commit"))
from(File(rootProject.rootDir, "git-hooks/pre-push"))
into(File(rootProject.rootDir, ".git/hooks"))
fileMode = 0b111101101
}
tasks.getByPath(":app:preBuild").dependsOn(tasks.getByName("installGitHook"))
subprojects {
tasks.withType<KotlinCompile>().configureEach {
compilerOptions {
val buildDirPath = layout.buildDirectory.get().asFile.absolutePath
if (project.findProperty("composeCompilerReports") == "true") {
freeCompilerArgs.addAll(
listOf(
"-P",
"plugin:androidx.compose.compiler.plugins.kotlin:reportsDestination=$buildDirPath/compose_compiler"
)
)
}
if (project.findProperty("composeCompilerMetrics") == "true") {
freeCompilerArgs.addAll(
listOf(
"-P",
"plugin:androidx.compose.compiler.plugins.kotlin:metricsDestination=$buildDirPath/compose_compiler"
)
)
}
}
}
}