build.xml: target download-library converted to a macro, easier to read

This commit is contained in:
Federico Fissore 2015-09-21 14:14:31 +02:00
parent a069fa40dd
commit 4aeac60bea
1 changed files with 22 additions and 43 deletions

View File

@ -73,8 +73,6 @@
<property name="ARDUINO-BUILDER-VERSION" value="1.0.0-beta9" />
<property name="LIB-VERSION-TEMBOO" value="1.1.3" />
<!-- Libraries required for running arduino -->
<fileset dir=".." id="runtime.jars">
<include name="arduino-core/arduino-core.jar" />
@ -188,49 +186,30 @@
</fileset>
</copy>
<antcall target="download-library">
<param name="name" value="Firmata"/>
<param name="version" value="2.4.4"/>
</antcall>
<antcall target="download-library">
<param name="name" value="Bridge"/>
<param name="version" value="1.0.7"/>
</antcall>
<antcall target="download-library">
<param name="name" value="Robot_Control"/>
<param name="version" value="1.0.2"/>
</antcall>
<antcall target="download-library">
<param name="name" value="Robot_Motor"/>
<param name="version" value="1.0.2"/>
</antcall>
<antcall target="download-library">
<param name="name" value="RobotIRremote"/>
<param name="version" value="1.0.2"/>
</antcall>
<antcall target="download-library">
<param name="name" value="SpacebrewYun"/>
<param name="version" value="1.0.0"/>
</antcall>
<antcall target="unzip">
<param name="archive_file" value="Temboo-${LIB-VERSION-TEMBOO}.zip" />
<param name="archive_url" value="https://github.com/temboo/Temboo/archive/${LIB-VERSION-TEMBOO}.zip" />
<param name="final_folder" value="${target.path}/libraries/Temboo-${LIB-VERSION-TEMBOO}" />
<param name="dest_folder" value="${target.path}/libraries" />
</antcall>
<move file="${target.path}/libraries/Temboo-${LIB-VERSION-TEMBOO}" tofile="${target.path}/libraries/Temboo" />
<download-library name="Firmata" version="2.4.4" tag="v2.4.4"/>
<download-library name="Bridge" version="1.0.7"/>
<download-library name="Robot_Control" version="1.0.2"/>
<download-library name="Robot_Motor" version="1.0.2"/>
<download-library name="RobotIRremote" version="1.0.2"/>
<download-library name="SpacebrewYun" version="1.0.0"/>
<download-library name="Temboo" version="1.1.3" githubuser="temboo"/>
</target>
<target name="download-library">
<antcall target="unzip">
<param name="archive_file" value="${name}-${version}.zip" />
<param name="archive_url" value="https://github.com/arduino-libraries/${name}/archive/${version}.zip" />
<param name="final_folder" value="${target.path}/libraries/${name}-${version}" />
<param name="dest_folder" value="${target.path}/libraries" />
</antcall>
<move file="${target.path}/libraries/${name}-${version}" tofile="${target.path}/libraries/${name}" />
</target>
<macrodef name="download-library">
<attribute name="name"/>
<attribute name="version"/>
<attribute name="tag" default="@{version}"/>
<attribute name="githubuser" default="arduino-libraries"/>
<sequential>
<antcall target="unzip">
<param name="archive_file" value="@{name}-@{version}.zip"/>
<param name="archive_url" value="https://github.com/@{githubuser}/@{name}/archive/@{tag}.zip"/>
<param name="final_folder" value="${target.path}/libraries/@{name}-@{version}"/>
<param name="dest_folder" value="${target.path}/libraries"/>
</antcall>
<move file="${target.path}/libraries/@{name}-@{version}" tofile="${target.path}/libraries/@{name}"/>
</sequential>
</macrodef>
<!-- copy hardware folder -->
<target name="assemble-hardware" unless="light_bundle">