2010-05-08 23:47:19 +02:00
|
|
|
<?xml version="1.0"?>
|
|
|
|
<project name="Arduino PDE" default="build">
|
2012-12-04 13:38:02 +01:00
|
|
|
|
2013-02-19 13:40:10 +01:00
|
|
|
<path id="class.path">
|
|
|
|
<fileset dir="lib">
|
|
|
|
<include name="*.jar"/>
|
|
|
|
</fileset>
|
|
|
|
<pathelement path="${env.JAVA_HOME}/lib/tools.jar"/>
|
2014-09-24 11:35:30 +02:00
|
|
|
<pathelement path="../arduino-core/arduino-core.jar"/>
|
2013-02-19 13:40:10 +01:00
|
|
|
</path>
|
|
|
|
|
|
|
|
<path id="class.path.test">
|
|
|
|
<path refid="class.path"/>
|
|
|
|
<pathelement location="bin/"/>
|
2013-02-20 10:02:17 +01:00
|
|
|
<fileset dir="test-lib">
|
|
|
|
<include name="*.jar"/>
|
|
|
|
</fileset>
|
2013-02-19 13:40:10 +01:00
|
|
|
</path>
|
|
|
|
|
2010-05-08 23:47:19 +02:00
|
|
|
<target name="clean" description="Clean the build directories">
|
|
|
|
<delete dir="bin" />
|
2012-12-04 13:43:21 +01:00
|
|
|
<delete dir="test-bin" />
|
2010-05-08 23:47:19 +02:00
|
|
|
<delete file="pde.jar" />
|
|
|
|
</target>
|
|
|
|
|
|
|
|
<target name="compile" description="Compile sources">
|
2014-09-24 11:35:30 +02:00
|
|
|
<condition property="core-built">
|
|
|
|
<available file="../arduino-core/arduino-core.jar" />
|
|
|
|
</condition>
|
|
|
|
<fail unless="core-built" message="Please build the Arduino-core library first and make sure it sits in ../arduino-core/arduino-core.jar" />
|
|
|
|
|
2010-05-08 23:47:19 +02:00
|
|
|
<mkdir dir="bin" />
|
|
|
|
|
|
|
|
<!-- ant seems to nuke ${java.home} for some reason, pointing at the JRE
|
|
|
|
subfolder instead of the actual JDK found at JAVA_HOME.
|
|
|
|
To avoid this, we grab the actual JAVA_HOME environment variable
|
|
|
|
and use that to specify the location of tools.jar. -->
|
|
|
|
|
|
|
|
<!-- if someone is better with ant please help clean this up -->
|
|
|
|
<property environment="env" />
|
|
|
|
<property name="java_home" value="${env.JAVA_HOME}" />
|
|
|
|
|
|
|
|
<condition property="linux"><os family="unix" /></condition>
|
2012-12-04 13:38:02 +01:00
|
|
|
<fail if="linux" unless="java_home"
|
2010-05-08 23:47:19 +02:00
|
|
|
message="The JAVA_HOME variable must be set to the location of a full JDK. For instance, on Ubuntu Linux, this might be /usr/lib/jvm/java-6-sun." />
|
|
|
|
|
|
|
|
<condition property="windows"><os family="windows" /></condition>
|
2012-12-04 13:38:02 +01:00
|
|
|
<fail if="windows" unless="java_home"
|
2010-05-08 23:47:19 +02:00
|
|
|
message="The JAVA_HOME variable must be set to the location of a full JDK. For instance, on Windows, this might be c:\jdk1.6.0_18." />
|
|
|
|
|
2015-03-26 09:59:40 +01:00
|
|
|
<condition property="work.dir" value="../build/macosx/work/Arduino.app/Contents/Java/">
|
2013-02-20 10:28:57 +01:00
|
|
|
<os family="mac"/>
|
|
|
|
</condition>
|
2013-02-20 10:56:48 +01:00
|
|
|
<condition property="java.additional.library.path" value=".">
|
2013-02-20 10:28:57 +01:00
|
|
|
<os family="mac"/>
|
|
|
|
</condition>
|
2013-02-20 10:02:17 +01:00
|
|
|
<condition property="work.dir" value="../build/windows/work/">
|
|
|
|
<os family="windows"/>
|
|
|
|
</condition>
|
2013-02-20 10:56:48 +01:00
|
|
|
<condition property="java.additional.library.path" value=".">
|
2013-02-20 10:28:57 +01:00
|
|
|
<os family="windows"/>
|
|
|
|
</condition>
|
|
|
|
<condition property="work.dir" value="../build/linux/work/">
|
|
|
|
<os family="unix"/>
|
|
|
|
</condition>
|
2013-02-20 10:56:48 +01:00
|
|
|
<condition property="java.additional.library.path" value="lib">
|
|
|
|
<os family="unix"/>
|
|
|
|
</condition>
|
2013-02-20 10:02:17 +01:00
|
|
|
|
2013-01-28 16:33:18 +01:00
|
|
|
<!--
|
|
|
|
<dirname property="blah" file="${java.home}" />
|
|
|
|
<echo message="here! ${java.home}/lib/tools.jar or there: ${blah}" />
|
|
|
|
<echo message="override ${env.JAVA_HOME}/lib/tools.jar" />
|
|
|
|
<fail />
|
|
|
|
-->
|
2015-06-16 09:24:34 +02:00
|
|
|
<javac source="1.8" target="1.8"
|
2012-12-04 13:38:02 +01:00
|
|
|
srcdir="src"
|
|
|
|
destdir="bin"
|
2010-05-08 23:47:19 +02:00
|
|
|
encoding="UTF-8"
|
|
|
|
includeAntRuntime="false"
|
2010-11-27 18:54:07 +01:00
|
|
|
debug="true"
|
2013-02-19 13:40:10 +01:00
|
|
|
classpathref="class.path" />
|
2019-07-05 10:02:07 +02:00
|
|
|
<!-- If you want to add files in the jars -->
|
|
|
|
<copy todir="bin" overwrite="true" verbose="true">
|
|
|
|
<fileset dir="src" includes="log4j2.xml" />
|
|
|
|
</copy>
|
2010-05-08 23:47:19 +02:00
|
|
|
</target>
|
2012-12-04 13:38:02 +01:00
|
|
|
|
2012-12-04 13:43:21 +01:00
|
|
|
<target name="test" depends="compile" description="Runs the test">
|
2012-12-04 13:38:02 +01:00
|
|
|
<mkdir dir="test-bin"/>
|
|
|
|
|
2015-06-16 09:24:34 +02:00
|
|
|
<javac source="1.8" target="1.8"
|
2012-12-04 13:38:02 +01:00
|
|
|
srcdir="test"
|
|
|
|
destdir="test-bin"
|
|
|
|
encoding="UTF-8"
|
|
|
|
includeAntRuntime="false"
|
2013-02-19 13:40:10 +01:00
|
|
|
debug="true"
|
|
|
|
classpathref="class.path.test">
|
2012-12-04 13:38:02 +01:00
|
|
|
</javac>
|
|
|
|
|
|
|
|
<copy todir="test-bin" overwrite="true" verbose="true">
|
|
|
|
<fileset dir="test" includes="**/*.zip" />
|
|
|
|
<fileset dir="test" includes="**/*.txt" />
|
2013-02-19 13:43:28 +01:00
|
|
|
<fileset dir="test" includes="**/*.properties" />
|
2013-10-22 17:51:54 +02:00
|
|
|
<fileset dir="test" includes="**/*.ino" />
|
2015-04-30 11:17:27 +02:00
|
|
|
<fileset dir="test" includes="**/*.json*" />
|
|
|
|
<fileset dir="test" includes="**/*.key" />
|
2015-06-18 12:22:55 +02:00
|
|
|
<fileset dir="test" includes="**/*.hex" />
|
2015-08-13 11:09:31 +02:00
|
|
|
<fileset dir="test" includes="**/*.pac" />
|
2012-12-04 13:38:02 +01:00
|
|
|
</copy>
|
|
|
|
|
2020-01-31 16:00:04 +01:00
|
|
|
<junit printsummary="yes" dir="${work.dir}" fork="true" showoutput="yes" failureproperty="test.failed">
|
2013-02-20 10:56:48 +01:00
|
|
|
<jvmarg value="-Djava.library.path=${java.additional.library.path}"/>
|
2015-02-03 17:00:51 +01:00
|
|
|
<jvmarg value="-DWORK_DIR=."/>
|
2015-05-12 15:22:56 +02:00
|
|
|
<jvmarg value="-ea"/>
|
2012-12-04 13:38:02 +01:00
|
|
|
<classpath>
|
|
|
|
<pathelement location="bin"/>
|
|
|
|
<pathelement location="test-bin"/>
|
2016-11-03 14:01:36 +01:00
|
|
|
<pathelement location="${work.dir}/lib/jna-4.2.2.jar"/>
|
|
|
|
<pathelement location="${work.dir}/lib/jna-platform-4.2.2.jar"/>
|
2013-02-19 13:40:10 +01:00
|
|
|
<path refid="class.path.test"/>
|
2012-12-04 13:38:02 +01:00
|
|
|
</classpath>
|
|
|
|
|
2012-12-04 13:43:21 +01:00
|
|
|
<formatter type="xml"/>
|
2012-12-04 13:38:02 +01:00
|
|
|
|
|
|
|
<batchtest fork="yes" todir="test-bin">
|
|
|
|
<fileset dir="test">
|
|
|
|
<include name="**/*Test.java"/>
|
2013-02-20 10:02:17 +01:00
|
|
|
<exclude name="**/Abstract*.java"/>
|
2012-12-04 13:38:02 +01:00
|
|
|
</fileset>
|
|
|
|
</batchtest>
|
|
|
|
</junit>
|
|
|
|
|
2020-01-31 16:00:04 +01:00
|
|
|
<fail if="test.failed"/>
|
2012-12-04 13:38:02 +01:00
|
|
|
</target>
|
|
|
|
|
2013-02-19 15:07:16 +01:00
|
|
|
<target name="build" depends="compile" description="Build PDE">
|
2010-05-08 23:47:19 +02:00
|
|
|
<jar basedir="bin" destfile="pde.jar" />
|
|
|
|
</target>
|
|
|
|
</project>
|