Skip to content

Commit 89582b6

Browse files
committed
Correctly download and use 3rd party dependencies
Corrected the build to download the 3rd party dependencies correctly, and now generated property files that describe those dependencies.
1 parent 2738a9b commit 89582b6

File tree

3 files changed

+46
-5
lines changed

3 files changed

+46
-5
lines changed

.travis.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,8 @@
11
sudo: false
22
language: java
3+
before_install:
4+
- ant -version
5+
36
install: ant deps
47
script: ant test
58
jdk:

build.properties

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,6 @@ wpilib.updatesite.url=http://first.wpi.edu/FRC/roborio/release/eclipse
1414
ctre.download.url=http://www.ctr-electronics.com/downloads/lib/CTRE_FRCLibs_NON-WINDOWS.zip
1515

1616
#
17-
# The navX-MXP library is available in multiple ZIP files, but one only has the libraries.
17+
# The navX-MXP library is available in a ZIP file that has only the Java and C++ libraries.
1818
#
19-
navx.download.url=http://www.kauailabs.com/public_files/navx-mxp/navx-mxp-libs.zip
20-
19+
navx.download.url=http://www.kauailabs.com/public_files/navx-mxp/navx-mxp-libs.zip

build.xml

Lines changed: 41 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -118,10 +118,25 @@
118118
<mkdir dir="build"/>
119119

120120
<!-- Update the strongback.properties file -->
121+
<property file="${ctre.dir}/ctre.properties" prefix="ctre"/>
122+
<property file="${navx.dir}/navx.properties" prefix="navx"/>
121123
<copy file="strongback.properties" tofile="${build.dir}/strongback.properties"/>
122124
<propertyfile file="${build.dir}/strongback.properties">
123125
<entry key="strongback.version" value="${strongback.version}"/>
124126
<entry key="build.date" value="${current.date}"/>
127+
<entry key="wpilib.version" value="${wpilib.version}"/>
128+
<entry key="ctre.version" value="${ctre.CTRE.FRC.Java}"/>
129+
<entry key="navx.version" value="${navx.version}"/>
130+
</propertyfile>
131+
<propertyfile file="${build.dir}/ctre-lib-info.properties" comment="Generated by Strongback build system">
132+
<entry key="version" value="${ctre.CTRE.FRC.Java}"/>
133+
<entry key="name" value="TalonSRX Java Library"/>
134+
<entry key="jarNames" value="TalonSRXLibJava.jar"/>
135+
</propertyfile>
136+
<propertyfile file="${build.dir}/navx-lib-info.properties" comment="Generated by Strongback build system">
137+
<entry key="version" value="${navx.version}"/>
138+
<entry key="name" value="navX-MXP Java Library"/>
139+
<entry key="jarNames" value="navx_frc.jar"/>
125140
</propertyfile>
126141

127142
<!-- Build the TAR file, which should maintain file permissions -->
@@ -139,7 +154,7 @@
139154
<tarfileset dir="ant/strongback" includes="**" prefix="strongback/java/ant"/>
140155
<tarfileset dir="templates" includes="**" prefix="strongback/java/templates"/>
141156
<tarfileset dir="build/javadoc" includes="**" prefix="strongback/java/javadoc"/>
142-
<tarfileset dir="build" includes="strongback.properties" prefix="strongback"/>
157+
<tarfileset dir="build" includes="*.properties" prefix="strongback"/>
143158
<tarfileset dir="." includes="COPYRIGHT.txt" prefix="strongback"/>
144159
<tarfileset dir="." includes="LICENSE.txt" prefix="strongback"/>
145160
<tarfileset dir="." includes="README.md" prefix="strongback"/>
@@ -258,6 +273,19 @@
258273
<mkdir dir="${ctre.dir}"/>
259274
<unzip src="downloads/ctre.zip" dest="${ctre.dir}">
260275
</unzip>
276+
<!-- Load the version info into a properties file -->
277+
<loadfile property="ctre.version.properties" srcfile="${ctre.dir}/VERSION_NOTES">
278+
<filterchain>
279+
<!-- skip the first line -->
280+
<headfilter lines="-1" skip="1"/>
281+
<trim/>
282+
<replacestring from=": " to="="/>
283+
<replacestring from=" " to="."/>
284+
</filterchain>
285+
</loadfile>
286+
<!-- Write out a property file in the CTRE directory -->
287+
<echo file="${ctre.dir}/ctre.properties" append="false"># Downloaded and installed by Strongback build system${line.separator}</echo>
288+
<echo file="${ctre.dir}/ctre.properties" append="true">${ctre.version.properties}</echo>
261289
</target>
262290

263291
<!-- Download and extract the navX-MXP 3rd party library -->
@@ -272,7 +300,18 @@
272300
<echo>Downloading the navX-MXP library and installing into '${navx.dir}'.</echo>
273301
<get src="${navx.download.url}" dest="downloads/navx.zip"/>
274302
<mkdir dir="${navx.dir}"/>
275-
<unzip src="downloads/navx.zip" dest="${ctre.dir}">
303+
<unzip src="downloads/navx.zip" dest="${navx.dir}">
276304
</unzip>
305+
<!-- Load the version info into a property -->
306+
<loadfile property="navx.version" srcFile="${navx.dir}/version.txt">
307+
<filterchain>
308+
<striplinebreaks/>
309+
<trim/>
310+
</filterchain>
311+
</loadfile>
312+
<!-- Write out a property file in the navX directory -->
313+
<propertyfile file="${navx.dir}/navx.properties" comment="Downloaded and installed by Strongback build system">
314+
<entry key="version" value="${navx.version}"/>
315+
</propertyfile>
277316
</target>
278317
</project>

0 commit comments

Comments
 (0)