flex-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From cza...@apache.org
Subject svn commit: r1435005 - in /flex/falcon/trunk: compiler.jx.tests/ compiler.jx.tests/src/org/apache/flex/compiler/internal/as/codegen/ compiler.jx/
Date Fri, 18 Jan 2013 01:50:05 GMT
Author: czadra
Date: Fri Jan 18 01:50:05 2013
New Revision: 1435005

URL: http://svn.apache.org/viewvc?rev=1435005&view=rev
Log:
FalconJX - updated build.xml and download.xml for compiler.jx & compiler.jx.tests

Added:
    flex/falcon/trunk/compiler.jx.tests/build.xml   (with props)
    flex/falcon/trunk/compiler.jx.tests/downloads.xml   (with props)
Modified:
    flex/falcon/trunk/compiler.jx.tests/src/org/apache/flex/compiler/internal/as/codegen/TestBase.java
    flex/falcon/trunk/compiler.jx.tests/src/org/apache/flex/compiler/internal/as/codegen/TestWalkerBase.java
    flex/falcon/trunk/compiler.jx/downloads.xml

Added: flex/falcon/trunk/compiler.jx.tests/build.xml
URL: http://svn.apache.org/viewvc/flex/falcon/trunk/compiler.jx.tests/build.xml?rev=1435005&view=auto
==============================================================================
--- flex/falcon/trunk/compiler.jx.tests/build.xml (added)
+++ flex/falcon/trunk/compiler.jx.tests/build.xml Fri Jan 18 01:50:05 2013
@@ -0,0 +1,91 @@
+<?xml version="1.0" ?>
+
+<!--
+
+  Licensed to the Apache Software Foundation (ASF) under one or more
+  contributor license agreements.  See the NOTICE file distributed with
+  this work for additional information regarding copyright ownership.
+  The ASF licenses this file to You under the Apache License, Version 2.0
+  (the "License"); you may not use this file except in compliance with
+  the License.  You may obtain a copy of the License at
+
+      http://www.apache.org/licenses/LICENSE-2.0
+
+  Unless required by applicable law or agreed to in writing, software
+  distributed under the License is distributed on an "AS IS" BASIS,
+  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+  See the License for the specific language governing permissions and
+  limitations under the License.
+
+-->
+
+<project name="compiler.tests" default="main" basedir=".">
+
+    <pathconvert property="compiler.tests" dirsep="/">
+        <path location="${basedir}"/>
+    </pathconvert>
+
+    <property environment="env"/>
+	<property file="unittest.properties" />
+	
+	<condition property="sdk" value="${FLEX_HOME}" else="${env.FLEX_HOME}">
+	    <isset property="FLEX_HOME" />
+	</condition>
+	
+    <property name="compiler" value="${compiler.tests}/../compiler.jx"/>
+
+    <target name="download" description="Downloads third-party JARs">
+        <ant antfile="${compiler.tests}/downloads.xml" dir="${compiler.tests}"/>
+    	<delete dir="${compiler.tests}/in"/>
+    </target>
+
+    <target name="compile.unit.tests">
+    	<delete dir="${compiler.tests}/classes"/>
+        <mkdir dir="${compiler.tests}/classes"/>
+        <javac debug="${javac.debug}" deprecation="${javac.deprecation}" destdir="${compiler.tests}/classes"
includeAntRuntime="true">
+        	<src path="${compiler.tests}/src"/>
+            <compilerarg value="-Xlint:all,-path"/>
+            <classpath>
+                <fileset dir="${compiler}/lib" includes="**/*.jar"/>
+                <fileset dir="${compiler.tests}/lib" includes="**/*.jar"/>
+            </classpath>
+        </javac>
+    </target>
+
+    <target name="unit.tests" depends="download, compile.unit.tests">
+        <mkdir dir="${compiler.tests}/results"/>
+        <mkdir dir="${compiler.tests}/temp"/>
+        <junit dir="${compiler.tests}"
+               fork="yes" forkMode="perBatch" maxmemory="256m" timeout="300000"
+               printsummary="true" showoutput="true"
+               haltonerror="false" haltonfailure="false"
+               failureproperty="tests.unit.failed">
+            <classpath>
+                <pathelement location="${compiler.tests}/classes"/>
+                <fileset dir="${compiler}/lib" includes="**/*.jar"/>
+                <fileset dir="${compiler.tests}/lib" includes="**/*.jar"/>
+            </classpath>
+            <batchtest todir="${compiler.tests}/results">
+                <fileset dir="${compiler.tests}/classes">
+                    <include name="**/Test*.class"/>
+                </fileset>
+            </batchtest>
+            <formatter type="xml"/>
+        </junit>
+    </target>
+	
+ 
+    <target name="main" depends="unit.tests"/>
+
+    <target name="clean">
+        <delete dir="${compiler.tests}/bin"/>
+        <delete dir="${compiler.tests}/classes"/>
+        <delete dir="${compiler.tests}/results"/>
+    </target>
+
+    <target name="wipe" depends="clean">
+        <delete dir="${compiler.tests}/lib"/>
+        <delete dir="${compiler.tests}/temp"/>
+    </target>
+
+</project>

Propchange: flex/falcon/trunk/compiler.jx.tests/build.xml
------------------------------------------------------------------------------
    svn:eol-style = native

Added: flex/falcon/trunk/compiler.jx.tests/downloads.xml
URL: http://svn.apache.org/viewvc/flex/falcon/trunk/compiler.jx.tests/downloads.xml?rev=1435005&view=auto
==============================================================================
--- flex/falcon/trunk/compiler.jx.tests/downloads.xml (added)
+++ flex/falcon/trunk/compiler.jx.tests/downloads.xml Fri Jan 18 01:50:05 2013
@@ -0,0 +1,119 @@
+<?xml version="1.0"?>
+<!--
+
+  Licensed to the Apache Software Foundation (ASF) under one or more
+  contributor license agreements.  See the NOTICE file distributed with
+  this work for additional information regarding copyright ownership.
+  The ASF licenses this file to You under the Apache License, Version 2.0
+  (the "License"); you may not use this file except in compliance with
+  the License.  You may obtain a copy of the License at
+
+      http://www.apache.org/licenses/LICENSE-2.0
+
+  Unless required by applicable law or agreed to in writing, software
+  distributed under the License is distributed on an "AS IS" BASIS,
+  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+  See the License for the specific language governing permissions and
+  limitations under the License.
+
+-->
+
+<project name="downloads" default="main" basedir=".">
+	
+    <pathconvert property="compiler.tests" dirsep="/">
+        <path location="${basedir}"/>
+    </pathconvert>
+
+    <property name="lib.dir" value="${compiler.tests}/lib"/>
+    
+	<property name="download.dir" value="${compiler.tests}/in"/>
+    
+	<!-- 
+	   Notes:
+	       For Apache, the JARS must be removed from the repository.
+	       
+	       Licenses:
+            JUnit (4.10) - CPL 1.0        
+	-->
+		     
+    <!-- 
+        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, junit-jar"
+		    description="Downloads all the required thirdparty JARs"/>
+
+    <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="junit*/**"/>
+            </fileset>
+        </delete>
+    </target>
+    
+    <!--
+	    Download thirdparty JARs    
+	-->
+
+    <!--
+        Download a jar file and optionally verify the checksum.
+        If the checksum fails, this script fails.
+        
+        Params are:
+            srcUrl
+            srcJarFile
+            destJarFile
+            [md5]
+    -->
+    <target name="download-jar" 
+            description="Downloads jar, and optionally verifies checksum.">          
         
+        <get src="${srcUrl}/${srcJarFile}" dest="${destJarFile}"/>
+        <checksum file="${destJarFile}" algorithm="MD5" property="${we.failed}"/>
+        <antcall target="fail-with-message">
+            <param name="message" value="Checksum mismatch for ${destJarFile}"/>
+        </antcall>
+    </target>
+
+    <target name="fail-with-message" if="we.failed" 
+            description="Conditionally fails with the specified message">            
   
+        <fail message="${message}"/>
+    </target>
+        
+    <!--
+        junit
+    -->
+    
+    <target name="junit-jar-check" description="Checks if JUnit JAR exists.">
+    	<condition property="junit.jar.exists">
+    	    <and>
+    	        <available file="${lib.dir}/junit-4.10.jar"/>
+    	    </and>
+        </condition>
+    </target>
+    
+    <target name="junit-jar" depends="junit-jar-check" unless="junit.jar.exists"
+            description="Copies the JUnit JAR to the lib directory.">
+        <echo message="Obtaining lib/junit-4.10.jar"/>
+        <antcall target="junit-download-jar"/>
+    </target>
+    
+    <target name="junit-download-jar" depends="junit-jar-check" unless="junit.jar.exists"
+            description="Downloads the JUnit jar.">
+        <antcall target="download-jar">
+            <param name="srcUrl" value="http://cloud.github.com/downloads/KentBeck/junit"/>
+            <param name="srcJarFile" value="junit-4.10.jar"/>
+            <param name="destJarFile" value="${lib.dir}/junit-4.10.jar"/>
+        </antcall>
+    </target>
+    
+</project>

Propchange: flex/falcon/trunk/compiler.jx.tests/downloads.xml
------------------------------------------------------------------------------
    svn:eol-style = native

Modified: flex/falcon/trunk/compiler.jx.tests/src/org/apache/flex/compiler/internal/as/codegen/TestBase.java
URL: http://svn.apache.org/viewvc/flex/falcon/trunk/compiler.jx.tests/src/org/apache/flex/compiler/internal/as/codegen/TestBase.java?rev=1435005&r1=1435004&r2=1435005&view=diff
==============================================================================
--- flex/falcon/trunk/compiler.jx.tests/src/org/apache/flex/compiler/internal/as/codegen/TestBase.java
(original)
+++ flex/falcon/trunk/compiler.jx.tests/src/org/apache/flex/compiler/internal/as/codegen/TestBase.java
Fri Jan 18 01:50:05 2013
@@ -36,7 +36,9 @@ import org.apache.flex.compiler.units.IC
 import org.apache.flex.compiler.utils.EnvProperties;
 import org.apache.flex.utils.FilenameNormalization;
 import org.junit.Before;
+import org.junit.Ignore;
 
+@Ignore
 public class TestBase
 {
     protected void compileJS(String path)

Modified: flex/falcon/trunk/compiler.jx.tests/src/org/apache/flex/compiler/internal/as/codegen/TestWalkerBase.java
URL: http://svn.apache.org/viewvc/flex/falcon/trunk/compiler.jx.tests/src/org/apache/flex/compiler/internal/as/codegen/TestWalkerBase.java?rev=1435005&r1=1435004&r2=1435005&view=diff
==============================================================================
--- flex/falcon/trunk/compiler.jx.tests/src/org/apache/flex/compiler/internal/as/codegen/TestWalkerBase.java
(original)
+++ flex/falcon/trunk/compiler.jx.tests/src/org/apache/flex/compiler/internal/as/codegen/TestWalkerBase.java
Fri Jan 18 01:50:05 2013
@@ -7,7 +7,9 @@ import org.apache.flex.compiler.clients.
 import org.apache.flex.compiler.internal.as.driver.ASBackend;
 import org.apache.flex.compiler.visitor.IASBlockVisitor;
 import org.junit.After;
+import org.junit.Ignore;
 
+@Ignore
 public class TestWalkerBase extends TestBase
 {
     protected IASBlockVisitor visitor;

Modified: flex/falcon/trunk/compiler.jx/downloads.xml
URL: http://svn.apache.org/viewvc/flex/falcon/trunk/compiler.jx/downloads.xml?rev=1435005&r1=1435004&r2=1435005&view=diff
==============================================================================
--- flex/falcon/trunk/compiler.jx/downloads.xml (original)
+++ flex/falcon/trunk/compiler.jx/downloads.xml Fri Jan 18 01:50:05 2013
@@ -19,40 +19,207 @@
 -->
 
 <project name="downloads" default="main" basedir=".">
+	
+	<property name="FALCONJX_HOME" location="."/>
+    <property name="lib.dir" value="${FALCONJX_HOME}/lib"/>    
+	<property name="download.dir" value="${FALCONJX_HOME}/in"/>
+    
+	<!-- 
+	   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"/>
+    <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, closure-jar" 
+		description="Downloads all the required thirdparty JARs"/>
 
-    <property name="closure.dir" value="${basedir}/lib/google/closure-compiler"/>
-	<property name="download.dir" value="${basedir}/in"/>
-
-    <property name="zipFile" value="compiler-20110615.zip"/>
+    <target name="prepare" >
+		<echo message="Making lib directory ${basedir}/${lib.dir}"/>
+        <mkdir dir="${lib.dir}" />
+    </target>
+	
+	
+    <!--
+	    Download thirdparty JARs    
+	-->
 
     <!--
-        closure - JS compiler, minimizer, etc.
+        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.  
+        If the checksum fails, this script fails.
+
+        Params are:
+            srcUrl
+            zipFile - 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="closure-jar-check">
-        <available file="${lib.dir}/compiler.jar" property="closure.jar.exists" />
-    </target>
-    
-	<target name="main" depends="closure-jar-check" unless="closure.jar.exists">
-		<mkdir dir="${closure.dir}/google/closure-compiler" />
+    <target name="download-zip"
+        description="Downloads tar/zip, and optionally verifies checksum and copies extracted
jar.">                
+        
+        <mkdir dir="${download.dir}"/>        
+    	
+        <get src="${srcUrl}/${zipFile}" dest="${download.dir}/${zipFile}"/>
 
-		<get src="http://www.apache.org/licenses/LICENSE-2.0" 
-			dest="${closure.dir}/closure-LICENSE.txt"/>
+        <condition property="zip.compressed">
+            <matches string="${zipFile}" pattern="^*.zip$"/>      
+        </condition>
+ 
+        <antcall target="untar-file"/>
+        <antcall target="unzip-file"/>
+        
+        <antcall target="check-sum">
+            <param name="message" value="Checksum mismatch for ${download.dir}/${zipFile}"/>
+        </antcall>
+        
+        <condition property="destination.known">
+            <and>
+                <isset property="srcJarPath"/>
+                <isset property="destJarFile"/>
+            </and>
+        </condition> 
+        <antcall target="copy-downloaded-jar"/>
+     </target>   	
+     
+    <target name="download-bz2"
+        description="Downloads bz2, and optionally verifies checksum and copies extracted
jar.">                
         
         <mkdir dir="${download.dir}"/>        
     	
-        <get src="http://closure-compiler.googlecode.com/files/${zipFile}" 
-        	dest="${download.dir}/${zipFile}"/>
+        <get src="${srcUrl}/${zipFile}" dest="${download.dir}/${zipFile}"/>
 
-    	<unzip src="${download.dir}/${zipFile}" dest="${download.dir}/temp"/>
+        <untar src="${download.dir}/${zipFile}" dest="${download.dir}/temp" compression="bzip2"/>

+        
+        <antcall target="check-sum">
+            <param name="message" value="Checksum mismatch for ${download.dir}/${zipFile}"/>
+        </antcall>
+        
+        <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:
+            srcUrl
+            srcJarFile
+            destJarFile
+            [md5]
+    -->
+    <target name="download-jar" 
+        description="Downloads jar, and optionally verifies checksum.">              
 
+     
+        <get src="${srcUrl}/${srcJarFile}" dest="${destJarFile}"/>
+        <checksum file="${destJarFile}" algorithm="MD5" property="${we.failed}"/>
+        <antcall target="fail-with-message">
+            <param name="message" value="Checksum mismatch for ${destJarFile}"/>
+        </antcall>
+    </target>
 
-		<copy todir="${closure.dir}">
-            <fileset dir="${download.dir}/temp">
-                <include name="compiler.jar"/>
-            </fileset>
-        </copy>
+    <target name="untar-file" unless="zip.compressed" description="Untars zipFile">
+        <untar src="${download.dir}/${zipFile}" dest="${download.dir}/temp" compression="gzip"/>

+    </target>
+    
+    <target name="unzip-file" if="zip.compressed" description="Unzips zipFile">
+        <unzip src="${download.dir}/${zipFile}" dest="${download.dir}/temp"/>    
+    </target>
+    
+    <target name="check-sum" if="md5" 
+        description="Verifies MD5 checksum, and fails if checksum doesn't match">
         
-		<antcall target="clean" />    
+        <checksum file="${download.dir}/${zipFile}" algorithm="MD5" property="${we.failed}"/>
+        <antcall target="fail-with-message">
+            <param name="message" value="${message}"/>
+        </antcall>
+    </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="download-zip">
+	      <param name="srcUrl" value="http://closure-compiler.googlecode.com/files"/>
+	      <param name="zipFile" value="compiler-20110615.zip"/>
+	      <param name="sha1" value="7bece33b7535315143374f252955833164bc5b38"/>
+	    </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>
+	
+	   <!--
+	        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.">
+                
+        <antcall target="download-zip">
+          <param name="srcUrl" value="http://archive.apache.org/dist/commons/io/binaries"/>
+          <param name="zipFile" 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>
         
     <!--



Mime
View raw message