Skip to content
Permalink
Browse files
removed Swc's from FlexUnit4, FlexUnit4FluintExtensions and FlexUnit4…
…Test and added download.xml ant file to automatically download those dependencies.
  • Loading branch information
cyrillzadra committed May 21, 2013
1 parent 8d0f8f2 commit 81c486b932203f6ae5046e8b2c1beb9205a9bd7b
Show file tree
Hide file tree
Showing 15 changed files with 589 additions and 3 deletions.
@@ -1 +1,2 @@
/.actionScriptProperties
/in/
@@ -91,8 +91,12 @@
<!-- Create properties file from .flexLibProperties -->
<xslt in="${basedir}/.flexLibProperties" out="${bin.loc}/flexLib.properties" style="${basedir}/flexLibProperties.xsl" />
</target>

<target name="prebuild">
<ant antfile="${basedir}/downloads.xml" dir="${basedir}" />
</target>

<target name="compile" depends="init, compile-flex,compile-as3,as3-linker-check" />
<target name="compile" depends="init, prebuild, compile-flex,compile-as3,as3-linker-check" />

<target name="compile-flex">
<!-- Pull in class file list for compc -->
@@ -0,0 +1,212 @@
<?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}/libs"/>

<property name="download.dir" value="${compiler.tests}/in"/>

<!--
Notes:
For Apache, the SWCs must be removed from the repository.
Licenses:
flexunit1lib () - ?
harmcrest (1.1.3) -
-->

<!--
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, flexunit1lib-swc, hamcrest-swc"
description="Downloads all the required thirdparty SWCs"/>

<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="FlexUnit1Lib*/**"/>
</fileset>
</delete>
</target>

<!--
Download thirdparty SWCs
-->

<!--
Download a swc file and optionally verify the checksum.
If the checksum fails, this script fails.
Params are:
srcUrl
srcSwcFile
destSwcFile
[md5]
-->
<target name="download-swc"
description="Downloads swc, and optionally verifies checksum.">
<get src="${srcUrl}/${srcSwcFile}" dest="${destSwcFile}"/>
<checksum file="${destSwcFile}" algorithm="MD5" property="${we.failed}"/>
<antcall target="fail-with-message">
<param name="message" value="Checksum mismatch for ${destSwcFile}"/>
</antcall>
</target>

<!--
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="download-zip"
description="Downloads tar/zip, and optionally verifies checksum and copies extracted swc.">

<mkdir dir="${download.dir}"/>

<get src="${srcUrl}/${zipFile}" dest="${download.dir}/${zipFile}"/>

<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-swc"/>
</target>

<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">

<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-swc" 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>

<!--
flexunit1lib
-->

<target name="flexunit1lib-swc-check" description="Checks if flexunit1lib swc exists.">
<condition property="flexunit1lib.swc.exists">
<and>
<available file="${lib.dir}/FlexUnit1Lib.swc"/>
</and>
</condition>
</target>

<target name="flexunit1lib-swc" depends="flexunit1lib-swc-check" unless="flexunit1lib.swc.exists"
description="Copies the flexunit1lib swc to the lib directory.">
<echo message="Obtaining libs/FlexUnit1Lib.swc"/>
<antcall target="flexunit1lib-download-swc"/>
</target>

<target name="flexunit1lib-download-swc" depends="flexunit1lib-swc-check" unless="flexunit1lib.swc.exists"
description="Downloads the flexunit1lib swc.">
<antcall target="download-swc">
<param name="srcUrl" value="https://fluint.googlecode.com/svn-history/r268/branches/skunkworks/flexUnit4/FlexUnit4/libs"/>
<param name="srcSwcFile" value="FlexUnit1Lib.swc"/>
<param name="destSwcFile" value="${lib.dir}/FlexUnit1Lib.swc"/>
</antcall>
</target>


<!--
hamcrest-as3
-->
<target name="hamcrest-swc" depends="hamcrest-swc-check"
unless="hamcrest.swc.exists"
description="Downloads and copies hamcrest to the lib directory.">
<echo message="Obtaining lib/hamcrest-as3-flex-1.1.3.swc"/>
<antcall target="download-zip">
<param name="srcUrl" value="http://cloud.github.com/downloads/drewbourne/hamcrest-as3"/>
<param name="zipFile" value="hamcrest-as3-flex-1.1.3.zip"/>
<param name="srcJarPath" value="hamcrest-as3-flex-1.1.3/hamcrest-as3-flex-1.1.3.swc"/>
<param name="md5" value="b73fe1bb5f443993adcf8b274f6a48b2"/>
<param name="destJarFile" value="${lib.dir}/hamcrest-as3-flex-1.1.3.swc"/>
</antcall>
<delete dir="${download.dir}/temp/hamcrest-as3-flex-1.1.3"/>
</target>

<target name="hamcrest-swc-check" description="Checks if harmcrest swc exists.">
<condition property="hamcrest.swc.exists">
<and>
<available file="${lib.dir}/hamcrest-as3-flex-1.1.3.swc"/>
</and>
</condition>
</target>

</project>
Binary file not shown.
Binary file not shown.
@@ -0,0 +1 @@
/lib/
@@ -63,8 +63,12 @@
</fileset>
</copy>
</target>

<target name="prebuild">
<ant antfile="${basedir}/downloads.xml" dir="${basedir}" />
</target>

<target name="compile" depends="init">
<target name="compile" depends="init, prebuild">
<compc output="${bin.loc}/${build.finalName}.${build.packaging}">
<include-sources dir="${src.loc}" includes="*" append="true" />
<source-path path-element="${src.loc}" />
@@ -0,0 +1,120 @@
<?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}/libs"/>

<property name="download.dir" value="${compiler.tests}/in"/>

<!--
Notes:
For Apache, the SWCs must be removed from the repository.
Licenses:
fluint (1.2) - MIT
-->

<!--
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, fluint-swc"
description="Downloads all the required thirdparty SWCs"/>

<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="fluint*/**"/>
<include name="flexunit/*/**"/>
</fileset>
</delete>
</target>

<!--
Download thirdparty JARs
-->

<!--
Download a swc file and optionally verify the checksum.
If the checksum fails, this script fails.
Params are:
srcUrl
srcSwcFile
destSwcFile
[md5]
-->
<target name="download-swc"
description="Downloads swc, and optionally verifies checksum.">
<get src="${srcUrl}/${srcSwcFile}" dest="${destSwcFile}"/>
<checksum file="${destSwcFile}" algorithm="MD5" property="${we.failed}"/>
<antcall target="fail-with-message">
<param name="message" value="Checksum mismatch for ${destSwcFile}"/>
</antcall>
</target>

<target name="fail-with-message" if="we.failed"
description="Conditionally fails with the specified message">
<fail message="${message}"/>
</target>

<!--
fluint
-->

<target name="fluint-swc-check" description="Checks if fluint swc exists.">
<condition property="fluint.swc.exists">
<and>
<available file="${lib.dir}/fluint-1_2.swc"/>
</and>
</condition>
</target>

<target name="fluint-swc" depends="fluint-swc-check" unless="fluint.swc.exists"
description="Copies the fluint swc to the lib directory.">
<echo message="Obtaining libs/fluint-1_2.swc"/>
<antcall target="fluint-download-swc"/>
</target>

<target name="fluint-download-swc" depends="fluint-swc-check" unless="fluint.swc.exists"
description="Downloads the fluint swc.">
<antcall target="download-swc">
<param name="srcUrl" value="https://fluint.googlecode.com/svn-history/r268/branches/skunkworks/flexUnit4/FlexUnit4/libs"/>
<param name="srcSwcFile" value="fluint-1_2.swc"/>
<param name="destSwcFile" value="${lib.dir}/fluint-1_2.swc"/>
</antcall>
</target>

</project>
Binary file not shown.
@@ -1,2 +1,3 @@
/.actionScriptProperties
/.flexProperties
/in/
@@ -187,8 +187,12 @@
</classpath>
</taskdef>
</target>

<target name="prebuild">
<ant antfile="${basedir}/downloads.xml" dir="${basedir}" />
</target>

<target name="test" depends="init,test-only,test-and-instrument" />
<target name="test" depends="init,prebuild,test-only,test-and-instrument" />

<target name="test-only" unless="build.instrument">
<echo message="Testing FlexUnit Flex build..." />

0 comments on commit 81c486b

Please sign in to comment.