(Not logged on) | Log On
View  History

  

download jsr166y Ant script

1/25/2008 1:51 PM
You can subscribe to this wiki article using an RSS feed reader.

Here is an Ant (version 1.6.5) script for downloading and extracting the jsr166y source tarball from Doug Lea's CVS repository. This works better than using a CVS client to checkout or update the source tree because the CVS server does not respond very well. However, the tarball does download pretty quickly. Instructions for use are in the comments.

<?xml version="1.0"?>
<!--

  This Ant script will download the JSR 166y source tarball from gee.cs.oswego.edu

  You can modify this to download other tarballs by changing the url property
  to one found elsewhere at http://gee.cs.oswego.edu/cgi-bin/viewcvs.cgi/jsr166/src/jsr166y/
  For example, the entire JSR 166 tarball is at http://gee.cs.oswego.edu/cgi-bin/viewcvs.cgi/jsr166.tar.gz?view=tar
  and tweaking the src.dir property (you can set that in download.properties)

  If you have a http proxy. you should also create a download.properties file that contains

    proxyHost=your.proxyhost
    proxy.port=your.proxy.portnumber

  -- David dot Biesack at sas dot com

  -->
<project name="downloadjsr166" default="download">
    <!-- Optionally set properties proxyHost and proxyPort in file download.properties -->
    <property file="download.properties" />
    <!-- You can also set these properties in download.properties if you want to download all of JSR 166 -->
    <property name="src.dir" value="src/jsr166y" />
    <property name="url" value="http://gee.cs.oswego.edu/cgi-bin/viewcvs.cgi/jsr166/src/jsr166y.tar.gz?view=tar" />
    <property name="file" value="tarball.tgz" />
    <property name="jsr166y.bin.dir" value="target/classes" />

    <target name="clean" description="Remove source and binaries before starting, since some files may have been removed at gee.cs">
        <delete dir="${src.dir}" includeemptydirs="true" verbose="true" />
        <delete dir="${jsr166y.bin.dir}" includeemptydirs="true" verbose="true" />
    </target>

    <target name="proxy" if="proxy.host" description="Set the proxy properties for the HTTP get task">
        <setproxy proxyhost="${proxy.host}" proxyport="${proxy.port}" />
        <echo>Set proxy to ${proxyHost} on port ${proxyPort}.</echo>
    </target>

    <target name="download" depends="clean, proxy" description="download and untar the jsr166y tarball">
        <get src="${url}" dest="${file}" />
        <untar src="${file}" dest="src" overwrite="false" compression="gzip" />
    </target>
</project>

-- David Biesack