Explorar o código

Move installGitHooks task to root project and fix target dir

Signed-off-by: Álvaro Brey <alvaro.brey@nextcloud.com>
Álvaro Brey %!s(int64=2) %!d(string=hai) anos
pai
achega
13d4aed502
Modificáronse 2 ficheiros con 16 adicións e 8 borrados
  1. 0 8
      app/build.gradle
  2. 16 0
      build.gradle

+ 0 - 8
app/build.gradle

@@ -380,14 +380,6 @@ android.applicationVariants.all { variant ->
     }
 }
 
-task installGitHooks(type: Copy, group: "development") {
-    description = "Install git hooks"
-    from("${project.rootDir}/scripts/hooks") {
-        include '*'
-    }
-    into "${project.rootDir}/.git/hooks"
-}
-
 spotless {
     kotlin {
         target "**/*.kt"

+ 16 - 0
build.gradle

@@ -39,3 +39,19 @@ subprojects {
 task clean(type: Delete) {
     delete rootProject.buildDir
 }
+
+task installGitHooks(type: Copy, group: "development") {
+    def sourceFolder = "${rootProject.projectDir}/scripts/hooks"
+    def destFolder = "${rootProject.projectDir}/.git/hooks"
+
+    description = "Install git hooks"
+
+    from(sourceFolder) {
+        include '*'
+    }
+    into destFolder
+
+    eachFile { file ->
+        println "${sourceFolder}/${file.relativeSourcePath} -> ${destFolder}/${file.path}"
+    }
+}