-
Notifications
You must be signed in to change notification settings - Fork 0
/
setup.gradle
38 lines (28 loc) · 1.02 KB
/
setup.gradle
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
tasks.register("setup") {
group "Dev"
description "Prepare local development environment"
println "Local Environment Setup"
doLast {
println "Downloading Google Java Format tool ..."
def version = "1.11.0"
def dir = new File("$rootProject.rootDir/tools/google-java-format")
def destination = new File("$dir/google-java-format.jar")
dir.mkdirs()
new URL("https://github.com/google/google-java-format/releases/download/v$version/google-java-format-$version-all-deps.jar")
.withInputStream { i ->
destination.withOutputStream { it << i }
}
println "Copying git hooks ..."
copy {
from("$rootProject.rootDir/scripts/githooks/commit-msg")
into("$rootProject.rootDir/.git/hooks")
}
copy {
from("$rootProject.rootDir/scripts/githooks/pre-commit")
into("$rootProject.rootDir/.git/hooks")
}
Runtime.getRuntime().exec("chmod +x .git/hooks/commit-msg")
Runtime.getRuntime().exec("chmod +x .git/hooks/pre-commit")
println "Done"
}
}