1
0
mirror of https://github.com/arduino/Arduino.git synced 2024-11-29 10:24:12 +01:00
Arduino/app/build.xml

142 lines
4.7 KiB
XML
Raw Normal View History

<?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"/>
<pathelement path="../core/core.jar"/>
</path>
<path id="class.path.test">
<path refid="class.path"/>
<pathelement location="bin/"/>
<fileset dir="test-lib">
<include name="*.jar"/>
</fileset>
2013-02-19 13:40:10 +01:00
</path>
<target name="clean" description="Clean the build directories">
<delete dir="bin" />
<delete dir="test-bin" />
<delete file="pde.jar" />
</target>
<target name="compile" description="Compile sources">
<condition property="core-built">
<available file="../core/core.jar" />
</condition>
<fail unless="core-built" message="Please build the core library first and make sure it sits in ../core/core.jar" />
<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"
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"
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." />
2013-02-20 10:28:57 +01:00
<condition property="work.dir" value="../build/macosx/work/Arduino.app/Contents/Resources/Java/">
<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>
<condition property="java.additional.jvmargs" value="-d32">
<os family="mac"/>
</condition>
<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>
2013-02-20 13:33:09 +01:00
<condition property="java.additional.jvmargs" value="-Ddummy=0">
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>
<condition property="java.additional.jvmargs" value="-Ddummy=0">
2013-02-20 10:28:57 +01:00
<os family="unix"/>
</condition>
<!--
<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 />
-->
<javac source="1.6" target="1.6"
2012-12-04 13:38:02 +01:00
srcdir="src"
destdir="bin"
encoding="UTF-8"
includeAntRuntime="false"
debug="true"
2013-02-19 13:40:10 +01:00
classpathref="class.path" />
<copy todir="bin" overwrite="true" verbose="true">
<fileset dir="src" includes="**/*.properties" />
</copy>
</target>
2012-12-04 13:38:02 +01:00
<target name="test" depends="compile" description="Runs the test">
2012-12-04 13:38:02 +01:00
<mkdir dir="test-bin"/>
<javac source="1.6" target="1.6"
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" />
<fileset dir="test" includes="**/*.ino" />
2012-12-04 13:38:02 +01:00
</copy>
<junit printsummary="yes" dir="${work.dir}" fork="true">
2013-02-20 10:56:48 +01:00
<jvmarg value="-Djava.library.path=${java.additional.library.path}"/>
2013-02-20 10:28:57 +01:00
<jvmarg value="${java.additional.jvmargs}"/>
2012-12-04 13:38:02 +01:00
<classpath>
<pathelement location="bin"/>
<pathelement location="test-bin"/>
2013-02-20 10:28:57 +01:00
<pathelement path="../build/macosx/work/Arduino.app/Contents/Resources/Java/quaqua.jar"/>
2013-02-19 13:40:10 +01:00
<path refid="class.path.test"/>
2012-12-04 13:38:02 +01:00
</classpath>
<formatter type="xml"/>
2012-12-04 13:38:02 +01:00
<batchtest fork="yes" todir="test-bin">
<fileset dir="test">
<include name="**/*Test.java"/>
<exclude name="**/Abstract*.java"/>
2012-12-04 13:38:02 +01:00
</fileset>
</batchtest>
</junit>
</target>
<target name="build" depends="compile" description="Build PDE">
<jar basedir="bin" destfile="pde.jar" />
</target>
</project>