Permalink
Browse files

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.
  • Loading branch information...
rhauch committed Jan 6, 2017
1 parent 2738a9b commit 89582b664942d1dc794a8ec5be37034cb8de07f6
Showing with 46 additions and 5 deletions.
  1. +3 −0 .travis.yml
  2. +2 −3 build.properties
  3. +41 −2 build.xml
View
@@ -1,5 +1,8 @@
sudo: false
language: java
before_install:
- ant -version
install: ant deps
script: ant test
jdk:
View
@@ -14,7 +14,6 @@ wpilib.updatesite.url=http://first.wpi.edu/FRC/roborio/release/eclipse
ctre.download.url=http://www.ctr-electronics.com/downloads/lib/CTRE_FRCLibs_NON-WINDOWS.zip
#
# The navX-MXP library is available in multiple ZIP files, but one only has the libraries.
# The navX-MXP library is available in a ZIP file that has only the Java and C++ libraries.
#
navx.download.url=http://www.kauailabs.com/public_files/navx-mxp/navx-mxp-libs.zip
navx.download.url=http://www.kauailabs.com/public_files/navx-mxp/navx-mxp-libs.zip
View
@@ -118,10 +118,25 @@
<mkdir dir="build"/>
<!-- Update the strongback.properties file -->
<property file="${ctre.dir}/ctre.properties" prefix="ctre"/>
<property file="${navx.dir}/navx.properties" prefix="navx"/>
<copy file="strongback.properties" tofile="${build.dir}/strongback.properties"/>
<propertyfile file="${build.dir}/strongback.properties">
<entry key="strongback.version" value="${strongback.version}"/>
<entry key="build.date" value="${current.date}"/>
<entry key="wpilib.version" value="${wpilib.version}"/>
<entry key="ctre.version" value="${ctre.CTRE.FRC.Java}"/>
<entry key="navx.version" value="${navx.version}"/>
</propertyfile>
<propertyfile file="${build.dir}/ctre-lib-info.properties" comment="Generated by Strongback build system">
<entry key="version" value="${ctre.CTRE.FRC.Java}"/>
<entry key="name" value="TalonSRX Java Library"/>
<entry key="jarNames" value="TalonSRXLibJava.jar"/>
</propertyfile>
<propertyfile file="${build.dir}/navx-lib-info.properties" comment="Generated by Strongback build system">
<entry key="version" value="${navx.version}"/>
<entry key="name" value="navX-MXP Java Library"/>
<entry key="jarNames" value="navx_frc.jar"/>
</propertyfile>
<!-- Build the TAR file, which should maintain file permissions -->
@@ -139,7 +154,7 @@
<tarfileset dir="ant/strongback" includes="**" prefix="strongback/java/ant"/>
<tarfileset dir="templates" includes="**" prefix="strongback/java/templates"/>
<tarfileset dir="build/javadoc" includes="**" prefix="strongback/java/javadoc"/>
<tarfileset dir="build" includes="strongback.properties" prefix="strongback"/>
<tarfileset dir="build" includes="*.properties" prefix="strongback"/>
<tarfileset dir="." includes="COPYRIGHT.txt" prefix="strongback"/>
<tarfileset dir="." includes="LICENSE.txt" prefix="strongback"/>
<tarfileset dir="." includes="README.md" prefix="strongback"/>
@@ -258,6 +273,19 @@
<mkdir dir="${ctre.dir}"/>
<unzip src="downloads/ctre.zip" dest="${ctre.dir}">
</unzip>
<!-- Load the version info into a properties file -->
<loadfile property="ctre.version.properties" srcfile="${ctre.dir}/VERSION_NOTES">
<filterchain>
<!-- skip the first line -->
<headfilter lines="-1" skip="1"/>
<trim/>
<replacestring from=": " to="="/>
<replacestring from=" " to="."/>
</filterchain>
</loadfile>
<!-- Write out a property file in the CTRE directory -->
<echo file="${ctre.dir}/ctre.properties" append="false"># Downloaded and installed by Strongback build system${line.separator}</echo>
<echo file="${ctre.dir}/ctre.properties" append="true">${ctre.version.properties}</echo>
</target>
<!-- Download and extract the navX-MXP 3rd party library -->
@@ -272,7 +300,18 @@
<echo>Downloading the navX-MXP library and installing into '${navx.dir}'.</echo>
<get src="${navx.download.url}" dest="downloads/navx.zip"/>
<mkdir dir="${navx.dir}"/>
<unzip src="downloads/navx.zip" dest="${ctre.dir}">
<unzip src="downloads/navx.zip" dest="${navx.dir}">
</unzip>
<!-- Load the version info into a property -->
<loadfile property="navx.version" srcFile="${navx.dir}/version.txt">
<filterchain>
<striplinebreaks/>
<trim/>
</filterchain>
</loadfile>
<!-- Write out a property file in the navX directory -->
<propertyfile file="${navx.dir}/navx.properties" comment="Downloaded and installed by Strongback build system">
<entry key="version" value="${navx.version}"/>
</propertyfile>
</target>
</project>

0 comments on commit 89582b6

Please sign in to comment.