-
Notifications
You must be signed in to change notification settings - Fork 225
/
Copy pathbuild.sh
executable file
·113 lines (85 loc) · 2.56 KB
/
build.sh
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
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
#!/bin/bash
set -eu
# If fork fails because the Java agent cannot be installed,
# it will log an error and use the fallback technique.
# We need to check the logs for an error to detect the failure.
check_build_log () {
grep ERROR build.log && exit 1
rm build.log
}
set -x
# Run end-to-end tests against all supported Java versions
## Java 7
mvn clean verify \
--errors \
-P noDefaultMethods \
| tee build.log && check_build_log
mvn clean verify \
--errors \
| tee build.log && check_build_log
## Java 6
mvn clean verify \
--errors \
-P java6,noDefaultMethods \
| tee build.log && check_build_log
mvn clean verify \
--errors \
-P java6 \
| tee build.log && check_build_log
## Java 5
mvn clean verify \
--errors \
-P java5,noDefaultMethods \
| tee build.log && check_build_log
mvn clean verify \
--errors \
-P java5 \
| tee build.log && check_build_log
# Test the forking mechanism
mvn clean verify \
--errors \
-P fork,noDefaultMethods \
| tee build.log && check_build_log
mvn clean verify \
--errors \
-P fork \
| tee build.log && check_build_log
# The Maven plugin's minimum requirement is Java 6,
# but then the plugin must force forking the process
JAVA_HOME="$JAVA6_HOME" mvn clean verify \
--errors \
-P java6 \
| tee build.log && check_build_log
# Java 9 has stricter bytecode validation than Java 8,
# so make sure that Retrolambda can run under new Java versions (without forking)
JAVA_HOME="$JAVA9_HOME" mvn clean verify \
--errors \
| tee build.log && check_build_log
JAVA_HOME="$JAVA10_HOME" mvn clean verify \
--errors \
| tee build.log && check_build_log
JAVA_HOME="$JAVA11_HOME" mvn clean verify \
--errors \
| tee build.log && check_build_log
# (Java 12+ fails without forking because java.lang.invoke.InnerClassLambdaMetafactory#dumper cannot be made non-final)
# Make sure that the Java agent works on all new Java versions
JAVA_HOME="$JAVA9_HOME" mvn clean verify \
--errors \
-P fork,noToolchain \
| tee build.log && check_build_log
JAVA_HOME="$JAVA10_HOME" mvn clean verify \
--errors \
-P fork,noToolchain \
| tee build.log && check_build_log
JAVA_HOME="$JAVA11_HOME" mvn clean verify \
--errors \
-P fork,noToolchain \
| tee build.log && check_build_log
JAVA_HOME="$JAVA12_HOME" mvn clean verify \
--errors \
-P fork,noToolchain \
| tee build.log && check_build_log
JAVA_HOME="$JAVA13_HOME" mvn clean verify \
--errors \
-P fork,noToolchain \
| tee build.log && check_build_log