Skip to content

Commit

Permalink
Update the way to copy githooks
Browse files Browse the repository at this point in the history
  • Loading branch information
DanielLiu1123 committed Apr 18, 2024
1 parent 9602c00 commit 9947e27
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 9 deletions.
9 changes: 0 additions & 9 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,6 @@ allprojects {
}
}

compileJava.dependsOn clean // clean before every build

apply plugin: "io.spring.dependency-management"
dependencyManagement {
imports {
Expand Down Expand Up @@ -81,10 +79,3 @@ allprojects {
omitVisitors.addAll("FindReturnRef", "DontReusePublicIdentifiers")
}
}

tasks.register("installGitHook", Copy) {
from "$rootProject.rootDir/.githooks"
into { new File(rootProject.rootDir, ".git/hooks") }
fileMode 0775
}
installGitHook
2 changes: 2 additions & 0 deletions examples/native-image/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -13,3 +13,5 @@ dependencies {
graalvmNative {
testSupport = false
}

compileJava.dependsOn clean
7 changes: 7 additions & 0 deletions settings.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -19,3 +19,10 @@ include(":httpexchange-processor")
include(":httpexchange-spring-boot-autoconfigure")

include(":starters:httpexchange-spring-boot-starter")

new File("${rootDir}/.githooks").eachFile(groovy.io.FileType.FILES) {
def f = new File("${rootDir}/.git/hooks")
if (f.exists() && f.isDirectory()) {
java.nio.file.Files.copy(it.toPath(), new File("${rootDir}/.git/hooks", it.name).toPath(), java.nio.file.StandardCopyOption.REPLACE_EXISTING)
}
}

0 comments on commit 9947e27

Please sign in to comment.