|
1 | 1 | <?xml version="1.0"?>
|
2 | 2 | <project name="Arduino PDE" default="build">
|
3 |
| - |
| 3 | + |
4 | 4 | <target name="clean" description="Clean the build directories">
|
5 | 5 | <delete dir="bin" />
|
6 | 6 | <delete file="pde.jar" />
|
|
24 | 24 | <property name="java_home" value="${env.JAVA_HOME}" />
|
25 | 25 |
|
26 | 26 | <condition property="linux"><os family="unix" /></condition>
|
27 |
| - <fail if="linux" unless="java_home" |
| 27 | + <fail if="linux" unless="java_home" |
28 | 28 | 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." />
|
29 | 29 |
|
30 | 30 | <condition property="windows"><os family="windows" /></condition>
|
31 |
| - <fail if="windows" unless="java_home" |
| 31 | + <fail if="windows" unless="java_home" |
32 | 32 | 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." />
|
33 | 33 |
|
34 | 34 | <!--
|
|
38 | 38 | <fail />
|
39 | 39 | -->
|
40 | 40 | <javac source="1.5" target="1.5"
|
41 |
| - srcdir="src" |
42 |
| - destdir="bin" |
| 41 | + srcdir="src" |
| 42 | + destdir="bin" |
43 | 43 | encoding="UTF-8"
|
44 | 44 | includeAntRuntime="false"
|
45 | 45 | debug="true"
|
46 |
| - classpath="../core/core.jar; ${env.JAVA_HOME}/lib/tools.jar; lib/ant.jar; lib/ant-launcher.jar; lib/apple.jar; lib/ecj.jar; lib/jna.jar; lib/RXTXcomm.jar" /> |
| 46 | + classpath="../core/core.jar; ${env.JAVA_HOME}/lib/tools.jar; lib/apple.jar; lib/ecj.jar; lib/jna.jar; lib/RXTXcomm.jar" /> |
47 | 47 | <copy todir="bin" overwrite="true" verbose="true">
|
48 | 48 | <fileset dir="src" includes="**/*.properties" />
|
49 | 49 | </copy>
|
50 | 50 | </target>
|
51 |
| - |
52 |
| - <target name="build" depends="compile" description="Build PDE"> |
| 51 | + |
| 52 | + <target name="test" description="Runs the test"> |
| 53 | + <mkdir dir="test-bin"/> |
| 54 | + |
| 55 | + <javac source="1.5" target="1.5" |
| 56 | + srcdir="test" |
| 57 | + destdir="test-bin" |
| 58 | + encoding="UTF-8" |
| 59 | + includeAntRuntime="false" |
| 60 | + debug="true"> |
| 61 | + <classpath> |
| 62 | + <pathelement location="bin"/> |
| 63 | + <pathelement location="../core/core.jar"/> |
| 64 | + <pathelement location="${env.JAVA_HOME}/lib/tools.jar"/> |
| 65 | + <pathelement location="lib/apple.jar"/> |
| 66 | + <pathelement location="lib/ecj.jar"/> |
| 67 | + <pathelement location="lib/jna.jar"/> |
| 68 | + <pathelement location="lib/RXTXcomm.jar"/> |
| 69 | + <pathelement location="test-lib/junit-4.11.jar"/> |
| 70 | + </classpath> |
| 71 | + </javac> |
| 72 | + |
| 73 | + <copy todir="test-bin" overwrite="true" verbose="true"> |
| 74 | + <fileset dir="test" includes="**/*.zip" /> |
| 75 | + <fileset dir="test" includes="**/*.txt" /> |
| 76 | + </copy> |
| 77 | + |
| 78 | + <junit printsummary="yes" haltonfailure="yes"> |
| 79 | + <classpath> |
| 80 | + <pathelement location="bin"/> |
| 81 | + <pathelement location="test-bin"/> |
| 82 | + <pathelement location="../core/core.jar"/> |
| 83 | + <pathelement location="${env.JAVA_HOME}/lib/tools.jar"/> |
| 84 | + <pathelement location="lib/apple.jar"/> |
| 85 | + <pathelement location="lib/ecj.jar"/> |
| 86 | + <pathelement location="lib/jna.jar"/> |
| 87 | + <pathelement location="lib/RXTXcomm.jar"/> |
| 88 | + <pathelement location="test-lib/junit-4.11.jar"/> |
| 89 | + </classpath> |
| 90 | + |
| 91 | + <formatter type="plain"/> |
| 92 | + |
| 93 | + <batchtest fork="yes" todir="test-bin"> |
| 94 | + <fileset dir="test"> |
| 95 | + <include name="**/*Test.java"/> |
| 96 | + </fileset> |
| 97 | + </batchtest> |
| 98 | + </junit> |
| 99 | + |
| 100 | + </target> |
| 101 | + |
| 102 | + <target name="build" depends="compile,test" description="Build PDE"> |
53 | 103 | <jar basedir="bin" destfile="pde.jar" />
|
54 | 104 | </target>
|
55 | 105 | </project>
|
0 commit comments