rusefi-1/java_console/build.xml

257 lines
12 KiB
XML

<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"/>
<property name="server_jar_file" value="${jar_file_folder}/rusefi_server.jar"/>
<property name="lib_list" value="lib/mockito-all-1.10.19.jar:../java_tools/configuration_definition/lib/snakeyaml.jar:lib/log4j-api-2.13.3.jar:lib/log4j-core-2.13.3.jar:lib/jsr305-2.0.1.jar:lib/dfu/dfu_java.jar:lib/dfu/IntelHexParser.jar:lib/json-simple-1.1.1.jar:lib/server/javax.json.jar:lib/server/cactoos.jar:lib/server/takes.jar:lib/json-simple-1.1.1.jar:lib/jaxb-api.jar:lib/httpclient.jar:lib/httpmime.jar:lib/httpcore.jar:lib/jSerialComm.jar:lib/jcip-annotations-1.0.jar:lib/swing-layout-1.0.jar:lib/jep.jar:lib/log4j.jar:lib/junit.jar:lib/SteelSeries-3.9.30.jar:lib/annotations.jar:lib/miglayout-4.0.jar:lib/surfaceplotter-2.0.1.jar:../java_tools/configuration_definition/lib/antlr-4.9.3-complete.jar"/>
<target name="clean">
<delete dir="build"/>
<delete dir="${hw_tests}"/>
</target>
<target name="clean_out_folder">
<delete dir="out"/>
</target>
<target name="autoupdate_compile">
<mkdir dir="autoupdate_build/classes"/>
<javac
debug="yes"
destdir="autoupdate_build/classes"
classpath="lib/annotations.jar"
>
<src path="autoupdate/src/main/java"/>
<src path="shared_io/src/main/java"/>
</javac>
</target>
<target name="build" depends="jar, test"/>
<target name="autoupdate_jar" depends="autoupdate_compile">
<tstamp>
<format property="TODAY" pattern="yyyy-MM-dd HH:mm:ss"/>
</tstamp>
<jar destfile="rusefi_autoupdate.jar" basedir="autoupdate_build/classes">
<manifest>
<attribute name="Main-Class" value="com.rusefi.autoupdate.Autoupdate"/>
<attribute name="Built-Date" value="${TODAY}"/>
<attribute name="Signature-Vendor" value="rusEFI LLC"/>
</manifest>
</jar>
</target>
<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}">
<src path="autotest/src/main/java"/>
<src path="autoupdate/src/main/java"/>
<src path="../java_tools/configuration_definition/src/main/java"/>
<src path="../java_tools/enum_to_string/src/main/java"/>
<src path="../java_tools/proxy_server/src/main/java"/>
<src path="../java_tools/proxy_server/src/test/java"/>
<src path="io/src/main/java"/>
<src path="io/src/test/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="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"/>
<!-- not really used at the moment but let's compile for the sake of Eclipse users -->
<src path="tools/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="native_header">
<javah classpath="io/src/main/java" destdir="../unit_tests/native" class="com.rusefi.native_.EngineLogic"/>
</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="autoupdate/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="server_jar" depends="jar">
<delete file="${server_jar_file}"/>
<echo message="Building ${server_jar_file}"/>
<jar destfile="${server_jar_file}">
<manifest>
<attribute name="Main-Class" value="com.rusefi.server.BackendLauncher"/>
<attribute name="Built-Date" value="${TODAY}"/>
<attribute name="Signature-Vendor" value="rusEFI LLC"/>
</manifest>
<zipfileset src="${jar_file}" includes="**/*.class"/>
<zipfileset src="lib/server/cactoos.jar" includes="**/*.class"/>
<zipfileset src="lib/server/javax.json.jar" includes="**/*.class"/>
<zipfileset src="lib/server/takes.jar" includes="**/*.class"/>
<zipfileset src="lib/log4j-api-2.13.3.jar"/>
<zipfileset src="lib/log4j-core-2.13.3.jar"/>
<fileset dir="../java_tools/proxy_server/src/main/resources" includes="**/*.*"/>
</jar>
</target>
<target name="copy_c_sources">
<copy todir="build/classes/c_sources" flatten="true">
<fileset dir="../firmware/controllers" includes="**/*.cpp"/>
</copy>
</target>
<target name="jar" depends="compile, native_header, copy_c_sources, autoupdate_jar">
<mkdir dir="build/jar"/>
<delete file="${jar_file}"/>
<echo message="Building ${jar_file}"/>
<copy todir="build/classes">
<fileset dir="ui/resources" includes="**/*.gif"/>
<fileset dir="ui/resources" includes="**/*.png"/>
<fileset dir="ui/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/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>