|
11 | 11 | <property file="${user.home}/strongback/java/ant/build.properties" /> |
12 | 12 |
|
13 | 13 | <import file="${wpilib.ant.dir}/build.xml" /> |
14 | | - |
15 | | - <!-- Define the classpaths --> |
16 | | - <path id="compile.classpath"> |
17 | | - <fileset dir="${strongback.home}/java/lib" includes="**/*.jar" excludes="**/*-sources.jar" /> |
18 | | - <fileset dir="${user.home}/wpilib/java/${version}/lib" includes="**/*.jar" excludes="**/*-sources.jar" /> |
19 | | - <pathelement path="${classpath}" /> |
20 | | - </path> |
21 | 14 |
|
| 15 | + <!-- |
| 16 | + The Strongback and 3rd party libraries are installed (via the Strongback CLI) into the |
| 17 | + WPILib's `user/java/lib` directory and therefore are found, used, and deployed during the |
| 18 | + WPILib's standard Ant build process. |
| 19 | +
|
| 20 | + However, WPILib's build does not support unit tests, so this file defines Ant targets |
| 21 | + related only for unit testing. Thus, a robot project that uses Strongback at runtime |
| 22 | + and has no tests need not use this Ant file. |
| 23 | + --> |
| 24 | + |
22 | 25 | <!-- Define a classpath for unit testing --> |
23 | 26 | <path id="junit.classpath"> |
24 | | - <fileset dir="${strongback.home}/java/lib" includes="**/*.jar" excludes="**/*-sources.jar" /> |
25 | 27 | <fileset dir="${strongback.home}/java/lib-tests" includes="**/*.jar" excludes="**/*-sources.jar" /> |
26 | 28 | <pathelement location="${build.dir}" /> |
27 | 29 | <pathelement path="${classpath}" /> |
|
37 | 39 | <ant antfile="${wpilib.ant.dir}/build.xml" target="clean" /> |
38 | 40 | </target> |
39 | 41 |
|
40 | | - <target name="compile" description="Compile the source code."> |
41 | | - <mkdir dir="${build.dir}" /> |
42 | | - <javac srcdir="${src.dir}" destdir="${build.dir}" includeantruntime="false"> |
43 | | - <classpath refid="compile.classpath" /> |
44 | | - </javac> |
45 | | - <copy todir="${build.dir}"> |
46 | | - <fileset dir="${src.dir}" includes="**/*.xml,**/*.properties,**/*.txt,**/*.ico" /> |
47 | | - </copy> |
48 | | - <copy todir="${build.dir}" failonerror="false" quiet="true"> |
49 | | - <fileset dir="${resources.dir}" /> |
50 | | - </copy> |
51 | | - </target> |
52 | | - |
53 | | - <target name="jar" depends="compile"> |
54 | | - <echo>Making jar ${dist.jar}.</echo> |
55 | | - <mkdir dir="${dist.dir}" /> |
56 | | - <mkdir dir="${build.jars}" /> |
57 | | - |
58 | | - <echo>Copying jars from ${strongback.classpath} to ${build.jars}.</echo> |
59 | | - <copy todir="${build.jars}" flatten="true"> |
60 | | - <path> |
61 | | - <pathelement path="${strongback.classpath}" /> |
62 | | - </path> |
63 | | - </copy> |
64 | | - |
65 | | - <jar destfile="${dist.jar}" update="false"> |
66 | | - <manifest> |
67 | | - <attribute name="Main-Class" value="edu.wpi.first.wpilibj.RobotBase" /> |
68 | | - <attribute name="Robot-Class" value="${robot.class}" /> |
69 | | - <attribute name="Class-Path" value="." /> |
70 | | - </manifest> |
71 | | - |
72 | | - <fileset dir="${build.dir}" includes="**/*.class" /> |
73 | | - |
74 | | - <zipgroupfileset dir="${build.jars}"> |
75 | | - <include name="**/*.jar" /> |
76 | | - </zipgroupfileset> |
77 | | - </jar> |
78 | | - </target> |
79 | | - |
80 | 42 | <!-- Check if there are any JUnit Tests --> |
81 | 43 | <target name="if-tests"> |
82 | 44 | <condition property="tests-exists"> |
|
0 commit comments