This repository has been archived by the owner on Feb 14, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbuild.xml
201 lines (172 loc) · 6.92 KB
/
build.xml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
<project name="crio-project-build">
<!--
Supported Targets
jar
clean
deploy
run
javadoc
jar-deploy
-->
<taskdef resource="net/jtools/classloadertask/antlib.xml" classpath="${sunspot.home}/ant/ant-classloadertask.jar"/>
<classloader loader="system" classpath="${sunspot.home}/ant/commons-net-1.4.1.jar"/>
<classloader loader="system" classpath="${sunspot.home}/ant/jakarta-oro-2.0.8.jar"/>
<taskdef resource="net/sf/antcontrib/antlib.xml">
<classpath>
<pathelement location="${sunspot.home}/ant/ant-contrib.jar"/>
</classpath>
</taskdef>
<taskdef resource="com/sun/spot/sdk/tool/ftp/antlib.xml">
<classpath>
<pathelement location="${sunspot.home}/ant/sdktoolftp.jar"/>
<pathelement location="${sunspot.home}/ant/commons-net-1.4.1.jar"/>
<pathelement location="${sunspot.home}/ant/jakarta-oro-2.0.8.jar"/>
</classpath>
</taskdef>
<taskdef name="xmltask" classname="com.oopsconsultancy.xmltask.ant.XmlTask">
<classpath>
<pathelement location="${sunspot.home}/ant/xmltask.jar"/>
<pathelement location="ant/xmltask.jar"/>
</classpath>
</taskdef>
<property file="${user.properties.file}"/>
<property file="${sunspot.home}/default.properties"/>
<!--
START TEAM4931 MOD
-->
<!--
The "bin/preverify" executable is platform specific and therefore this 'sunspotfrcsdk' file set cannot be
used across different platforms. (Normally, the NetBeans installer will place the correct 'preverify' file
under 'bin' based upon the platform. But since we don't use that installer, we can simply change the build
to look at the platform and set the "preverify.executable" property to the location of the platform-specific
executable.
Note that we've also modified the "crio-preverify" macro call below to pass this property in as an argument.
The macrodef already had the defaulted argument available; we just are now using it.
-->
<condition property="preverify.executable" value="${sunspot.home}/platform-specific/linux-x86/preverify">
<and>
<os family="unix"/>
<not>
<!-- Mac OS X is also part of the linux family -->
<os name="Mac OS X"/>
</not>
</and>
</condition>
<condition property="preverify.executable" value="${sunspot.home}/platform-specific/macosx-x86/preverify">
<os name="Mac OS X"/>
</condition>
<condition property="preverify.executable" value="${sunspot.home}/platform-specific/windows-x86/preverify">
<os family="windows"/>
</condition>
<condition property="preverify.executable" value="${sunspot.home}/bin/preverify">
<not>
<isset property="preverify.executable"/>
</not>
</condition>
<!--
<echo>${os.family}</echo>
<echo>${os.name}</echo>
<echo>${os.arch}</echo>
<echo>${preverify.executable}</echo>
-->
<!--
END TEAM4931 MOD
-->
<import file="ant/compile.xml"/>
<import file="ant/deploy.xml"/>
<import file="ant/preverify.xml"/>
<import file="ant/suite.xml"/>
<import file="ant/configure.xml"/>
<import file="ant/jar-app.xml"/>
<import file="ant/classpath.xml"/>
<import file="ant/netbeans.xml"/>
<import file="ant/debug.xml"/>
<import file="ant/simulate.xml"/>
<target name="clean">
<delete dir="${build.dir}"/>
</target>
<target name="-actual-compile-compile" depends="clean">
<mkdir dir="${build.dir}"/>
<mkdir dir="${classes.dir}"/>
<crio-compile src.dir="${src.dir}" classes.dir="${classes.dir}" classpath="${classpath}" bootclasspath="${bootclasspath}"/>
</target>
<target name="-post-compile"/>
<target name="compile" depends="-actual-compile-compile,-post-compile"/>
<target name="preverify" depends="compile">
<mkdir dir="${preverify.dir}"/>
<mkdir dir="${preverify.raw.util.jar.classes.dir}"/>
<!--
START TEAM4931 MOD
<crio-preverify classes.dir="${classes.dir}" preverify.dir="${preverify.dir}" preverified.util.jars="${classpath}" raw.util.jar.classes.dir="${preverify.raw.util.jar.classes.dir}" raw.util.jars="" bootclasspath="${bootclasspath}"/>
-->
<crio-preverify classes.dir="${classes.dir}" preverify.dir="${preverify.dir}" preverified.util.jars="${classpath}" raw.util.jar.classes.dir="${preverify.raw.util.jar.classes.dir}" raw.util.jars="" bootclasspath="${bootclasspath}" preverify.executable="${preverify.executable}"/>
<!--
END TEAM4931 MOD
-->
</target>
<target name="jar-app" depends="jar"/>
<target name="jar" depends="preverify">
<crio-jar preverify.dir="${preverify.dir}" resources.dir="${resources.dir}" to.jar.file="${app.jar.file}" />
</target>
<target name="suite" depends="jar">
<mkdir dir="${suite.dir}"/>
<crio-suite in.jar.file="${app.jar.file}" target.dir="${suite.dir}" image.name="${suite.name}"/>
</target>
<target name="deploy" depends="suite">
<crio-configure remoteaddress="${remoteaddress}" type="Java" />
<crio-deploy suite.file="${suite.file}" remoteaddress="${remoteaddress}"/>
</target>
<target name="run">
<frcrun remoteaddress="${remoteaddress}"/>
</target>
<target name="javadoc">
<delete dir="doc"/>
<mkdir dir="doc"/>
<javadoc verbose="true" author="true" destdir="doc" link="file:///${sunspot.home}/doc/javadoc" linksource="true">
<classpath path="${full.classpath}:${full.bootclasspath}"/>
<fileset dir="src" >
<filename name="**/*.java"/>
</fileset>
</javadoc>
</target>
<target name="debug" depends="-do-debug"/>
<target name="debug-run">
<frcrun remoteaddress="${remoteaddress}" debug="true"/>
</target>
<target name="archive-source">
<zip destfile="${app.src.zip.file}" basedir="${src.dir}" />
</target>
<target name="archive-project">
<zip destfile="${app.project.zip.file}" basedir="${project.dir}" />
</target>
<!--
START TEAM4931 MOD
-->
<target name="jar-for-simulation" depends="compile">
<echo>[jar-for-simulation] Building jar.</echo>
<jar destfile="${simulation.jar.file}">
<manifest>
<attribute name="Built-By" value="${user.name}"/>
<attribute name="Robot-Class" value="${robot.class}"/>
<attribute name="Main-Class" value="edu.wpi.first.wpilibj.RobotBase"/>
</manifest>
<fileset dir="${classes.dir}" />
<zipgroupfileset dir="${simulation.lib}" includes="*.jar" />
</jar>
</target>
<target name="simulate" depends="jar-for-simulation">
<echo>[simulate] Running Core.</echo>
<exec executable="roscore" spawn="true"/>
<sleep seconds="5"/>
<echo>[simulate] Running Gazebo.</echo>
<exec executable="gazebo" spawn="true">
<arg value="${simulation.world.file}"/>
<arg value="-u"/>
</exec>
<echo>[simulate] Running Code.</echo>
<java jar="${simulation.jar.file}" fork="true"/>
</target>
<!--
END TEAM4931 MOD
-->
</project>