flex-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From josebarra...@apache.org
Subject [28/50] git commit: [flex-falcon] [refs/heads/maven] - New downloads.xml: - updated dependencies - fixed whitespace - fixed maintainability
Date Wed, 09 Jul 2014 23:31:40 GMT
New downloads.xml:
- updated dependencies
- fixed whitespace
- fixed maintainability

Signed-off-by: Erik de Bruin <erik@ixsoftware.nl>


Project: http://git-wip-us.apache.org/repos/asf/flex-falcon/repo
Commit: http://git-wip-us.apache.org/repos/asf/flex-falcon/commit/ac765e63
Tree: http://git-wip-us.apache.org/repos/asf/flex-falcon/tree/ac765e63
Diff: http://git-wip-us.apache.org/repos/asf/flex-falcon/diff/ac765e63

Branch: refs/heads/maven
Commit: ac765e63b6cece27ef5b83a29d6125512836b4fe
Parents: cdd4111
Author: Erik de Bruin <erik@ixsoftware.nl>
Authored: Tue Jun 24 15:46:08 2014 +0200
Committer: Erik de Bruin <erik@ixsoftware.nl>
Committed: Tue Jun 24 15:46:08 2014 +0200

----------------------------------------------------------------------
 compiler.jx/downloads.xml | 746 +++++++++++++++++------------------
 compiler/downloads.xml    | 877 +++++++++++++++++++----------------------
 2 files changed, 778 insertions(+), 845 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/flex-falcon/blob/ac765e63/compiler.jx/downloads.xml
----------------------------------------------------------------------
diff --git a/compiler.jx/downloads.xml b/compiler.jx/downloads.xml
index b1bc70c..628a70a 100644
--- a/compiler.jx/downloads.xml
+++ b/compiler.jx/downloads.xml
@@ -17,392 +17,378 @@
   limitations under the License.
 
 -->
-
 <project name="downloads" default="main" basedir=".">
 
-	<!-- this script supports the usingDownloadCache property and
-	     downloadCacheFolder property to cache downloads in the
-		 folder specified by downloadCacheFolder.  This can make
-		 a huge difference in future runs although there is some
-		 risk around caching bad downloads and/or needing to
-		 clean up the cache -->
-	
-	<property name="FALCONJX_HOME" location="."/>
-    <property name="lib.dir" value="${FALCONJX_HOME}/lib"/>    
-	<property name="download.dir" value="${FALCONJX_HOME}/in"/>
-    <property file="${basedir}/local.properties"/>
-    <property name="closure.download.server" value="http://search.maven.org" />
-    <property name="closure.download.folder" value="remotecontent?filepath=com/google/javascript/closure-compiler/v20131014" />
-    <property name="closure.download.filename" value="closure-compiler-v20131014.jar" />
-    <property name="closure.download.checksum" value="e9b4b20ef9ff13c13fb159a9efff33ea" />
-    
-    <property name="guava.name" value="guava-15.0"/>
-    
-	<!-- 
-	   Notes:
-	       For Apache, the JARS must be removed from the repository.
-	       
-	       Licenses:
-            commons-io (2.0.1) - Apache 2.0
-	        closure (9.2) - Apache 2.0
-	        
-	-->
-	
-    <property name="commons-io.name" value="commons-io-2.0.1"/>
+  <!-- 
+      Notes:
+          For Apache, the JARS must be removed from the repository.
+
+          Licenses:
+              commons-io (2.0.1) - Apache 2.0
+              closure (9.2) - Apache 2.0
+  -->
+
+  <!-- this script supports the usingDownloadCache property and
+       downloadCacheFolder property to cache downloads in the
+       folder specified by downloadCacheFolder.  This can make
+       a huge difference in future runs although there is some
+       risk around caching bad downloads and/or needing to
+       clean up the cache -->
+
+  <property name="FALCONJX_HOME" location="."/>
+
+  <property name="lib.dir" value="${FALCONJX_HOME}/lib"/>
+  <property name="download.dir" value="${FALCONJX_HOME}/in"/>
+
+  <property file="${basedir}/local.properties"/>
+
+  <property name="maven.search.url" value="http://search.maven.org/remotecontent?filepath="/>
+
+
+
+  <!-- 
+      Because the downloads requires a network connection and the JARs don't change very often, 
+      they are each downloaded only if they don't already exist. 
+  -->
+  <target name="main" depends="prepare, all" description="Downloads all the required thirdparty JARs"/>
+  
+  <target name="prepare">
+    <echo message="Making lib directory ${lib.dir}"/>
+    <mkdir dir="${lib.dir}"/>
+  </target>
+
+
+
+  <!--
+      Downloads
+  -->
+
+  <target name="all" description="Downloads and copies all dependencies to the lib directory.">
+    <!--  args4j -->
+    <property name="args4j.name" value="args4j"/>
+    <property name="args4j.version" value="2.0.28"/>
+    <!-- property name="args4j.version" value="2.0.16"/ -->
+    <antcall target="download-dependency">
+      <param name="name" value="${args4j.name}"/>
+      <param name="src.server" value="${maven.search.url}"/>
+      <param name="src.folder" value="args4j/args4j/${args4j.version}"/>
+      <param name="src.filename" value="args4j-${args4j.version}.jar"/>
+      <param name="src.checksum" value="e0593b60af743a63f9678399d275272a"/>
+      <!-- param name="src.checksum" value="6571d69d142dd2a003c4ffae6138f0ee"/ --><!-- version 2.0.16 -->
+      <param name="dest.folder" value=""/>
+      <param name="dest.filename" value="${args4j.name}.jar"/>
+    </antcall>
+
+    <!--  closure -->
     <property name="closure.name" value="compiler"/>
-	
-    <!-- 
-        Because the downloads requires a network connection and the JARs don't change very often, 
-        they are each downloaded only if they don't already exist. 
-    -->
-    
-	<target name="main" depends="prepare, commons-io-jar-jx, closure-jar, guava-jar, args4j-jar, org.json-jar"
-		description="Downloads all the required thirdparty JARs"/>
-
-    <target name="prepare" >
-		<echo message="Making lib directory ${lib.dir}"/>
-        <mkdir dir="${lib.dir}" />
-    </target>
-	
-	
-    <!--
-	    Download thirdparty JARs    
-	-->
-
-    <!--
-        Download a zip or gz file, extracts the jar file, and optionally copies the jar
-        file to a different location and optinally verifies the checksum and optionally
-		caches the file, and optionally pulls the file from the cache instead of downloading.  
-        If the checksum fails, this script fails.
-
-        Params are:
-            srcDomain - the domain
-			srcFolder - path to file
-            srcFile - a .gz file for untar with gzip, else unzip
-            [md5]
-            [srcJarPath] - both src and dest required for the copy
-            [destJarFile]
-
-        Note: This is purposely coded without <if><else><then> so that a dependency on
-        ant-contrib.jar isn't required.        
-    -->
-    
-    <target name="download-zip" depends="check-cache"
-        description="Downloads tar/zip, and optionally verifies checksum and copies extracted jar.">                
-        
-        <mkdir dir="${download.dir}"/>        
-    	
-        <antcall target="get-if-not-cached">
-			<param name="dest" value="${download.dir}/${srcFile}"/>
-            <param name="message" value="Checksum mismatch for ${download.dir}/${srcFile}"/>
-		</antcall>
-		<antcall target="copy-if-cached">
-			<param name="dest" value="${download.dir}/${srcFile}"/>
-		</antcall>
-        
-        <condition property="zip.compressed">
-            <matches string="${srcFile}" pattern="^*.zip$"/>      
-        </condition>
- 
-        <antcall target="untar-file"/>
-        <antcall target="unzip-file"/>
-        
-        <condition property="destination.known">
-            <and>
-                <isset property="srcJarPath"/>
-                <isset property="destJarFile"/>
-            </and>
-        </condition> 
-        <antcall target="copy-downloaded-jar"/>
-     </target>   	
-     
-    <target name="download-bz2" depends="check-cache"
-        description="Downloads bz2, and optionally verifies checksum and copies extracted jar.">                
-        
-        <mkdir dir="${download.dir}"/>        
-    	
-        <antcall target="get-if-not-cached">
-			<param name="dest" value="${download.dir}/${srcFile}"/>
-            <param name="message" value="Checksum mismatch for ${download.dir}/${srcFile}"/>
-		</antcall>
-		<antcall target="copy-if-cached">
-			<param name="dest" value="${download.dir}/${srcFile}"/>
-		</antcall>
-
-        <untar src="${download.dir}/${srcFile}" dest="${download.dir}/temp" compression="bzip2"/> 
-                
-        <condition property="destination.known">
-            <and>
-                <isset property="srcJarPath"/>
-                <isset property="destJarFile"/>
-            </and>
-        </condition> 
-        <antcall target="copy-downloaded-jar"/>
-     </target>   	
-     
-    <!--
-        Download a jar file and optionally verify the checksum.
-        If the checksum fails, this script fails.
-        
-        Params are:
-            srcDomain
-			srcFolder
-            srcFile
-            destJarFile
-            [md5]
-    -->
-    <target name="download-jar" depends="check-cache"
-        description="Downloads jar, and optionally verifies checksum.">                
-     
-        <antcall target="get-if-not-cached">
-			<param name="dest" value="${destJarFile}"/>
-            <param name="message" value="Checksum mismatch for ${destJarFile}"/>
-		</antcall>
-		<antcall target="copy-if-cached">
-			<param name="dest" value="${destJarFile}"/>
-		</antcall>
-    </target>
-
-    <target name="untar-file" unless="zip.compressed" description="Untars zipFile">
-        <untar src="${download.dir}/${srcFile}" dest="${download.dir}/temp" compression="gzip"/> 
-    </target>
-    
-    <target name="unzip-file" if="zip.compressed" description="Unzips zipFile">
-        <unzip src="${download.dir}/${srcFile}" dest="${download.dir}/temp"/>    
-    </target>
-    
-    <target name="get-if-not-cached" unless="found-in-cache"> 
-        <get src="${srcDomain}/${srcFolder}/${srcFile}" dest="${dest}"/>
-        <antcall target="check-sum">
-			<param name="dest" value="${dest}" />
-            <param name="message" value="Checksum mismatch for ${dest}"/>
-        </antcall>
-		<antcall target="put-in-cache" />
-	</target>
-	
-    <target name="copy-if-cached" if="found-in-cache">
-		<!-- this string comes from the FlexJS en_US.properties because for now, this
-		     target won't get called unless this script is called from the FlexJS install -->
-		<echo>${INFO_USING_CACHED_FILE} ${downloadCacheFolder}/${srcFolder}/${srcFile}</echo>
-		<copy file="${downloadCacheFolder}/${srcFolder}/${srcFile}" tofile="${dest}" overwrite="true" />
-	</target> 
-	
-    <target name="check-cache" if="usingDownloadCache">
-		<available file="${downloadCacheFolder}/${srcFolder}/${srcFile}" property="found-in-cache" />
-	</target> 
-	
-    <target name="put-in-cache" if="usingDownloadCache">
-		<copy tofile="${downloadCacheFolder}/${srcFolder}/${srcFile}" file="${dest}" />
-	</target> 
-	
-    <target name="check-sum" if="md5" 
-        description="Verifies MD5 checksum, and fails if checksum doesn't match">
-        
-        <checksum file="${dest}" algorithm="MD5" verifyproperty="we.failed" property="${md5}" />
-        <fail message="${message}">
-			<condition>
-				<equals arg1="${we.failed}" arg2="false" />
-			</condition>
-		</fail>
-    </target>
-    
-    <target name="copy-downloaded-jar" if="destination.known">
-        <mkdir dir="${lib.dir}"/>
-        <copy file="${download.dir}/temp/${srcJarPath}" toFile="${destJarFile}" verbose="true"/>
-    </target>
-    
-    <target name="fail-with-message" if="we.failed" 
-        description="Conditionally fails with the specified message">                
-        <fail message="${message}"/>
-    </target>
-	
-	<!--
-	    closure - JS compiler, minimizer, etc.
-	-->
-	
-	<target name="closure-jar-check" description="Checks if closure jar exists.">
-	    <available file="${lib.dir}/google/closure-compiler/compiler.jar" property="closure.jar.exists" />
-	</target>
-	
-	<target name="closure-jar" depends="closure-jar-check" unless="closure.jar.exists" 
-	    description="Copies the closure build jars.">
-		<mkdir dir="${lib.dir}/google/closure-compiler" />
-        <antcall target="echo-closure-jar">
-            <param name="srcDomain" value="${closure.download.server}"/>
-            <param name="srcFolder" value="${closure.download.folder}"/>
-            <!--
-             erikdebruin: because of a dependency Falcon has on an old version of Guava,
-             any versions of the Closure compiler after sept. 17, 2012 cause exceptions
-             when doing a release build with FalconJx.
-             
-             Was: param name="zipFile" value="compiler-latest.zip"
-             -->
-            <param name="srcFile" value="${closure.download.filename}"/>
-        </antcall>
-	    <antcall target="download-jar">
-            <param name="srcDomain" value="${closure.download.server}"/>
-            <param name="srcFolder" value="${closure.download.folder}"/>
-	      <!-- 
-				erikdebruin: because of a dependency Falcon has on an old version of Guava, 
-				any versions of the Closure compiler after sept. 17, 2012 cause exceptions 
-				when doing a release build with FalconJx.
-				
-				Was: param name="zipFile" value="compiler-latest.zip"
-				-->
-	      <param name="srcFile" value="${closure.download.filename}"/>
-          <param name="cacheFolder" value="com/google/javascript/closure-compiler/v20131014"/>
-          <param name="destJarFile" value="${lib.dir}/google/closure-compiler/compiler.jar"/>
-          <param name="md5" value="${closure.download.checksum}"/>
-	    </antcall>
-	    <get src="http://www.apache.org/licenses/LICENSE-2.0" dest="${lib.dir}/google/closure-compiler/closure-LICENSE.txt"/>
-	    <copy todir="${lib.dir}/google/closure-compiler">
-	        <fileset dir="${download.dir}/temp">
-	            <include name="${closure.name}.jar"/>
-	        </fileset>
-	    </copy>
-	    <delete includeemptydirs="true">
-	        <fileset dir="${download.dir}/temp" includes="**/*"/>
-	    </delete>    
-	</target>
-
-    <target name="echo-closure-jar" if="installer">
-        <echo file="${basedir}/closure.properties">closure.echo=${INFO_DOWNLOADING_FILE_FROM}</echo>
-        <replace file="${basedir}/closure.properties" token="{0}" value="${srcFile}" />
-        <replace file="${basedir}/closure.properties" token="{1}" value="${srcDomain}/${srcFolder}" />
-        <property file="${basedir}/closure.properties" />
-        <delete file="${basedir}/closure.properties" />
-        <echo>${closure.echo}</echo>
-    </target>
-    
-	   <!--
-	        commons-io
-	    -->
-	    
-    <target name="commons-io-jar-check" description="Checks if commons-io.jar is in lib directory.">
-        <available file="${lib.dir}/commons-io.jar" property="commons.io.jar.exists"/>
-    </target>
-    
-    <target name="commons-io-jar-jx" depends="commons-io-jar-check" 
-        unless="commons.io.jar.exists" 
-        description="Copies commons-io.jar to the lib directory.">
-                
-        <antcall target="echo-commons-jar">
-            <param name="srcDomain" value="http://archive.apache.org"/>
-            <param name="srcFolder" value="dist/commons/io/binaries"/>
-            <param name="srcFile" value="${commons-io.name}-bin.tar.gz"/>
-        </antcall>
-        <antcall target="download-zip">
-          <param name="srcDomain" value="http://archive.apache.org"/>
-          <param name="srcFolder" value="dist/commons/io/binaries"/>
-          <param name="srcFile" value="${commons-io.name}-bin.tar.gz"/>
-          <param name="md5" value="4f2c26f9d80f89d15939619cc8524f78"/>
-          <param name="srcJarPath" value="${commons-io.name}/${commons-io.name}.jar"/>
-          <param name="destJarFile" value="${lib.dir}/commons-io.jar"/>
-        </antcall>
-        <copy todir="${lib.dir}">
-            <fileset dir="${download.dir}/temp/${commons-io.name}">
-                <include name="LICENSE.txt"/>
-            </fileset>            
-            <globmapper from="*" to="commons-io-*"/>
-        </copy>
-        <delete dir="${download.dir}/temp/${commons-io.name}"/>
-    </target>
-        
-    <target name="echo-commons-jar" if="installer">
-        <echo file="${basedir}/commons.properties">commons.echo=${INFO_DOWNLOADING_FILE_FROM}</echo>
-        <replace file="${basedir}/commons.properties" token="{0}" value="${srcFile}" />
-        <replace file="${basedir}/commons.properties" token="{1}" value="${srcDomain}/${srcFolder}" />
-        <property file="${basedir}/commons.properties" />
-        <delete file="${basedir}/commons.properties" />
-        <echo>${commons.echo}</echo>
-    </target>
-    
-	<!--
-     guava - collections and other common constructs
-     -->
-    
-    <target name="guava-jar-check" description="Checks if guava.jar is in lib directory.">
-        <available file="${lib.dir}/guava.jar" property="guava.jar.exists"/>
-    </target>
-    
-    <target name="guava-jar" depends="guava-jar-check"
-        unless="guava.jar.exists"
-        description="Downloads and copies guava.jar to the lib directory.">
-        <echo file="${basedir}/guava.properties">guava.echo=${INFO_DOWNLOADING_FILE_FROM}</echo>
-        <replace file="${basedir}/guava.properties" token="{0}" value="guava-15.0.jar" />
-        <replace file="${basedir}/guava.properties" token="{1}" value="http://search.maven.org/remotecontent?filepath=com/google/guava/guava/15.0" />
-        <property file="${basedir}/guava.properties" />
-        <delete file="${basedir}/guava.properties" />
-        <echo>${guava.echo}</echo>
-        <antcall target="download-jar">
-            <param name="srcDomain" value="http://search.maven.org"/>
-            <param name="srcFolder" value="remotecontent?filepath=com/google/guava/guava/15.0"/>
-            <param name="cacheFolder" value="com/google/guava/guava/15.0"/>
-            <param name="srcFile" value="guava-15.0.jar"/>
-            <param name="destJarFile" value="${lib.dir}/guava.jar"/>
-			<param name="md5" value="2c10bb2ca3ac8b55b0e77e54a7eb3744"/>
-        </antcall>
-        <get src="http://www.apache.org/licenses/LICENSE-2.0" dest="${lib.dir}/guava-LICENSE.txt"/>
-    </target>
-    
-    <target name="args4j-jar-check" description="Checks if args4j.jar is in lib directory.">
-        <available file="${lib.dir}/args4j.jar" property="args4j.jar.exists"/>
-    </target>
+    <property name="closure.version" value="20140508"/>
+    <property name="closure.dest.folder" value="google/closure-compiler"/>
+    <property name="closure.dest.filename" value="${closure.name}.jar"/>
+    <antcall target="download-dependency-closure">
+      <param name="name" value="${closure.name}"/>
+      <param name="src.server" value="https://github.com"/>
+      <param name="src.folder" value="google/closure-compiler/archive"/>
+      <param name="src.filename" value="v${closure.version}.zip"/>
+      <param name="src.checksum" value="b4e4e20f32730b2aeb220e306f605236"/>
+      <param name="dest.folder" value="${closure.dest.folder}"/>
+      <param name="dest.filename" value="${closure.dest.filename}"/>
+    </antcall>
     
-    <target name="args4j-jar" depends="args4j-jar-check"
-        unless="args4j.jar.exists"
-        description="Downloads and copies args4j.jar to the lib directory.">
-        <echo file="${basedir}/args4j.properties">args4j.echo=${INFO_DOWNLOADING_FILE_FROM}</echo>
-        <replace file="${basedir}/args4j.properties" token="{0}" value="args4j-2.0.16.jar" />
-        <replace file="${basedir}/args4j.properties" token="{1}" value="http://search.maven.org/remotecontent?filepath=args4j/args4j/2.0.16" />
-        <property file="${basedir}/args4j.properties" />
-        <delete file="${basedir}/args4j.properties" />
-        <echo>${args4j.echo}</echo>
-        <antcall target="download-jar">
-            <param name="srcDomain" value="http://search.maven.org"/>
-            <param name="srcFolder" value="remotecontent?filepath=args4j/args4j/2.0.16"/>
-            <param name="cacheFolder" value="args4j/args4j/2.0.16"/>
-            <param name="srcFile" value="args4j-2.0.16.jar"/>
-            <param name="destJarFile" value="${lib.dir}/args4j.jar"/>
-			<param name="md5" value="6571d69d142dd2a003c4ffae6138f0ee"/>
-        </antcall>
-        <get src="http://www.apache.org/licenses/LICENSE-2.0" dest="${lib.dir}/args4j-LICENSE.txt"/>
-    </target>
-    
-    <target name="org.json-jar-check" description="Checks if org.json.jar is in lib directory.">
-        <available file="${lib.dir}/org.json.jar" property="org.json.jar.exists"/>
-    </target>
+    <!--  commons-io -->
+    <property name="commons-io.name" value="commons-io"/>
+    <property name="commons-io.version" value="2.4"/>
+    <!-- property name="commons-io.version" value="2.0.1"/ -->
+    <antcall target="download-dependency">
+      <param name="name" value="${commons-io.name}"/>
+      <param name="src.server" value="http://archive.apache.org"/>
+      <param name="src.folder" value="dist/commons/io/binaries"/>
+      <param name="src.filename" value="${commons-io.name}-${commons-io.version}-bin.tar.gz"/>
+      <param name="src.checksum" value="50ce698bd6e33dc6f71570189df89c99"/>
+      <!-- param name="src.checksum" value="89fef81c2adfa9b50a64ed5cd5d8c155"/ --><!-- version 2.0.1 -->
+      <param name="src.jarPath" value="${commons-io.name}-${commons-io.version}/${commons-io.name}-${commons-io.version}.jar"/>
+      <param name="dest.jarPath" value="${lib.dir}/${commons-io.name}.jar"/>
+      <param name="dest.folder" value=""/>
+      <param name="dest.filename" value="${commons-io.name}.jar"/>
+    </antcall>
+    <copy todir="${lib.dir}" failonerror="false" quiet="true">
+      <fileset dir="${download.dir}/temp/${commons-io.name}-${commons-io.version}">
+        <include name="LICENSE.txt"/>
+      </fileset>
+      <globmapper from="*" to="commons-io-*"/>
+    </copy>
+
+    <!--  guava -->
+    <property name="guava.name" value="guava"/>
+    <property name="guava.version" value="17.0"/>
+    <!-- property name="guava.version" value="15.0"/ -->
+    <antcall target="download-dependency">
+      <param name="name" value="${guava.name}"/>
+      <param name="src.server" value="${maven.search.url}"/>
+      <param name="src.folder" value="com/google/guava/guava/${guava.version}"/>
+      <param name="src.filename" value="guava-${guava.version}.jar"/>
+      <param name="src.checksum" value="89fef81c2adfa9b50a64ed5cd5d8c155"/>
+      <!-- param name="src.checksum" value="e0593b60af743a63f9678399d275272a"/ --><!-- version 2.0.16 -->
+      <param name="dest.folder" value=""/>
+      <param name="dest.filename" value="${guava.name}.jar"/>
+    </antcall>
+
+    <!--  org.json -->
+    <property name="org.json.name" value="org.json"/>
+    <property name="org.json.version" value="20131017"/>
+    <!-- property name="org.json.version" value="20130213"/ -->
+    <antcall target="download-dependency">
+      <param name="name" value="${org.json.name}"/>
+      <param name="src.server" value="${maven.search.url}"/>
+      <param name="src.folder" value="org/codeartisans/org.json/${org.json.version}"/>
+      <param name="src.filename" value="org.json-${org.json.version}.jar"/>
+      <param name="src.checksum" value="f1aa9ffeda57b9117e79407acc860e74"/>
+      <!-- param name="src.checksum" value="e0593b60af743a63f9678399d275272a"/ --><!-- version 20130213 -->
+      <param name="dest.folder" value=""/>
+      <param name="dest.filename" value="${org.json.name}.jar"/>
+    </antcall>
+  </target>
+
+
+
+  <!--
+      Utilities
+  -->
+
+  <target name="check-dependency" description="Checks if project jar is in lib directory.">
+    <available file="${lib.dir}/${dest.folder}/${name}.jar" property="project.jar.exists"/>
+  </target>
+
+  <target name="echo-project-jar" if="installer">
+    <echo file="${basedir}/project.properties">project.echo=${INFO_DOWNLOADING_FILE_FROM}</echo>
+    <replace file="${basedir}/project.properties" token="{0}" value="${srcFile}"/>
+    <replace file="${basedir}/project.properties" token="{1}" value="${srcPath}"/>
+    <property file="${basedir}/project.properties"/>
+    <delete file="${basedir}/project.properties"/>
+    <echo>${project.echo}</echo>
+  </target>
+  
+  <target name="download-dependency" depends="check-dependency" unless="project.jar.exists" description="Downloads a jar + license to the lib directory.">
+    <antcall target="echo-project-jar">
+      <param name="srcDomain" value="${src.server}"/>
+      <param name="srcPath" value="${src.folder}/${src.filename}"/>
+    </antcall>
+    <mkdir dir="${lib.dir}/${dest.folder}"/>
+
+    <get src="http://www.apache.org/licenses/LICENSE-2.0" dest="${lib.dir}/${dest.folder}/${name}-LICENSE.txt"/>
+
+    <condition property="project.download.jar" value="true" else="false">
+      <contains string="${src.filename}" substring=".jar" />
+    </condition>
     
-    <target name="org.json-jar" depends="org.json-jar-check"
-        unless="org.json.jar.exists"
-        description="Downloads and copies org.json.jar to the lib directory.">
-        <echo file="${basedir}/org.json.properties">org.json.echo=${INFO_DOWNLOADING_FILE_FROM}</echo>
-        <replace file="${basedir}/org.json.properties" token="{0}" value="org.json-20130213.jar" />
-        <replace file="${basedir}/org.json.properties" token="{1}" value="http://search.maven.org/remotecontent?filepath=org/codeartisans/org.json/20130213" />
-        <property file="${basedir}/org.json.properties" />
-        <delete file="${basedir}/org.json.properties" />
-        <echo>${org.json.echo}</echo>
-        <antcall target="download-jar">
-            <param name="srcDomain" value="http://search.maven.org"/>
-            <param name="srcFolder" value="remotecontent?filepath=org/codeartisans/org.json/20130213"/>
-            <param name="cacheFolder" value="org/codeartisans/org.json/20130213"/>
-            <param name="srcFile" value="org.json-20130213.jar"/>
-            <param name="destJarFile" value="${lib.dir}/org.json.jar"/>
-			<param name="md5" value="a865b42221d2687244a679fa4e5425d5"/>
-        </antcall>
-        <get src="http://www.apache.org/licenses/LICENSE-2.0" dest="${lib.dir}/org.json-LICENSE.txt"/>
-    </target>
+    <antcall target="download-dependency-jar">
+      <param name="server" value="${src.server}"/>
+      <param name="folder" value="${src.folder}"/>
+      <param name="srcFileName" value="${src.filename}"/>
+      <param name="destJarFileName" value="${lib.dir}/${dest.folder}/${dest.filename}"/>
+      <param name="checksum" value="${src.checksum}"/>
+    </antcall>
+
+    <antcall target="download-dependency-zip">
+      <param name="server" value="${src.server}"/>
+      <param name="folder" value="${src.folder}"/>
+      <param name="srcFileName" value="${src.filename}"/>
+      <param name="srcJarPath" value="${src.jarPath}"/>
+      <param name="destJarPath" value="${dest.jarPath}"/>
+      <param name="checksum" value="${src.checksum}"/>
+    </antcall>
+  </target>
+
+  <target name="download-dependency-closure" depends="check-dependency" unless="project.jar.exists" description="Downloads a jar + license to the lib directory.">
+    <antcall target="echo-project-jar">
+      <param name="srcDomain" value="${src.server}"/>
+      <param name="srcPath" value="${src.folder}/${src.filename}"/>
+    </antcall>
+    <mkdir dir="${lib.dir}/${dest.folder}"/>
+
+    <get src="http://www.apache.org/licenses/LICENSE-2.0" dest="${lib.dir}/${dest.folder}/${name}-LICENSE.txt"/>
+
+    <antcall target="download-dependency-zip-closure">
+      <param name="server" value="${src.server}"/>
+      <param name="folder" value="${src.folder}"/>
+      <param name="srcFileName" value="${src.filename}"/>
+      <param name="checksum" value="${src.checksum}"/>
+    </antcall>
+
+    <ant dir="${download.dir}/temp/closure-compiler-${closure.version}" inheritAll="false" />
+
+    <copy file="${download.dir}/temp/closure-${closure.name}-${closure.version}/build/${closure.name}.jar" toFile="${lib.dir}/${closure.dest.folder}/${closure.dest.filename}" verbose="true"/>
+  </target>
+
+  <target name="download-dependency-jar" if="${project.download.jar}" description="Downloads a jar to the lib directory.">
+    <antcall target="download-jar">
+      <param name="srcDomain" value="${server}"/>
+      <param name="srcFolder" value="${folder}"/>
+      <param name="cacheFolder" value="${folder}"/>
+      <param name="srcFile" value="${srcFileName}"/>
+      <param name="destJarFile" value="${destJarFileName}"/>
+      <param name="md5" value="${checksum}"/>
+    </antcall>
+  </target>
+
+  <target name="download-dependency-zip" unless="${project.download.jar}" description="Downloads a zip to the lib directory.">
+    <antcall target="download-zip">
+      <param name="srcDomain" value="${server}"/>
+      <param name="srcFolder" value="${folder}"/>
+      <param name="srcFile" value="${srcFileName}"/>
+      <param name="srcJarPath" value="${srcJarPath}"/>
+      <param name="destJarFile" value="${destJarPath}"/>
+      <param name="md5" value="${checksum}"/>
+    </antcall>
+  </target>
+
+  <target name="download-dependency-zip-closure" unless="${project.download.jar}" description="Downloads a zip to the lib directory.">
+    <antcall target="download-zip">
+      <param name="srcDomain" value="${server}"/>
+      <param name="srcFolder" value="${folder}"/>
+      <param name="srcFile" value="${srcFileName}"/>
+      <param name="md5" value="${checksum}"/>
+    </antcall>
+  </target>
     
-    <!--
-		Cleanup
-	-->
-	
-    <target name="clean" 
-        description="Removes thirdparty downloads.">
+  <!--
+      Download a zip or gz file, extracts the jar file, and optionally copies the jar
+      file to a different location and optinally verifies the checksum and optionally
+      caches the file, and optionally pulls the file from the cache instead of downloading.  
+      If the checksum fails, this script fails.
+
+      Params are:
+          srcDomain - the domain
+          srcFolder - path to file
+          srcFile - a .gz file for untar with gzip, else unzip
+          [md5]
+          [srcJarPath] - both src and dest required for the copy
+          [destJarFile]
+
+      Note: This is purposely coded without <if><else><then> so that a dependency on
+      ant-contrib.jar isn't required.        
+  -->
+  <target name="download-zip" depends="check-cache" description="Downloads tar/zip, and optionally verifies checksum and copies extracted jar.">
+    <mkdir dir="${download.dir}"/>
+    <antcall target="get-if-not-cached">
+      <param name="dest" value="${download.dir}/${srcFile}"/>
+      <param name="message" value="Checksum mismatch for ${download.dir}/${srcFile}"/>
+    </antcall>
+    <antcall target="copy-if-cached">
+      <param name="dest" value="${download.dir}/${srcFile}"/>
+    </antcall>
+    <condition property="zip.compressed">
+      <matches string="${srcFile}" pattern="^*.zip$"/>
+    </condition>
+    <antcall target="untar-file"/>
+    <antcall target="unzip-file"/>
+    <condition property="destination.known">
+      <and>
+        <isset property="srcJarPath"/>
+        <isset property="destJarFile"/>
+      </and>
+    </condition>
+    <antcall target="copy-downloaded-jar"/>
+  </target>
+
+  <target name="download-bz2" depends="check-cache" description="Downloads bz2, and optionally verifies checksum and copies extracted jar.">
+    <mkdir dir="${download.dir}"/>
+    <antcall target="get-if-not-cached">
+      <param name="dest" value="${download.dir}/${srcFile}"/>
+      <param name="message" value="Checksum mismatch for ${download.dir}/${srcFile}"/>
+    </antcall>
+    <antcall target="copy-if-cached">
+      <param name="dest" value="${download.dir}/${srcFile}"/>
+    </antcall>
+    <untar src="${download.dir}/${srcFile}" dest="${download.dir}/temp" compression="bzip2"/>
+    <condition property="destination.known">
+      <and>
+        <isset property="srcJarPath"/>
+        <isset property="destJarFile"/>
+      </and>
+    </condition>
+    <antcall target="copy-downloaded-jar"/>
+  </target>
+
+  <!--
+      Download a jar file and optionally verify the checksum.
+      If the checksum fails, this script fails.
         
-        <delete failonerror="false" includeEmptyDirs="true">
-            <fileset dir="${download.dir}" />
-        </delete>
-    </target>
+      Params are:
+          srcDomain
+          srcFolder
+          srcFile
+          destJarFile
+          [md5]
+  -->
+  <target name="download-jar" depends="check-cache" description="Downloads jar, and optionally verifies checksum.">
+    <antcall target="get-if-not-cached">
+      <param name="dest" value="${destJarFile}"/>
+      <param name="message" value="Checksum mismatch for ${destJarFile}"/>
+    </antcall>
+    <antcall target="copy-if-cached">
+      <param name="dest" value="${destJarFile}"/>
+    </antcall>
+  </target>
+
+  <target name="untar-file" unless="zip.compressed" description="Untars zipFile">
+    <untar src="${download.dir}/${srcFile}" dest="${download.dir}/temp" compression="gzip"/>
+  </target>
+
+  <target name="unzip-file" if="zip.compressed" description="Unzips zipFile">
+    <unzip src="${download.dir}/${srcFile}" dest="${download.dir}/temp"/>
+  </target>
+
+  <target name="get-if-not-cached" unless="found-in-cache">
+    <get src="${srcDomain}/${srcFolder}/${srcFile}" dest="${dest}"/>
+    <antcall target="check-sum">
+      <param name="dest" value="${dest}"/>
+      <param name="message" value="Checksum mismatch for ${dest}"/>
+    </antcall>
+    <antcall target="put-in-cache"/>
+  </target>
+
+  <target name="copy-if-cached" if="found-in-cache">
+    <!-- this string comes from the FlexJS en_US.properties because for now, this
+         target won't get called unless this script is called from the FlexJS install -->
+    <echo>${INFO_USING_CACHED_FILE} ${downloadCacheFolder}/${srcFolder}/${srcFile}</echo>
+    <copy file="${downloadCacheFolder}/${srcFolder}/${srcFile}" tofile="${dest}" overwrite="true"/>
+  </target>
+
+  <target name="check-cache" if="usingDownloadCache">
+    <available file="${downloadCacheFolder}/${srcFolder}/${srcFile}" property="found-in-cache"/>
+  </target>
+
+  <target name="put-in-cache" if="usingDownloadCache">
+    <copy tofile="${downloadCacheFolder}/${srcFolder}/${srcFile}" file="${dest}"/>
+  </target>
+
+  <target name="check-sum" if="md5" description="Verifies MD5 checksum, and fails if checksum doesn't match">
+    <checksum file="${dest}" algorithm="MD5" verifyproperty="we.failed" property="${md5}"/>
+    <fail message="${message}">
+      <condition>
+        <equals arg1="${we.failed}" arg2="false"/>
+      </condition>
+    </fail>
+  </target>
+
+  <target name="copy-downloaded-jar" if="destination.known">
+    <mkdir dir="${lib.dir}"/>
+    <copy file="${download.dir}/temp/${srcJarPath}" toFile="${destJarFile}" verbose="true"/>
+  </target>
+
+  <target name="fail-with-message" if="we.failed" description="Conditionally fails with the specified message">
+    <fail message="${message}"/>
+  </target>
+
+
+
+  <!--
+      Cleanup
+  -->
+  <target name="clean" description="Removes thirdparty downloads.">
+    <delete failonerror="false" includeEmptyDirs="true">
+      <fileset dir="${download.dir}"/>
+    </delete>
+  </target>
     
 </project>

http://git-wip-us.apache.org/repos/asf/flex-falcon/blob/ac765e63/compiler/downloads.xml
----------------------------------------------------------------------
diff --git a/compiler/downloads.xml b/compiler/downloads.xml
index 1b25be9..bb02c0c 100644
--- a/compiler/downloads.xml
+++ b/compiler/downloads.xml
@@ -17,479 +17,426 @@
   limitations under the License.
 
 -->
-
 <project name="downloads" default="main" basedir=".">
-	<property name="FALCON_HOME" location="."/>
 
-	<!-- this script supports the usingDownloadCache property and
-	     downloadCacheFolder property to cache downloads in the
-		 folder specified by downloadCacheFolder.  This can make
-		 a huge difference in future runs although there is some
-		 risk around caching bad downloads and/or needing to
-		 clean up the cache -->
+  <!--
+      Notes:
+          For Apache, the JARS must be removed from the repository.
 
-	<!-- properties -->
-	<!--<property file="${FALCON_HOME}/build.properties"/>-->
+          Licenses:
+              antlr (3) - BSD
+              commons-cli (1.2) - Apache 2.0
+              commons-io (2.0.1) - Apache 2.0
+              guava (15.0) - Apache 2.0
+              JBurg (1.10.1) - CPL 1.0
+              lzma-sdk (9.2) - Public Domain
+  -->
 
-    <property name="lib.dir" value="${FALCON_HOME}/lib"/>
-    
-	<property name="download.dir" value="${FALCON_HOME}/in"/>
-    
-	<!-- 
-	   Notes:
-	       For Apache, the JARS must be removed from the repository.
-	       
-	       Licenses:
-            antlr (3) - BSD
-	        commons-cli (1.2) - Apache 2.0
-	        commons-io (2.0.1) - Apache 2.0
-	        guava (15.0) - Apache 2.0
-            JBurg (1.10.1) - CPL 1.0
-	        lzma-sdk (9.2) - Public Domain
-	        
-	-->
-	
+  <!-- this script supports the usingDownloadCache property and
+       downloadCacheFolder property to cache downloads in the
+       folder specified by downloadCacheFolder.  This can make
+       a huge difference in future runs although there is some
+       risk around caching bad downloads and/or needing to
+       clean up the cache -->
+
+  <property name="FALCONJX_HOME" location="."/>
+
+  <property name="lib.dir" value="${FALCONJX_HOME}/lib"/>
+  <property name="download.dir" value="${FALCONJX_HOME}/in"/>
+
+  <property file="${basedir}/local.properties"/>
+
+  <property name="maven.search.url" value="http://search.maven.org/remotecontent?filepath="/>
+
+
+
+  <!-- 
+      Because the downloads requires a network connection and the JARs don't change very often, 
+      they are each downloaded only if they don't already exist. 
+  -->
+  <target name="main" depends="prepare, all" description="Downloads all the required thirdparty JARs"/>
+  
+  <target name="prepare">
+    <echo message="Making lib directory ${lib.dir}"/>
+    <mkdir dir="${lib.dir}"/>
+  </target>
+
+
+
+  <!--
+      Downloads
+  -->
+
+  <target name="all" description="Downloads and copies all dependencies to the lib directory.">
+
+    <!--  antlr -->
     <property name="antlr.name" value="antlr"/>
-    <property name="commons-cli.name" value="commons-cli-1.2"/>
-    <property name="commons-io.name" value="commons-io-2.0.1"/>	
-    <property name="guava.name" value="guava-15.0"/>
-    <property name="jflex.name" value="jflex-1.5.1"/>
-    <property name="jburg.name" value="jburg-1.10.1"/>
-    <property name="lzma.name" value="lzma-sdk-9.2"/>
-    <!--<property name="antlr.src.url" value="http://antlr3.org/download"/>-->
-    <!--<property name="antlr.src.file" value="antlr-3.3-complete.jar"/>-->
-    <property name="antlr.src.url" value="http://search.maven.org"/>
-    <property name="antlr.src.folder" value="remotecontent?filepath=org/antlr/antlr-complete/3.5.2"/>
-    <property name="antlr.cache.folder" value="org/antlr/antlr-complete/3.5.2"/>
-    <property name="antlr.src.file" value="antlr-complete-3.5.2.jar"/>
-	   
-    <property name="INFO_DOWNLOADING_FILE_FROM" value="Downloading {0} from: {1}" />
-    
-    <!-- 
-        Because the downloads requires a network connection and the JARs don't change very often, 
-        they are each downloaded only if they don't already exist. 
-    -->
-    
-	<target name="main" depends="prepare, antlr-jar, commons-jars, guava-jar, jflex-jar, jburg-jar, lzma-jar" 
-		description="Downloads all the required thirdparty JARs"/>
+    <property name="antlr.version" value="3.5.2"/>
+    <antcall target="download-dependency">
+      <param name="name" value="${antlr.name}"/>
+      <param name="src.server" value="${maven.search.url}"/>
+      <param name="src.folder" value="org/antlr/antlr-complete/${antlr.version}"/>
+      <param name="src.filename" value="antlr-complete-${antlr.version}.jar"/>
+      <param name="src.checksum" value="acfa69f928a0f1653555bda73091efca"/>
+      <param name="dest.folder" value=""/>
+      <param name="dest.filename" value="${antlr.name}.jar"/>
+      <param name="license.use.apache" value="false"/>
+      <param name="license.use.url" value="http://www.antlr.org/license.html"/>
+    </antcall>
 
-    <target name="prepare" >
-        <mkdir dir="${lib.dir}" />
-    </target>
-    
-    <!--
-		Cleanup
-	-->
-	
-    <target name="clean" 
-        description="Removes thirdparty downloads.">
-        
-        <delete includeEmptyDirs="true" failonerror="false">
-            <fileset dir="${download.dir}">
-                <include name="antlr*/**"/>
-                <include name="commons-cli*/**"/>
-                <include name="commons-io*/**"/>
-                <include name="guava*/**"/>
-                <include name="jflex*/**"/>
-                <include name="jburg*/**"/>
-                <include name="lzma*/**"/>
-            </fileset>
-        </delete>
-    </target>
-    
-    <!--
-	    Download thirdparty JARs    
-	-->
-
-    <!--
-        Download a zip or gz file, extracts the jar file, and optionally copies the jar
-        file to a different location and optinally verifies the checksum and optionally
-		caches the file, and optionally pulls the file from the cache instead of downloading.  
-        If the checksum fails, this script fails.
-
-        Params are:
-            srcDomain - the domain
-			srcFolder - path to file
-			cacheFolder - path to file in cache (usually srcFolder minus illegal characters)
-            srcFile - a .gz file for untar with gzip, else unzip
-            [md5]
-            [srcJarPath] - both src and dest required for the copy
-            [destJarFile]
-
-        Note: This is purposely coded without <if><else><then> so that a dependency on
-        ant-contrib.jar isn't required.        
-    -->
-    
-    <target name="download-zip" depends="check-cache"
-        description="Downloads tar/zip, and optionally verifies checksum and copies extracted jar.">                
-        
-        <mkdir dir="${download.dir}"/>        
-    	
-        <antcall target="get-if-not-cached">
-			<param name="dest" value="${download.dir}/${srcFile}"/>
-            <param name="message" value="Checksum mismatch for ${download.dir}/${srcFile}"/>
-		</antcall>
-		<antcall target="copy-if-cached">
-			<param name="dest" value="${download.dir}/${srcFile}"/>
-		</antcall>
-        
-        <condition property="zip.compressed">
-            <matches string="${srcFile}" pattern="^*.zip$"/>      
-        </condition>
- 
-        <antcall target="untar-file"/>
-        <antcall target="unzip-file"/>
-        
-        <condition property="destination.known">
-            <and>
-                <isset property="srcJarPath"/>
-                <isset property="destJarFile"/>
-            </and>
-        </condition> 
-        <antcall target="copy-downloaded-jar"/>
-     </target>   	
-     
-    <target name="download-bz2" depends="check-cache"
-        description="Downloads bz2, and optionally verifies checksum and copies extracted jar.">                
-        
-        <mkdir dir="${download.dir}"/>        
-    	
-        <antcall target="get-if-not-cached">
-			<param name="dest" value="${download.dir}/${srcFile}"/>
-            <param name="message" value="Checksum mismatch for ${download.dir}/${srcFile}"/>
-		</antcall>
-		<antcall target="copy-if-cached">
-			<param name="dest" value="${download.dir}/${srcFile}"/>
-		</antcall>
-
-        <untar src="${download.dir}/${srcFile}" dest="${download.dir}/temp" compression="bzip2"/> 
-                
-        <condition property="destination.known">
-            <and>
-                <isset property="srcJarPath"/>
-                <isset property="destJarFile"/>
-            </and>
-        </condition> 
-        <antcall target="copy-downloaded-jar"/>
-     </target>   	
-     
-    <!--
-        Download a jar file and optionally verify the checksum.
-        If the checksum fails, this script fails.
-        
-        Params are:
-            srcDomain
-			srcFolder
-            srcFile
-            destJarFile
-            [md5]
-    -->
-    <target name="download-jar" depends="check-cache"
-        description="Downloads jar, and optionally verifies checksum.">                
-     
-        <antcall target="get-if-not-cached">
-			<param name="dest" value="${destJarFile}"/>
-            <param name="message" value="Checksum mismatch for ${destJarFile}"/>
-		</antcall>
-		<antcall target="copy-if-cached">
-			<param name="dest" value="${destJarFile}"/>
-		</antcall>
-    </target>
-
-    <target name="untar-file" unless="zip.compressed" description="Untars zipFile">
-        <untar src="${download.dir}/${srcFile}" dest="${download.dir}/temp" compression="gzip"/> 
-    </target>
-    
-    <target name="unzip-file" if="zip.compressed" description="Unzips zipFile">
-        <unzip src="${download.dir}/${srcFile}" dest="${download.dir}/temp"/>    
-    </target>
-    
-    <target name="get-if-not-cached" unless="found-in-cache"> 
-        <get src="${srcDomain}/${srcFolder}/${srcFile}" dest="${dest}"/>
-        <antcall target="check-sum">
-			<param name="dest" value="${dest}" />
-            <param name="message" value="Checksum mismatch for ${dest}"/>
-        </antcall>
-		<antcall target="put-in-cache" />
-	</target>
-	
-    <target name="copy-if-cached" if="found-in-cache">
-		<!-- this string comes from the FlexJS en_US.properties because for now, this
-		     target won't get called unless this script is called from the FlexJS install -->
-		<echo>${INFO_USING_CACHED_FILE} ${downloadCacheFolder}/${cacheFolder}/${srcFile}</echo>
-		<copy file="${downloadCacheFolder}/${cacheFolder}/${srcFile}" tofile="${dest}" overwrite="true"/>
-	</target> 
-	
-    <target name="check-cache" if="usingDownloadCache">
-		<available file="${downloadCacheFolder}/${cacheFolder}/${srcFile}" property="found-in-cache" />
-	</target> 
-	
-    <target name="put-in-cache" if="usingDownloadCache">
-		<copy tofile="${downloadCacheFolder}/${cacheFolder}/${srcFile}" file="${dest}" />
-	</target> 
-	
-    <target name="check-sum" if="md5" 
-        description="Verifies MD5 checksum, and fails if checksum doesn't match">
-        
-        <checksum file="${dest}" algorithm="MD5" verifyproperty="we.failed" property="${md5}" />
-        <fail message="${message}">
-			<condition>
-				<equals arg1="${we.failed}" arg2="false" />
-			</condition>
-		</fail>
-    </target>
-        
-    <target name="copy-downloaded-jar" if="destination.known">
-        <mkdir dir="${lib.dir}"/>
-        <copy file="${download.dir}/temp/${srcJarPath}" toFile="${destJarFile}" verbose="true"/>
-    </target>
-    
-    <target name="fail-with-message" if="we.failed" 
-        description="Conditionally fails with the specified message">                
-        <fail message="${message}"/>
-    </target>
-        
-    <!--
-        antlr
-    -->
+    <!--  commons-cli -->
+    <property name="commons-cli.name" value="commons-cli"/>
+    <property name="commons-cli.version" value="1.2"/>
+    <antcall target="download-dependency">
+      <param name="name" value="${commons-cli.name}"/>
+      <param name="src.server" value="http://archive.apache.org"/>
+      <param name="src.folder" value="dist/commons/cli/binaries"/>
+      <param name="src.filename" value="${commons-cli.name}-${commons-cli.version}-bin.tar.gz"/>
+      <param name="src.checksum" value="a05956c9ac8bacdc2b8d07fb2cb331ce"/>
+      <param name="src.jarPath" value="${commons-cli.name}-${commons-cli.version}/${commons-cli.name}-${commons-cli.version}.jar"/>
+      <param name="dest.jarPath" value="${lib.dir}/${commons-cli.name}.jar"/>
+      <param name="dest.folder" value=""/>
+      <param name="dest.filename" value="${commons-cli.name}.jar"/>
+      <param name="license.use.apache" value="false"/>
+    </antcall>
+    <copy todir="${lib.dir}" failonerror="false" quiet="true">
+      <fileset dir="${download.dir}/temp/${commons-cli.name}-${commons-cli.version}">
+        <include name="LICENSE.txt"/>
+      </fileset>
+      <globmapper from="*" to="commons-cli-*"/>
+    </copy>
+
+    <!--  commons-io -->
+    <property name="commons-io.name" value="commons-io"/>
+    <property name="commons-io.version" value="2.4"/>
+    <!-- property name="commons-io.version" value="2.0.1"/ -->
+    <antcall target="download-dependency">
+      <param name="name" value="${commons-io.name}"/>
+      <param name="src.server" value="http://archive.apache.org"/>
+      <param name="src.folder" value="dist/commons/io/binaries"/>
+      <param name="src.filename" value="${commons-io.name}-${commons-io.version}-bin.tar.gz"/>
+      <param name="src.checksum" value="50ce698bd6e33dc6f71570189df89c99"/>
+      <!-- param name="src.checksum" value="89fef81c2adfa9b50a64ed5cd5d8c155"/ --><!-- version 2.0.1 -->
+      <param name="src.jarPath" value="${commons-io.name}-${commons-io.version}/${commons-io.name}-${commons-io.version}.jar"/>
+      <param name="dest.jarPath" value="${lib.dir}/${commons-io.name}.jar"/>
+      <param name="dest.folder" value=""/>
+      <param name="dest.filename" value="${commons-io.name}.jar"/>
+      <param name="license.use.apache" value="false"/>
+    </antcall>
+    <copy todir="${lib.dir}" failonerror="false" quiet="true">
+      <fileset dir="${download.dir}/temp/${commons-io.name}-${commons-io.version}">
+        <include name="LICENSE.txt"/>
+      </fileset>
+      <globmapper from="*" to="commons-io-*"/>
+    </copy>
+
+    <!--  guava -->
+    <property name="guava.name" value="guava"/>
+    <property name="guava.version" value="17.0"/>
+    <!-- property name="guava.version" value="15.0"/ -->
+    <antcall target="download-dependency">
+      <param name="name" value="${guava.name}"/>
+      <param name="src.server" value="${maven.search.url}"/>
+      <param name="src.folder" value="com/google/guava/guava/${guava.version}"/>
+      <param name="src.filename" value="guava-${guava.version}.jar"/>
+      <param name="src.checksum" value="89fef81c2adfa9b50a64ed5cd5d8c155"/>
+      <!-- param name="src.checksum" value="e0593b60af743a63f9678399d275272a"/ --><!-- version 2.0.16 -->
+      <param name="dest.folder" value=""/>
+      <param name="dest.filename" value="${guava.name}.jar"/>
+      <param name="license.use.apache" value="true"/>
+    </antcall>
+
+    <!--  jburg -->
+    <property name="jburg.name" value="jburg"/>
+    <!-- property name="jburg.version" value="1.22"/ -->
+    <property name="jburg.version" value="1.10.1"/>
+    <antcall target="download-dependency">
+      <param name="name" value="${jburg.name}"/>
+      <param name="src.server" value="http://downloads.sourceforge.net"/>
+      <param name="src.folder" value="project/jburg"/>
+      <param name="src.filename" value="${jburg.name}-${jburg.version}.tar.gz"/>
+      <!-- param name="src.checksum" value="5cd6bd4d66a6fec4cc2ddab5bb9f2e90"/ --><!-- version 1.22 -->
+      <param name="src.checksum" value="76830ee877cac40b981779325b3fa89f"/><!-- version 1.10.1 -->
+      <param name="src.jarPath" value="lib/${jburg.name}.jar"/>
+      <param name="dest.jarPath" value="${lib.dir}/${jburg.name}.jar"/>
+      <param name="dest.folder" value=""/>
+      <param name="dest.filename" value="${jburg.name}.jar"/>
+      <param name="license.use.apache" value="false"/>
+    </antcall>
+    <copy todir="${lib.dir}" failonerror="false" quiet="true">
+      <fileset dir="${download.dir}/temp">
+        <include name="LICENSE"/>
+      </fileset>
+      <globmapper from="*" to="jburg-*.txt"/>
+    </copy>
+
+    <!--  jflex -->
+    <property name="jflex.name" value="jflex"/>
+    <property name="jflex.version" value="1.6.0"/>
+    <!-- property name="jflex.version" value="1.5.1"/ -->
+    <antcall target="download-dependency">
+      <param name="name" value="${jflex.name}"/>
+      <param name="version" value="${jflex.version}"/>
+      <param name="src.server" value="http://jflex.de"/>
+      <param name="src.folder" value="."/>
+      <param name="src.filename" value="${jflex.name}-${jflex.version}.tar.gz"/>
+      <param name="src.checksum" value="df8cc9ca50b549bf705bd23479c100dc"/>
+      <!-- param name="src.checksum" value="c388c909eb0024d546489a89e608e096"/ --><!-- version 1.5.1 -->
+      <param name="src.jarPath" value="${jflex.name}-${jflex.version}/lib/${jflex.name}-${jflex.version}.jar"/>
+      <param name="dest.jarPath" value="${lib.dir}/${jflex.name}.jar"/>
+      <param name="dest.folder" value=""/>
+      <param name="dest.filename" value="${jflex.name}.jar"/>
+      <param name="license.use.apache" value="false"/>
+    </antcall>
+    <copy todir="${lib.dir}" failonerror="false" quiet="true">
+      <fileset dir="${download.dir}/temp/${jflex.name}-${jflex.version}">
+        <include name="COPYRIGHT"/>
+      </fileset>
+      <globmapper from="*" to="jflex-*"/>
+    </copy>
+
+    <!--  lzma -->
+    <property name="lzma.name" value="lzma"/>
+    <property name="lzma.version" value="9.20"/>
+    <antcall target="download-dependency">
+      <param name="name" value="${lzma.name}-sdk"/>
+      <param name="version" value="${lzma.version}"/>
+      <param name="src.server" value="http://www.java2s.com"/>
+      <param name="src.folder" value="Code/JarDownload/lzma"/>
+      <param name="src.filename" value="${lzma.name}-${lzma.version}.jar.zip"/>
+      <param name="src.checksum" value="d5f7343bbd03bf1c4a4806b372cc5354"/>
+      <param name="src.jarPath" value="${lzma.name}-${lzma.version}.jar"/>
+      <param name="dest.jarPath" value="${lib.dir}/${lzma.name}-sdk.jar"/>
+      <param name="dest.folder" value=""/>
+      <param name="dest.filename" value="${lzma.name}-sdk.jar"/>
+      <param name="license.use.apache" value="false"/>
+      <param name="license.use.url" value="http://www.7-zip.org/sdk.html"/>
+    </antcall>
     
-    <target name="antlr-jar-check" description="Checks if antlr jar exists.">
-    	<condition property="antlr.jar.exists">
-    	    <and>
-    	        <available file="${lib.dir}/antlr.jar"/>
-    	    </and>
-        </condition>
-    </target>
+  </target>
+
+
+
+  <!--
+      Utilities
+  -->
+
+  <target name="check-dependency" description="Checks if project jar is in lib directory.">
+    <available file="${lib.dir}/${dest.folder}/${name}.jar" property="project.jar.exists"/>
+  </target>
+
+  <target name="echo-project-jar" if="installer">
+    <echo file="${basedir}/project.properties">project.echo=${INFO_DOWNLOADING_FILE_FROM}</echo>
+    <replace file="${basedir}/project.properties" token="{0}" value="${srcFile}"/>
+    <replace file="${basedir}/project.properties" token="{1}" value="${srcPath}"/>
+    <property file="${basedir}/project.properties"/>
+    <delete file="${basedir}/project.properties"/>
+    <echo>${project.echo}</echo>
+  </target>
+  
+  <target name="download-dependency" depends="check-dependency" unless="project.jar.exists" description="Downloads a jar + license to the lib directory.">
+    <antcall target="echo-project-jar">
+      <param name="srcDomain" value="${src.server}"/>
+      <param name="srcPath" value="${src.folder}/${src.filename}"/>
+    </antcall>
+    <mkdir dir="${lib.dir}/${dest.folder}"/>
+
+    <antcall target="download-apache-license" />
+    <antcall target="download-other-license" />
+
+    <condition property="project.download.jar" value="false" else="true">
+      <or>
+        <contains string="${src.filename}" substring=".tar" />
+        <contains string="${src.filename}" substring=".zip" />
+      </or>
+    </condition>
     
-    <target name="antlr-jar" depends="antlr-jar-check" unless="antlr.jar.exists"
-        description="Copies the antlr jar to the lib directory.">
-        <echo file="${basedir}/antlr.properties">antlr.echo=${INFO_DOWNLOADING_FILE_FROM}</echo>
-        <replace file="${basedir}/antlr.properties" token="{0}" value="${antlr.src.file}" />
-        <replace file="${basedir}/antlr.properties" token="{1}" value="${antlr.src.url}/${antlr.src.folder}" />
-        <property file="${basedir}/antlr.properties" />
-        <delete file="${basedir}/antlr.properties" />
-        <echo>${antlr.echo}</echo>
-        <antcall target="antlr-download-jar"/>
-        <echo file="${lib.dir}/antlr-LICENSE.TXT">http://www.antlr.org/license.html</echo> 
-    </target>
+    <antcall target="download-dependency-jar">
+      <param name="server" value="${src.server}"/>
+      <param name="folder" value="${src.folder}"/>
+      <param name="srcFileName" value="${src.filename}"/>
+      <param name="destJarFileName" value="${lib.dir}/${dest.folder}/${dest.filename}"/>
+      <param name="checksum" value="${src.checksum}"/>
+    </antcall>
+
+    <antcall target="download-dependency-zip">
+      <param name="server" value="${src.server}"/>
+      <param name="folder" value="${src.folder}"/>
+      <param name="srcFileName" value="${src.filename}"/>
+      <param name="srcJarPath" value="${src.jarPath}"/>
+      <param name="destJarPath" value="${dest.jarPath}"/>
+      <param name="checksum" value="${src.checksum}"/>
+    </antcall>
+  </target>
+
+  <target name="download-apache-license" if="${license.use.apache}" description="Downloads the Apache license to the lib directory.">
+    <get src="http://www.apache.org/licenses/LICENSE-2.0" dest="${lib.dir}/${dest.folder}/${name}-LICENSE.html"/>
+  </target>
+  
+  <target name="download-other-license" if="license.use.url" description="Downloads a non-Apache license to the lib directory.">
+    <get src="${license.use.url}" dest="${lib.dir}/${dest.folder}/${name}-LICENSE.html"/>
+  </target>
+  
+  <target name="download-dependency-jar" if="${project.download.jar}" description="Downloads a jar to the lib directory.">
+    <antcall target="download-jar">
+      <param name="srcDomain" value="${server}"/>
+      <param name="srcFolder" value="${folder}"/>
+      <param name="cacheFolder" value="${folder}"/>
+      <param name="srcFile" value="${srcFileName}"/>
+      <param name="destJarFile" value="${destJarFileName}"/>
+      <param name="md5" value="${checksum}"/>
+    </antcall>
+  </target>
+
+  <target name="download-dependency-zip" unless="${project.download.jar}" description="Downloads a zip to the lib directory.">
+    <antcall target="download-zip">
+      <param name="srcDomain" value="${server}"/>
+      <param name="srcFolder" value="${folder}"/>
+      <param name="srcFile" value="${srcFileName}"/>
+      <param name="srcJarPath" value="${srcJarPath}"/>
+      <param name="destJarFile" value="${destJarPath}"/>
+      <param name="md5" value="${checksum}"/>
+    </antcall>
+  </target>
     
-    <target name="antlr-download-jar" depends="antlr-jar-check" unless="antlr.jar.exists"
-        description="Downloads the antlr jars.">
+  <!--
+      Download a zip or gz file, extracts the jar file, and optionally copies the jar
+      file to a different location and optinally verifies the checksum and optionally
+      caches the file, and optionally pulls the file from the cache instead of downloading.  
+      If the checksum fails, this script fails.
+
+      Params are:
+          srcDomain - the domain
+          srcFolder - path to file
+          srcFile - a .gz file for untar with gzip, else unzip
+          [md5]
+          [srcJarPath] - both src and dest required for the copy
+          [destJarFile]
+
+      Note: This is purposely coded without <if><else><then> so that a dependency on
+      ant-contrib.jar isn't required.        
+  -->
+  <target name="download-zip" depends="check-cache" description="Downloads tar/zip, and optionally verifies checksum and copies extracted jar.">
+    <mkdir dir="${download.dir}"/>
+    <antcall target="get-if-not-cached">
+      <param name="dest" value="${download.dir}/${srcFile}"/>
+      <param name="message" value="Checksum mismatch for ${download.dir}/${srcFile}"/>
+    </antcall>
+    <antcall target="copy-if-cached">
+      <param name="dest" value="${download.dir}/${srcFile}"/>
+    </antcall>
+    <condition property="zip.compressed">
+      <matches string="${srcFile}" pattern="^*.zip$"/>
+    </condition>
+    <antcall target="untar-file"/>
+    <antcall target="unzip-file"/>
+    <condition property="destination.known">
+      <and>
+        <isset property="srcJarPath"/>
+        <isset property="destJarFile"/>
+      </and>
+    </condition>
+    <antcall target="copy-downloaded-jar"/>
+  </target>
+
+  <target name="download-bz2" depends="check-cache" description="Downloads bz2, and optionally verifies checksum and copies extracted jar.">
+    <mkdir dir="${download.dir}"/>
+    <antcall target="get-if-not-cached">
+      <param name="dest" value="${download.dir}/${srcFile}"/>
+      <param name="message" value="Checksum mismatch for ${download.dir}/${srcFile}"/>
+    </antcall>
+    <antcall target="copy-if-cached">
+      <param name="dest" value="${download.dir}/${srcFile}"/>
+    </antcall>
+    <untar src="${download.dir}/${srcFile}" dest="${download.dir}/temp" compression="bzip2"/>
+    <condition property="destination.known">
+      <and>
+        <isset property="srcJarPath"/>
+        <isset property="destJarFile"/>
+      </and>
+    </condition>
+    <antcall target="copy-downloaded-jar"/>
+  </target>
+
+  <!--
+      Download a jar file and optionally verify the checksum.
+      If the checksum fails, this script fails.
         
-        <antcall target="download-jar">
-            <param name="srcDomain" value="${antlr.src.url}"/>
-            <param name="srcFolder" value="${antlr.src.folder}"/>
-            <param name="cacheFolder" value="${antlr.cache.folder}"/>
-            <param name="srcFile" value="${antlr.src.file}"/>
-            <param name="destJarFile" value="${lib.dir}/antlr.jar"/>
-            <param name="md5" value="acfa69f928a0f1653555bda73091efca"/>
-            <!--<param name="md5" value="238becce7da69f7be5c5b8a65558cf63"/>-->
-        </antcall>
-    </target>
-
-    <!--
-	    commons
-	-->
-	
-	<target name="commons-jars" depends="commons-cli-jar,commons-io-jar" />
-
-    <!--
-	    commons-cli
-	-->
-	
-    <target name="commons-cli-jar-check" description="Checks if common-cli.jar has been downloaded.">
-        <available file="${lib.dir}/commons-cli.jar" property="commons.cli.jar.exists"/>
-    </target>
-    
-    <target name="commons-cli-jar" depends="commons-cli-jar-check" unless="commons.cli.jar.exists" 
-        description="Downloads and copies common-cli.jar to the lib directory.">
-        <echo file="${basedir}/cli.properties">cli.echo=${INFO_DOWNLOADING_FILE_FROM}</echo>
-        <replace file="${basedir}/cli.properties" token="{0}" value="${commons-cli.name}-bin.tar.gz" />
-        <replace file="${basedir}/cli.properties" token="{1}" value="http://archive.apache.org/dist/commons/cli/binaries" />
-        <property file="${basedir}/cli.properties" />
-        <delete file="${basedir}/cli.properties" />
-        <echo>${cli.echo}</echo>
-        <antcall target="download-zip">
-          <param name="srcDomain" value="http://archive.apache.org"/>
-          <param name="srcFolder" value="dist/commons/cli/binaries"/>
-          <param name="cacheFolder" value="dist/commons/cli/binaries"/>
-          <param name="srcFile" value="${commons-cli.name}-bin.tar.gz"/>
-          <param name="md5" value="a05956c9ac8bacdc2b8d07fb2cb331ce"/>
-          <param name="srcJarPath" value="${commons-cli.name}/${commons-cli.name}.jar"/>
-          <param name="destJarFile" value="${lib.dir}/commons-cli.jar"/>
-        </antcall>
-        <copy todir="${lib.dir}">
-            <fileset dir="${download.dir}/temp/${commons-cli.name}">
-                <include name="LICENSE.txt"/>
-            </fileset>            
-            <globmapper from="*" to="commons-cli-*"/>
-        </copy>
-        <delete dir="${download.dir}/temp/${commons-cli.name}"/>
-    </target>
-
-    <!--
-        commons-io
-    -->
-    
-    <target name="commons-io-jar-check" description="Checks if commons-io.jar is in lib directory.">
-        <available file="${lib.dir}/commons-io.jar" property="commons.io.jar.exists"/>
-    </target>
-    
-    <target name="commons-io-jar" depends="commons-io-jar-check" 
-        unless="commons.io.jar.exists" 
-        description="Copies commons-io.jar to the lib directory.">
-        <echo file="${basedir}/io.properties">io.echo=${INFO_DOWNLOADING_FILE_FROM}</echo>
-        <replace file="${basedir}/io.properties" token="{0}" value="${commons-io.name}-bin.tar.gz" />
-        <replace file="${basedir}/io.properties" token="{1}" value="http://archive.apache.org/dist/commons/io/binaries" />
-        <property file="${basedir}/io.properties" />
-        <delete file="${basedir}/io.properties" />
-        <echo>${io.echo}</echo>
-        <antcall target="download-zip">
-          <param name="srcDomain" value="http://archive.apache.org"/>
-          <param name="cacheFolder" value="dist/commons/io/binaries"/>
-          <param name="srcFolder" value="dist/commons/io/binaries"/>
-          <param name="srcFile" value="${commons-io.name}-bin.tar.gz"/>
-          <param name="md5" value="4f2c26f9d80f89d15939619cc8524f78"/>
-          <param name="srcJarPath" value="${commons-io.name}/${commons-io.name}.jar"/>
-          <param name="destJarFile" value="${lib.dir}/commons-io.jar"/>
-        </antcall>
-        <copy todir="${lib.dir}">
-            <fileset dir="${download.dir}/temp/${commons-io.name}">
-                <include name="LICENSE.txt"/>
-            </fileset>            
-            <globmapper from="*" to="commons-io-*"/>
-        </copy>
-        <delete dir="${download.dir}/temp/${commons-io.name}"/>
-    </target>
-	
-
-	<!--
-        guava - collections and other common constructs
-    -->
-    
-    <target name="guava-jar-check" description="Checks if guava.jar is in lib directory.">
-        <available file="${lib.dir}/guava.jar" property="guava.jar.exists"/>
-    </target>
-    
-    <target name="guava-jar" depends="guava-jar-check" 
-        unless="guava.jar.exists" 
-        description="Downloads and copies guava.jar to the lib directory.">
-        <echo file="${basedir}/guava.properties">guava.echo=${INFO_DOWNLOADING_FILE_FROM}</echo>
-        <replace file="${basedir}/guava.properties" token="{0}" value="guava-15.0.jar" />
-        <replace file="${basedir}/guava.properties" token="{1}" value="http://search.maven.org/remotecontent?filepath=com/google/guava/guava/15.0" />
-        <property file="${basedir}/guava.properties" />
-        <delete file="${basedir}/guava.properties" />
-        <echo>${guava.echo}</echo>
-        <antcall target="download-jar">
-            <param name="srcDomain" value="http://search.maven.org"/>
-            <param name="srcFolder" value="remotecontent?filepath=com/google/guava/guava/15.0"/>
-            <param name="cacheFolder" value="com/google/guava/guava/15.0"/>
-            <param name="srcFile" value="guava-15.0.jar"/>
-            <param name="destJarFile" value="${lib.dir}/guava.jar"/>
-			<param name="md5" value="2c10bb2ca3ac8b55b0e77e54a7eb3744"/>
-        </antcall>
-        <get src="http://www.apache.org/licenses/LICENSE-2.0" dest="${lib.dir}/guava-LICENSE.txt"/>
-    </target>
-
-    <!--
-	    jflex
-	-->
-	
-    <target name="jflex-jar-check" description="Checks if jflex.jar has been downloaded.">
-        <available file="${lib.dir}/jflex.jar" property="jflex.jar.exists"/>
-    </target>
-    
-    <target name="jflex-jar" depends="jflex-jar-check" unless="jflex.jar.exists" 
-        description="Downloads and copies jflex.jar to the lib directory.">
-        <echo file="${basedir}/jflex.properties">jflex.echo=${INFO_DOWNLOADING_FILE_FROM}</echo>
-        <replace file="${basedir}/jflex.properties" token="{0}" value="${jflex.name}.tar.gz" />
-        <replace file="${basedir}/jflex.properties" token="{1}" value="http://jflex.de" />
-        <property file="${basedir}/jflex.properties" />
-        <delete file="${basedir}/jflex.properties" />
-        <echo>${cli.echo}</echo>
-        <antcall target="download-zip">
-          <param name="srcDomain" value="http://jflex.de"/>
-          <param name="srcFolder" value="."/>
-          <param name="cacheFolder" value="."/>
-          <param name="srcFile" value="${jflex.name}.tar.gz"/>
-          <param name="md5" value="c388c909eb0024d546489a89e608e096"/>
-          <param name="srcJarPath" value="${jflex.name}/lib/${jflex.name}.jar"/>
-          <param name="destJarFile" value="${lib.dir}/JFlex.jar"/>
-        </antcall>
-        <copy todir="${lib.dir}">
-            <fileset dir="${download.dir}/temp/${jflex.name}">
-                <include name="LICENSE.txt"/>
-            </fileset>            
-            <globmapper from="*" to="JFlex-*"/>
-        </copy>
-        <delete dir="${download.dir}/temp/${jflex.name}"/>
-    </target>
-
-	<!--
-        jburg - for codegen of certain java source files
-    -->
-    
-    <target name="jburg-jar-check" description="Checks if jburg.jar is in lib directory.">
-        <available file="${lib.dir}/jburg.jar" property="jburg.jar.exists"/>
-    </target>
-    
-    <target name="jburg-jar" depends="jburg-jar-check" unless="jburg.jar.exists" 
-        description="Copies jburg.jar to the lib directory.">
-        <echo file="${basedir}/jburg.properties">jburg.echo=${INFO_DOWNLOADING_FILE_FROM}</echo>
-        <replace file="${basedir}/jburg.properties" token="{0}" value="${jburg.name}.tar.gz" />
-        <replace file="${basedir}/jburg.properties" token="{1}" value="http://downloads.sourceforge.net/project/jburg" />
-        <property file="${basedir}/jburg.properties" />
-        <delete file="${basedir}/jburg.properties" />
-        <echo>${jburg.echo}</echo>
-        <antcall target="download-zip">
-          <param name="srcDomain" value="http://downloads.sourceforge.net"/>
-          <param name="srcFolder" value="project/jburg"/>
-          <param name="cacheFolder" value="project/jburg"/>
-          <param name="srcFile" value="${jburg.name}.tar.gz"/>
-          <param name="md5" value="76830ee877cac40b981779325b3fa89f"/>
-          <param name="srcJarPath" value="lib/jburg.jar"/>
-          <param name="destJarFile" value="${lib.dir}/jburg.jar"/>
-        </antcall>
-        <copy todir="${lib.dir}">
-            <fileset dir="${download.dir}/temp">
-                <include name="LICENSE"/>
-            </fileset>            
-            <globmapper from="*" to="jburg-*"/>
-        </copy>
-        <delete includeemptydirs="true">
-            <fileset dir="${download.dir}/temp" includes="**/*"/>
-        </delete>    
-    </target>
-    	
-    <!--
-        lzma - compression
-    -->
-    
-    <target name="lzma-jar-check" description="Checks if lzma jar exists.">
-        <available file="${lib.dir}/lzma-sdk.jar" property="lzma.jar.exists" />
-    </target>
-    
-	<target name="lzma-jar" depends="lzma-jar-check" unless="lzma.jar.exists" 
-        description="Copies the lzma build jars.">
-        <echo file="${basedir}/lzma.properties">lzma.echo=${INFO_DOWNLOADING_FILE_FROM}</echo>
-        <replace file="${basedir}/lzma.properties" token="{0}" value="lzma-9.20.jar.zip" />
-        <replace file="${basedir}/lzma.properties" token="{1}" value="http://www.java2s.com/Code/JarDownload/lzma" />
-        <property file="${basedir}/lzma.properties" />
-        <delete file="${basedir}/lzma.properties" />
-        <echo>${lzma.echo}</echo>
-        <antcall target="download-zip">
-          <param name="srcDomain" value="http://www.java2s.com"/>
-          <param name="srcFolder" value="Code/JarDownload/lzma"/>
-          <param name="cacheFolder" value="Code/JarDownload/lzma"/>
-          <param name="srcFile" value="lzma-9.20.jar.zip"/>
-          <param name="md5" value="d5f7343bbd03bf1c4a4806b372cc5354"/>
-          <param name="srcJarPath" value="lzma-9.20.jar"/>
-          <param name="destJarFile" value="${lib.dir}/lzma-sdk.jar"/>
-        </antcall>
-        <echo file="${lib.dir}/lzma-sdk-LICENSE.TXT">http://www.7-zip.org/sdk.html</echo>
-        <delete includeemptydirs="true">
-            <fileset dir="${download.dir}/temp" includes="**/*"/>
-        </delete>    
-    </target>
-    
+      Params are:
+          srcDomain
+          srcFolder
+          srcFile
+          destJarFile
+          [md5]
+  -->
+  <target name="download-jar" depends="check-cache" description="Downloads jar, and optionally verifies checksum.">
+    <antcall target="get-if-not-cached">
+      <param name="dest" value="${destJarFile}"/>
+      <param name="message" value="Checksum mismatch for ${destJarFile}"/>
+    </antcall>
+    <antcall target="copy-if-cached">
+      <param name="dest" value="${destJarFile}"/>
+    </antcall>
+  </target>
+
+  <target name="untar-file" unless="zip.compressed" description="Untars zipFile">
+    <untar src="${download.dir}/${srcFile}" dest="${download.dir}/temp" compression="gzip"/>
+  </target>
+
+  <target name="unzip-file" if="zip.compressed" description="Unzips zipFile">
+    <unzip src="${download.dir}/${srcFile}" dest="${download.dir}/temp"/>
+  </target>
+
+  <target name="get-if-not-cached" unless="found-in-cache">
+    <get src="${srcDomain}/${srcFolder}/${srcFile}" dest="${dest}"/>
+    <antcall target="check-sum">
+      <param name="dest" value="${dest}"/>
+      <param name="message" value="Checksum mismatch for ${dest}"/>
+    </antcall>
+    <antcall target="put-in-cache"/>
+  </target>
+
+  <target name="copy-if-cached" if="found-in-cache">
+    <!-- this string comes from the FlexJS en_US.properties because for now, this
+         target won't get called unless this script is called from the FlexJS install -->
+    <echo>${INFO_USING_CACHED_FILE} ${downloadCacheFolder}/${srcFolder}/${srcFile}</echo>
+    <copy file="${downloadCacheFolder}/${srcFolder}/${srcFile}" tofile="${dest}" overwrite="true"/>
+  </target>
+
+  <target name="check-cache" if="usingDownloadCache">
+    <available file="${downloadCacheFolder}/${srcFolder}/${srcFile}" property="found-in-cache"/>
+  </target>
+
+  <target name="put-in-cache" if="usingDownloadCache">
+    <copy tofile="${downloadCacheFolder}/${srcFolder}/${srcFile}" file="${dest}"/>
+  </target>
+
+  <target name="check-sum" if="md5" description="Verifies MD5 checksum, and fails if checksum doesn't match">
+    <checksum file="${dest}" algorithm="MD5" verifyproperty="we.failed" property="${md5}"/>
+    <fail message="${message}">
+      <condition>
+        <equals arg1="${we.failed}" arg2="false"/>
+      </condition>
+    </fail>
+  </target>
+
+  <target name="copy-downloaded-jar" if="destination.known">
+    <mkdir dir="${lib.dir}"/>
+    <copy file="${download.dir}/temp/${srcJarPath}" toFile="${destJarFile}" verbose="true"/>
+  </target>
+
+  <target name="fail-with-message" if="we.failed" description="Conditionally fails with the specified message">
+    <fail message="${message}"/>
+  </target>
+
+
+
+  <!--
+      Cleanup
+  -->
+  <target name="clean" description="Removes thirdparty downloads.">
+    <delete failonerror="false" includeEmptyDirs="true">
+      <fileset dir="${download.dir}"/>
+    </delete>
+  </target>
 </project>


Mime
View raw message