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"/>
|
|
|
|
<pathelement path="../core/core.jar"/>
|
|
|
|
</path>
|
|
|
|
|
|
|
|
<path id="class.path.test">
|
|
|
|
<path refid="class.path"/>
|
|
|
|
<pathelement location="bin/"/>
|
|
|
|
<pathelement path="test-lib/junit-4.11.jar"/>
|
|
|
|
</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">
|
|
|
|
<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"
|
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." />
|
|
|
|
|
|
|
|
<!--
|
|
|
|
<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 />
|
|
|
|
-->
|
2012-12-04 11:54:19 +01:00
|
|
|
<javac source="1.5" target="1.5"
|
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" />
|
2011-10-04 20:03:19 +02:00
|
|
|
<copy todir="bin" overwrite="true" verbose="true">
|
|
|
|
<fileset dir="src" includes="**/*.properties" />
|
|
|
|
</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"/>
|
|
|
|
|
|
|
|
<javac source="1.5" target="1.5"
|
|
|
|
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" />
|
|
|
|
</copy>
|
|
|
|
|
2013-01-23 13:04:45 +01:00
|
|
|
<junit printsummary="yes">
|
2012-12-04 13:38:02 +01:00
|
|
|
<classpath>
|
|
|
|
<pathelement location="bin"/>
|
|
|
|
<pathelement location="test-bin"/>
|
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"/>
|
|
|
|
</fileset>
|
|
|
|
</batchtest>
|
|
|
|
</junit>
|
|
|
|
|
|
|
|
</target>
|
|
|
|
|
2012-12-04 13:43:21 +01:00
|
|
|
<target name="build" depends="test" description="Build PDE">
|
2010-05-08 23:47:19 +02:00
|
|
|
<jar basedir="bin" destfile="pde.jar" />
|
|
|
|
</target>
|
|
|
|
</project>
|