You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@flex.apache.org by cf...@apache.org on 2012/04/20 21:13:33 UTC
svn commit: r1328481 - in /incubator/flex/trunk: README build.xml
frameworks/build.xml modules/build.xml modules/downloads.xml
Author: cframpton
Date: Fri Apr 20 19:13:33 2012
New Revision: 1328481
URL: http://svn.apache.org/viewvc?rev=1328481&view=rev
Log:
1. Remove dependency on ant-contrib in downloads.xml and update README. [https://issues.apache.org/jira/browse/FLEX-35]
2. Download playerglobal.swc to target the 11.1 APIs.
3. In modules, make targets consistent with frameworks so downloads->thirdparty-downloads and downloads-clean->thirdparty-clean and add super-clean target.
4. Add rat-check target to top-level build file. This uses an Apache task to check for missing licenses. The excludes still need to be filled in.
Modified:
incubator/flex/trunk/README
incubator/flex/trunk/build.xml
incubator/flex/trunk/frameworks/build.xml
incubator/flex/trunk/modules/build.xml
incubator/flex/trunk/modules/downloads.xml
Modified: incubator/flex/trunk/README
URL: http://svn.apache.org/viewvc/incubator/flex/trunk/README?rev=1328481&r1=1328480&r2=1328481&view=diff
==============================================================================
--- incubator/flex/trunk/README (original)
+++ incubator/flex/trunk/README Fri Apr 20 19:13:33 2012
@@ -44,7 +44,6 @@ Building Apache Flex
Java SDK 1.5.0_13 or greater
Ant 1.7.0 or greater
- ant-contrib-1.0b2.jar in the lib directory of your ant installation
on Windows you need to run from a shell like Cygwin or git bash
The following environment variables must be set:
Modified: incubator/flex/trunk/build.xml
URL: http://svn.apache.org/viewvc/incubator/flex/trunk/build.xml?rev=1328481&r1=1328480&r2=1328481&view=diff
==============================================================================
--- incubator/flex/trunk/build.xml (original)
+++ incubator/flex/trunk/build.xml Fri Apr 20 19:13:33 2012
@@ -114,9 +114,6 @@
<!--
To clean these you must call thirdparty-clean or super-clean to clean everything.
clean does not remove these since they don't change often and the downloads take time.
-
- FixMe: fix inconsistency in target names
- thirdparty-downloads is more explicit but downloads easier to remember
-->
<target name="thirdparty-downloads" depends="flashplayer-download" description="Downloads all the required thirdparty code.">
<ant dir="${basedir}/modules" target="downloads"/>
@@ -1267,4 +1264,19 @@
<arg line="${basedir}/frameworks/libs/framework.swc frameworkSwcExceptionsList.txt"/>
</java>
</target>
+
+ <!-- Runs Apache Rat against the source code, to spot any files -->
+ <!-- which are missing the correct license headers -->
+ <!-- You need to download rat from http://incubator.apache.org/rat/ -->
+ <!-- and place the Rat jar into your ant lib before running -->
+ <target name="rat-check">
+ <typedef resource="org/apache/rat/anttasks/antlib.xml"
+ uri="antlib:org.apache.rat.anttasks"/>
+ <rat:report xmlns:rat="antlib:org.apache.rat.anttasks">
+ <fileset dir="src/">
+ <!--exclude name="documentation/content/xdocs/dtd/" /-->
+ </fileset>
+ </rat:report>
+ </target>
+
</project>
Modified: incubator/flex/trunk/frameworks/build.xml
URL: http://svn.apache.org/viewvc/incubator/flex/trunk/frameworks/build.xml?rev=1328481&r1=1328480&r2=1328481&view=diff
==============================================================================
--- incubator/flex/trunk/frameworks/build.xml (original)
+++ incubator/flex/trunk/frameworks/build.xml Fri Apr 20 19:13:33 2012
@@ -298,6 +298,10 @@ tar -xjf "AIR Integration Kit.tbz2"
<!-- Download thirdparty code -->
+ <!--
+ To clean these you must call thirdparty-clean or super-clean to clean everything.
+ clean does not remove these since they don't change often and the downloads take time.
+ -->
<target name="thirdparty-downloads"
depends="airsdk-download,playerglobal-download,osmf-download,swfobject-download,textLayout-download"
description="Copies third-party software into place for build">
@@ -350,8 +354,8 @@ tar -xjf "AIR Integration Kit.tbz2"
<!-- playerglobal.swc -->
<!-- Because this requires a network connection it copies playglobal.swc only if it doesn't already exist. -->
<target name="playerglobal-download" depends="playerglobal-check" unless="playerglobal.swc.present" description="Copies playerglobal.swc from the Adobe website">
- <mkdir dir="${basedir}/libs/player/${playerglobal.version}"/>
- <get src="http://fpdownload.macromedia.com/pub/flashplayer/updaters/11/playerglobal11_0.swc"
+ <mkdir dir="${basedir}/libs/player/${playerglobal.version}"/>
+ <get src="http://opensource.adobe.com/svn/opensource/flex/sdk/branches/4.y/frameworks/libs/player/11.1/playerglobal.swc"
dest="${basedir}/libs/player/${playerglobal.version}/playerglobal.swc"
verbose="false"/>
</target>
Modified: incubator/flex/trunk/modules/build.xml
URL: http://svn.apache.org/viewvc/incubator/flex/trunk/modules/build.xml?rev=1328481&r1=1328480&r2=1328481&view=diff
==============================================================================
--- incubator/flex/trunk/modules/build.xml (original)
+++ incubator/flex/trunk/modules/build.xml Fri Apr 20 19:13:33 2012
@@ -49,17 +49,20 @@
Each of the main targets for the modules will call clean themselves before proceeding.
-->
- <target name="main" depends="downloads,modules" description="Full build" />
+ <target name="main" depends="thirdparty-downloads,modules" description="Full build" />
<target name="dev" depends="modules-dev" description="Runs src.depend build for development"/>
- <!--
- To clean these you must call downloads-clean.
- clean does not remove these since they don't change often and the downloads take time.
- -->
- <target name="downloads" unless="downloads.jar.done" description="Downloads all the required thirdparty JARs.">
+ <target name="super-clean" depends="thirdparty-clean,clean" description="Cleans everything including thirdparty downloads."/>
+
+ <!--
+ To clean these you must call thirdparty-clean or super-clean to clean everything.
+ clean does not remove these since they don't change often and the downloads take time.
+ -->
+ <target name="thirdparty-downloads" unless="downloads.jar.done"
+ description="Downloads all the required thirdparty JARs.">
<ant antfile="${basedir}/downloads.xml" target="main" dir="${basedir}"/>
- <echo message="Use the downloads-clean target to remove these."/>
+ <echo message="Use the thirdparty-clean target to remove these."/>
<property name="downloads.jar.done" value="true"/>
</target>
@@ -67,7 +70,7 @@
Cleanup
-->
- <target name="downloads-clean" description="Removes all thirdparty JAR downloads.">
+ <target name="thirdparty-clean" description="Removes all thirdparty JAR downloads.">
<ant antfile="${basedir}/downloads.xml" target="clean" dir="${basedir}"/>
</target>
Modified: incubator/flex/trunk/modules/downloads.xml
URL: http://svn.apache.org/viewvc/incubator/flex/trunk/modules/downloads.xml?rev=1328481&r1=1328480&r2=1328481&view=diff
==============================================================================
--- incubator/flex/trunk/modules/downloads.xml (original)
+++ incubator/flex/trunk/modules/downloads.xml Fri Apr 20 19:13:33 2012
@@ -19,9 +19,6 @@
-->
<project name="downloads" default="main" basedir=".">
- <property name="ant-contrib.jar" location="${env.ANT_HOME}/lib/ant-contrib-1.0b2.jar"/>
- <taskdef resource="net/sf/antcontrib/antcontrib.properties" classpath="${ant-contrib.jar}"/>
-
<property name="FLEX_HOME" location=".."/>
<!-- properties -->
@@ -102,7 +99,9 @@
-->
<!--
- ToDo: convert this to a macro
+ 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
@@ -110,51 +109,41 @@
[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 and copies jar to the lib directory and verifies the checksum, if there is one.">
+
+ <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}"/>
- <if>
- <matches string="${zipFile}" pattern="^*.gz$"/>
- <then>
- <untar src="${download.dir}/${zipFile}" dest="${download.dir}" compression="gzip"/>
- </then>
- <else>
- <unzip src="${download.dir}/${zipFile}" dest="${download.dir}"/>
- </else>
- </if>
-
- <if>
+ <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="md5"/>
- <not><checksum file="${download.dir}/${zipFile}"
- algorithm="MD5"
- property="${md5}"/></not>
- </and>
- <then>
- <fail message="Checksum mismatch for ${download.dir}/${zipFile}"/>
- </then>
- </if>
-
- <if>
- <and>
<isset property="srcJarPath"/>
<isset property="destJarFile"/>
- </and>
- <then>
- <copy file="${download.dir}/${srcJarPath}"
- toFile="${FLEX_LIB}/${destJarFile}"
- verbose="true"/>
- </then>
- </if>
- </target>
-
+ </and>
+ </condition>
+ <antcall target="copy-downloaded-jar"/>
+ </target>
+
<!--
- ToDo: convert this to a macro
+ Download a jar file and optionally verify the checksum.
+ If the checksum fails, this script fails.
Params are:
srcUrl
@@ -163,25 +152,52 @@
[md5]
-->
<target name="download-jar"
- description="Downloads the jar to the FLEX_LIB directory and verifies the checksum, if there is one.">
-
- <get src="${srcUrl}/${srcJarFile}" dest="${FLEX_LIB}/${destJarFile}"/>
-
- <if>
- <and>
- <isset property="md5"/>
- <not><checksum file="${FLEX_LIB}/${destJarFile}"
- algorithm="MD5"
- property="${md5}"/></not>
- </and>
- <then>
- <fail message="Checksum mismatch for ${FLEX_LIB}/${destJarFile}"/>
- </then>
- </if>
- </target>
-
- <target name="commons-jars" depends="commons-collections-jar,commons-discovery-jar,commons-logging-jar" />
+ description="Downloads jar, and optionally verifies checksum.">
+
+ <get src="${srcUrl}/${srcJarFile}" dest="${FLEX_LIB}/${destJarFile}"/>
+ <antcall target="check-sum">
+ <param name="message" value="Checksum mismatch for ${FLEX_LIB}/${destJarFile}"/>
+ </antcall>
+ </target>
+ <target name="untar-file" unless="zip.compressed" description="Untars zipFile">
+ <untar src="${download.dir}/${zipFile}" dest="${download.dir}" compression="gzip"/>
+ </target>
+
+ <target name="unzip-file" if="zip.compressed" description="Unzips zipFile">
+ <unzip src="${download.dir}/${zipFile}" dest="${download.dir}"/>
+ </target>
+
+ <macrodef name="bundle-clean">
+ <attribute name="locale"/>
+ <sequential>
+ <delete failonerror="false">
+ <fileset dir="${FLEX_HOME}/frameworks/locale">
+ <include name="@{locale}/framework_rb.swc"/>
+ <include name="@{locale}/framework_rb.swc.incr"/>
+ </fileset>
+ </delete>
+ </sequential>
+ </macrodef>
+
+ <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-jar" if="destination.known">
+ <copy file="${download.dir}/${srcJarPath}" toFile="${FLEX_LIB}/${destJarFile}" verbose="true"/>
+ </target>
+
+ <target name="fail-with-message" if="we.failed"
+ description="Conditionally fails with the specified message">
+ <fail message="${message}"/>
+ </target>
+
<!--
batik - SVG toolkit
-->
@@ -269,7 +285,13 @@
</target>
<!--
- common-collections
+ commons
+ -->
+
+ <target name="commons-jars" depends="commons-collections-jar,commons-discovery-jar,commons-logging-jar" />
+
+ <!--
+ commons-collections
-->
<target name="commons-collections-jar-check" description="Checks if common-collections.jar has been downloaded.">