We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 5cf0eef commit 71fc32dCopy full SHA for 71fc32d
app/build.gradle.kts
@@ -31,3 +31,21 @@ dependencies {
31
androidTestImplementation(libs.androidx.test.junit)
32
androidTestImplementation(libs.androidx.test.espresso)
33
}
34
+
35
+tasks.getByPath(":app:preBuild").dependsOn("installGitHook")
36
37
+tasks.register<Copy>("installGitHook") {
38
+ dependsOn("deletePreviousGitHook")
39
+ from("${rootProject.rootDir}/script/pre-commit")
40
+ into("${rootProject.rootDir}/.git/hooks")
41
+ eachFile {
42
+ fileMode = 777
43
+ }
44
+}
45
46
+tasks.register<Delete>("deletePreviousGitHook") {
47
+ val prePush = "${rootProject.rootDir}/.git/hooks/pre-commit"
48
+ if (file(prePush).exists()) {
49
+ delete(prePush)
50
51
gradlew
100644
100755
0 commit comments