forked from wiremock/wiremock
-
Notifications
You must be signed in to change notification settings - Fork 0
/
go
executable file
·81 lines (65 loc) · 1.94 KB
/
go
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
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
#!/bin/bash
set -eo pipefail
export JAVA7_HOME=~/.sdkman/candidates/java/7.0.181-zulu
export JAVA8_HOME=~/.sdkman/candidates/java/8.0.252-zulu
export JAVA11_HOME=~/.sdkman/candidates/java/11.0.7-zulu
help() {
echo -e "Usage: go <command>"
echo -e
echo -e " help Print this help"
echo -e
echo -e "Common commands: "
echo -e " test Run all tests against Java 7 and 8"
echo -e " test-java8 Run all tests against Java 8"
echo -e " test-java11 Run all tests against Java 11"
echo -e " release Release to Maven Central (via Sonatype)"
echo -e " release-local Release to ~/.m2/repository"
echo ""
exit 0
}
use-java7() {
export JAVA_HOME=$JAVA7_HOME
./gradlew --version | grep JVM
}
use-java8() {
export JAVA_HOME=$JAVA8_HOME
./gradlew --version | grep JVM
}
use-java11() {
export JAVA_HOME=$JAVA11_HOME
./gradlew --version | grep JVM
}
test() {
use-java7
./gradlew -c release-settings.gradle :java7:test --rerun-tasks -x generateApiDocs
use-java8
./gradlew -c release-settings.gradle :java8:test --rerun-tasks -x generateApiDocs
}
test-java8() {
use-java8
./gradlew -c release-settings.gradle :java8:test --rerun-tasks -x generateApiDocs
}
test-java11() {
use-java11
./gradlew -c release-settings.gradle :java8:test --rerun-tasks -x generateApiDocs
}
release() {
use-java7
./gradlew -c release-settings.gradle clean :java7:release --stacktrace
use-java8
./gradlew -c release-settings.gradle clean :java8:release --stacktrace
}
release-local() {
use-java7
./gradlew -c release-settings.gradle clean :java7:release -DLOCAL_PUBLISH=true
use-java8
./gradlew -c release-settings.gradle clean :java8:release -DLOCAL_PUBLISH=true
}
if [[ $1 =~ ^(help|test|test-java8|test-java11|release|release-local|use-java7|use-java8)$ ]]; then
COMMAND=$1
shift
$COMMAND "$@"
else
help
exit 1
fi