-
-
Notifications
You must be signed in to change notification settings - Fork 24
Expand file tree
/
Copy pathbuild.gradle.kts
More file actions
32 lines (30 loc) · 1.11 KB
/
build.gradle.kts
File metadata and controls
32 lines (30 loc) · 1.11 KB
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
// 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.kotlin.android) apply false
alias(libs.plugins.kotlin.compose) apply false
alias(libs.plugins.sqldelight) apply false
alias(libs.plugins.kotlinter) apply false
alias(libs.plugins.googleServices) apply false
alias(libs.plugins.firebaseCrashlytics) apply false
}
tasks.register("copyGitHooks", Copy::class.java) {
description = "Copies the git hooks from /git-hooks to the .git folder."
group = "git hooks"
from("$rootDir/scripts/pre-commit")
into("$rootDir/.git/hooks/")
}
tasks.register("installGitHooks", Exec::class.java) {
description = "Installs the pre-commit git hooks from /git-hooks."
group = "git hooks"
workingDir = rootDir
commandLine = listOf("chmod")
args("-R", "+x", ".git/hooks/")
dependsOn("copyGitHooks")
doLast {
logger.info("Git hook installed successfully.")
}
}
afterEvaluate {
tasks.getByPath(":app:preBuild").dependsOn(":installGitHooks")
}