forked from rusefi/rusefi
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbuild.xml
237 lines (216 loc) · 11.2 KB
/
build.xml
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
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
<project default="build">
<property name="jar_file_folder" value="../java_console_binary"/>
<property name="hw_tests" value="build_hw"/>
<property name="jar_file" value="${jar_file_folder}/rusefi_console.jar"/>
<resources id="libs">
<string>lib/mockito-all-1.10.19.jar</string>
<string>../java_tools/configuration_definition/lib/snakeyaml.jar</string>
<string>lib/log4j-api-2.13.3.jar</string>
<string>lib/log4j-core-2.13.3.jar</string>
<string>lib/jsr305-2.0.1.jar</string>
<string>lib/dfu/dfu_java.jar</string>
<string>lib/dfu/IntelHexParser.jar</string>
<string>lib/json-simple-1.1.1.jar</string>
<string>lib/json-simple-1.1.1.jar</string>
<string>lib/jaxb-api.jar</string>
<string>lib/httpclient.jar</string>
<string>lib/httpmime.jar</string>
<string>lib/httpcore.jar</string>
<string>lib/jSerialComm.jar</string>
<string>lib/jcip-annotations-1.0.jar</string>
<string>lib/swing-layout-1.0.jar</string>
<string>lib/jep.jar</string>
<string>lib/log4j.jar</string>
<string>lib/junit.jar</string>
<string>lib/SteelSeries-3.9.30.jar</string>
<string>lib/annotations.jar</string>
<string>lib/miglayout-4.0.jar</string>
<string>lib/surfaceplotter-2.0.1.jar</string>
<string>../java_tools/configuration_definition/lib/antlr-4.9.3-complete.jar</string>
<string>lib/javacan-core.jar</string>
</resources>
<pathconvert property="lib_list" refid="libs" pathsep=":" />
<target name="clean">
<delete dir="build"/>
<delete dir="${hw_tests}"/>
</target>
<target name="clean_out_folder">
<delete dir="out"/>
</target>
<target name="build" depends="jar, test"/>
<target name="compile">
<fail message="Unsupported Java version: ${ant.java.version}.
Make sure that the Java version is 1.8 NOT greater see https://github.com/rusefi/rusefi/issues/3128">
<condition>
<not>
<or>
<equals arg1="${ant.java.version}" arg2="1.8"/>
</or>
</not>
</condition>
</fail>
<mkdir dir="build/classes"/>
<javac debug="yes" destdir="build/classes"
classpath="${lib_list}"
encoding="iso-8859-1">
<src path="autotest/src/main/java"/>
<src path="../java_tools/configuration_definition/src/main/java"/>
<src path="../java_tools/configuration_definition_base/src/main/java"/>
<src path="../java_tools/configuration_definition/build/generated-src/antlr/main"/>
<src path="../java_tools/enum_to_string/src/main/java"/>
<src path="io/src/main/java"/>
<src path="io/src/test/java"/>
<src path="io/src/testFixtures/java"/>
<src path="luaformatter/src"/>
<src path="models/src/main/java"/>
<src path="models/src/test/java"/>
<src path="inifile/src/main/java"/>
<src path="inifile/src/test/java"/>
<src path="core_ui/src/main/java"/>
<src path="shared_ui/src/main/java"/>
<src path="shared_io/src/main/java"/>
<!-- <src path="shared_io/src/test/java"/>-->
<src path="logging-api/src/main/java"/>
<src path="ui/src/main/java"/>
<src path="ui/src/test/java"/>
<src path="logging/src/main/java"/>
<!-- uncomment if you want to compile under java 11
// see https://github.com/rusefi/rusefi/issues/1526
please remove the space between '-' and '-add-exports' it should be double-dash
<compilerarg line="- -add-exports java.xml/com.sun.org.apache.xerces.internal.parsers=ALL-UNNAMED"/>
<compilerarg line="- -add-exports java.xml/com.sun.org.apache.xml.internal.serialize=ALL-UNNAMED"/>
-->
</javac>
</target>
<target name="test" depends="compile, copy_c_sources">
<junit fork="yes"
maxmemory="512m"
printsummary="yes"
haltonfailure="yes">
<jvmarg value="-ea"/>
<jvmarg value="-XX:+HeapDumpOnOutOfMemoryError"/>
<sysproperty key="java.library.path" value="../unit_tests/build"/>
<formatter type="brief"/>
<classpath
path="build/classes:lib/junit.jar:${lib_list}:lib/commons-logging.jar"/>
<batchtest todir="build">
<!-- at the moment we do NOT have any tests matching this pattern - all hardware tests are not inside 'test' folders -->
<fileset dir="autotest/src/main/java" includes="**/test/**/*Test.java"/>
<fileset dir="io/src/test/java" includes="**/*Test.java"/>
<fileset dir="inifile/src/test/java" includes="**/*Test.java"/>
<fileset dir="models/src/test/java" includes="**/*Test.java"/>
<fileset dir="ui/src/test/java" includes="**/*Test.java"/>
<fileset dir="logging/src/main/java" includes="**/test/**/*Test.java"/>
</batchtest>
</junit>
</target>
<target name="copy_c_sources">
<copy todir="build/classes/c_sources" flatten="true">
<fileset dir="../firmware/controllers" includes="**/*.cpp"/>
<fileset dir="../firmware/console" includes="**/*.cpp"/>
</copy>
</target>
<target name="jar" depends="compile, copy_c_sources">
<mkdir dir="build/jar"/>
<delete file="${jar_file}"/>
<echo message="Building ${jar_file}"/>
<copy todir="build/classes">
<fileset dir="ui/src/main/resources" includes="**/*.gif"/>
<fileset dir="ui/src/main/resources" includes="**/*.png"/>
<fileset dir="ui/src/main/resources" includes="**/*.jpg"/>
</copy>
<tstamp>
<format property="TODAY" pattern="yyyy-MM-dd HH:mm:ss"/>
</tstamp>
<mkdir dir="${jar_file_folder}"/>
<jar destfile="${jar_file}" basedir="build/classes">
<manifest>
<attribute name="Main-Class" value="com.rusefi.Launcher"/>
<attribute name="Built-Date" value="${TODAY}"/>
<attribute name="Signature-Vendor" value="rusEFI LLC"/>
</manifest>
<zipfileset src="lib/SteelSeries-3.9.30.jar" includes="**/*.class"/>
<zipfileset src="lib/trident-6.2.jar" includes="**/*.class"/>
<zipfileset src="lib/swing-layout-1.0.jar" includes="**/*.class"/>
<zipfileset src="lib/log4j.jar" includes="**/*.class"/>
<zipfileset src="lib/jep.jar" includes="**/*.class"/>
<zipfileset src="lib/httpclient.jar" includes="**/*.class"/>
<zipfileset src="lib/commons-logging.jar" includes="**/*.class"/>
<zipfileset src="lib/javacan-core.jar" includes="**/*.class"/>
<zipfileset src="lib/javacan-core-x86_64.jar" includes="**/*.class **/*.xml **/*.properties **/*.so"/>
<zipfileset src="lib/slf4j-api.jar" includes="**/*.class"/>
<zipfileset src="lib/slf4j-simple.jar" includes="**/*.class"/>
<zipfileset src="lib/httpcore.jar" includes="**/*.class"/>
<zipfileset src="lib/httpmime.jar" includes="**/*.class"/>
<zipfileset src="lib/jaxb-api.jar" includes="**/*.class"/>
<zipfileset src="../java_tools/configuration_definition/lib/antlr-4.9.3-complete.jar" includes="**/*.class"/>
<zipfileset src="lib/jSerialComm.jar" includes="**/*.class **/*.so **/*.dll **/*.jnilib"/>
<zipfileset src="lib/dfu/libusb4java-1.3.0-linux-aarch64.jar" includes="**/*.class **/*.so **/*.dll **/*.jnilib"/>
<zipfileset src="lib/dfu/libusb4java-1.3.0-linux-arm.jar" includes="**/*.class **/*.so **/*.dll **/*.jnilib"/>
<zipfileset src="lib/dfu/libusb4java-1.3.0-linux-x86.jar" includes="**/*.class **/*.so **/*.dll **/*.jnilib"/>
<zipfileset src="lib/dfu/libusb4java-1.3.0-linux-x86-64.jar" includes="**/*.class **/*.so **/*.dll **/*.jnilib"/>
<zipfileset src="lib/dfu/libusb4java-1.3.0-darwin-x86-64.jar" includes="**/*.class **/*.so **/*.dll **/*.jnilib"/>
<zipfileset src="lib/dfu/usb4java-1.3.0.jar" includes="**/*.class"/>
<zipfileset src="lib/dfu/IntelHexParser.jar" includes="**/*.class"/>
<zipfileset src="lib/dfu/dfu_java.jar" includes="**/*.class"/>
<zipfileset src="lib/annotations.jar" includes="**/*.class"/>
<zipfileset src="lib/miglayout-4.0.jar" includes="**/*.class"/>
<zipfileset src="lib/surfaceplotter-2.0.1.jar" includes="**/*.class **/*.properties"/>
<zipfileset src="lib/batik/batik-svggen.jar" includes="**/*.class"/>
<zipfileset src="lib/batik/batik-awt-util.jar" includes="**/*.class"/>
<zipfileset src="lib/batik/batik-util.jar" includes="**/*.class"/>
<zipfileset src="lib/json-simple-1.1.1.jar" includes="**/*.class"/>
<zipfileset src="lib/junit.jar" includes="**/*.class"/>
</jar>
</target>
<target name="run" depends="jar">
<java jar="${jar_file}" fork="true"/>
</target>
<target name="simulator_test" depends="jar">
<java classpath="${jar_file}" classname="com.rusefi.SimulatorFunctionalTest" failonerror="true" args="start">
</java>
</target>
<target name="hardware_ci_f4_discovery" depends="jar">
<mkdir dir="${hw_tests}"/>
<junit fork="no"
maxmemory="512m"
printsummary="yes"
showoutput="true"
haltonfailure="yes">
<jvmarg value="-ea"/>
<jvmarg value="-XX:+HeapDumpOnOutOfMemoryError"/>
<formatter type="brief"/>
<classpath
path="build/classes:lib/junit.jar:${lib_list}:lib/commons-logging.jar"/>
<batchtest todir="${hw_tests}">
<fileset dir="autotest/src/main/java" includes="**/common/*.java"/>
<fileset dir="autotest/src/main/java" includes="**/f4discovery/*.java"/>
</batchtest>
<formatter type="plain" usefile="false" /> <!-- to screen -->
</junit>
</target>
<target name="hardware_ci_proteus" depends="jar">
<mkdir dir="${hw_tests}"/>
<junit fork="no"
maxmemory="512m"
printsummary="yes"
showoutput="true"
haltonfailure="yes">
<jvmarg value="-ea"/>
<jvmarg value="-XX:+HeapDumpOnOutOfMemoryError"/>
<formatter type="brief"/>
<classpath
path="build/classes:lib/junit.jar:${lib_list}:lib/commons-logging.jar"/>
<batchtest todir="${hw_tests}">
<fileset dir="autotest/src/main/java" includes="**/common/*.java"/>
<fileset dir="autotest/src/main/java" includes="**/proteus/*.java"/>
</batchtest>
<formatter type="plain" usefile="false" /> <!-- to screen -->
</junit>
</target>
<target name="before_IDEA_Build">
<copy todir=".">
<fileset dir="../firmware/tunerstudio" includes="rusefi.ini"/>
</copy>
</target>
</project>