blob: 76362fe00fe0ca9b417c6766d0490e3c6d3beae3 [file] [log] [blame]
<?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=".">
<property name="FLEX_HOME" location=".."/>
<!-- properties -->
<property file="${FLEX_HOME}/build.properties"/>
<property name="download.dir" value="${FLEX_HOME}/in"/>
<!-- See note in modules/download.xml about this property. -->
<property name="lib.opt.dir" value="${FLEX_HOME}/lib/external/optional"/>
<property name="adobe.flex.dir" value="adobe_flex_sdk_4.6"/>
<property name="adobe.flex.zip.file" value="flex_sdk_4.6.0.23201B.zip"/>
<property name="adobe.flex.license" value="
${line.separator}
${line.separator}Adobe Flex SDK License Agreement:
${line.separator}
${line.separator}All files contained in this Adobe Flex SDK download are subject to and governed by the
${line.separator}Adobe Flex SDK License Agreement specified here:
${line.separator} http://www.adobe.com/products/eulas/pdfs/adobe_flex_software_development_kit-combined-20110916_0930.pdf,
${line.separator}By downloading, modifying, distributing, using and/or accessing any files in this Adobe Flex SDK,
${line.separator}you agree to the terms and conditions of the applicable end user license agreement.
${line.separator}
${line.separator}In addition to the Adobe license terms, you also agree to be bound by the third-party terms specified here:
${line.separator} http://www.adobe.com/products/eula/third_party/.
${line.separator}Adobe recommends that you review these third-party terms.
${line.separator}" />
<!--
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="main"
depends="swfobject-download,swfobject-fabridge-download,osmf-download,optional-downloads"
description="Copies third-party software into place for build">
<echo message="Use thirdparty-clean or super-clean to remove these."/>
</target>
<target name="optional-downloads"
depends="blazeds-jar, font-jars, clean-adobe-flex-sdk"
description="Downloads, after prompt for each, the optional thirdparty JARs"/>
<target name="clean" depends="swfobject-clean,swfobject-fabridge-clean,clean-adobe-flex-sdk"
description="Cleans thirdparty downloaded files.">
<delete failonerror="false">
<fileset dir="${basedir}/libs">
<include name="osmf.swc"/>
</fileset>
</delete>
<delete includeEmptyDirs="true" failonerror="false">
<fileset dir="${download.dir}">
<include name="${adobe.flex.zip.file}"/>
<include name="OSMF*/**"/>
<include name="osmf*/**"/>
<include name="swfobject*/**"/>
</fileset>
</delete>
<delete dir="${lib.opt.dir}" failonerror="false"/>
</target>
<!--
MPL 1.1 Licesense Notification
See http://www.apache.org/legal/3party.html#labeling-reciprocity
Section "Category B: Reciprocal Licenses"
-->
<target name="echo-mpl1.1-license">
<input
message="Mozilla Public License Version 1.1:
${line.separator}
${line.separator}The contents of the file(s) are subject to the Mozilla Public License Version 1.1.
${line.separator}You may not use the file(s) except in compliance with the License.
${line.separator}You may obtain a copy of the License here:
${line.separator} http://www.mozilla.org/MPL/.
${line.separator}By downloading, modifying, distributing, using and/or accessing the file(s),
${line.separator}you agree to the terms and conditions of the applicable license agreement.
${line.separator}
${line.separator}I have read the MPL1.1 license information above?"
validargs="y"
defaultvalue="y"/>
</target>
<!--
osmf.swc (Version 1.0)
The swc at the top-level has lots of trace statements in it. Use the one in the source zip.
-->
<target name="osmf-check" description="Checks if the Open Source Media Framework has been downloaded.">
<available file="${basedir}/libs/osmf.swc" property="osmf.swc.present"/>
</target>
<!--
Notify before downloading file with MPL1.1 license.
-->
<target name="ask-osmf" unless="build.noprompt">
<echo message="The Open Source Media Framework (OSMF) used by the video components"/>
<echo message="is licensed under the Mozilla Public License Version 1.1."/>
<antcall target="echo-mpl1.1-license"/>
<property name="do.osmf.install" value="set" />
</target>
<target name="osmf-download" depends="osmf-check" unless="osmf.swc.present">
<antcall target="ask-osmf"/>
<available file="${download.dir}/OSMF_1.0.zip" type="file" property="osmf.zip.exists"/>
<antcall target="download-osmf-zip" />
<unzip src="${download.dir}/OSMF_1.0.zip" dest="${download.dir}">
<patternset>
<include name="osmf_source_v1-0.zip"/>
</patternset>
</unzip>
<unzip src="${download.dir}/osmf_source_v1-0.zip" dest="${basedir}/libs">
<patternset>
<include name="OSMF.swc"/>
</patternset>
<mapper type="glob" from="OSMF.swc" to="osmf.swc" />
</unzip>
</target>
<target name="download-osmf-zip" unless="osmf.zip.exists">
<mkdir dir="${download.dir}"/>
<get src="http://sourceforge.net/projects/osmf.adobe/files/OSMF%201.0%20%28final%20source%2C%20ASDocs%2C%20PDF%20guides%2C%20and%20release%20notes%29/OSMF_1.0.zip/download"
dest="${download.dir}/OSMF_1.0.zip"
verbose="false"/>
</target>
<!-- swfobject.js (Version 2.2) -->
<!-- Because this requires a network connection it downloads SWFObject only if it doesn't already exist. -->
<target name="swfobject-check" description="Checks if SWFObject has been downloaded.">
<available file="${basedir}/../templates/swfobject/swfobject.js" property="swfobject.js.present"/>
</target>
<target name="swfobject-download" depends="swfobject-check" unless="swfobject.js.present"
description="Copies SWFObject from code.google.com">
<mkdir dir="${download.dir}"/>
<get src="http://swfobject.googlecode.com/files/swfobject_2_2.zip"
dest="${download.dir}/swfobject_2_2.zip"
verbose="false"/>
<unzip src="${download.dir}/swfobject_2_2.zip" dest="${FLEX_HOME}/templates">
<patternset>
<include name="swfobject/expressInstall.swf"/>
<include name="swfobject/swfobject.js"/>
</patternset>
</unzip>
</target>
<target name="swfobject-clean" description="Deletes templates swfobject code.">
<delete failonerror="false">
<fileset dir="${FLEX_HOME}/templates/swfobject">
<include name="**/**"/>
<exclude name="history/*"/>
<exclude name="index.template.html"/>
</fileset>
</delete>
</target>
<!-- the copy of swfobject.js that is in javascript/fabridge -->
<target name="swfobject-fabridge-download" depends="swfobject-download"
description="Copies swfobject.js from code.google.com to fabridge">
<mkdir dir="${basedir}/javascript/FABridge/samples/fabridge/swfobject"/>
<copy file="${FLEX_HOME}/templates/swfobject/swfobject.js"
todir="${basedir}/javascript/FABridge/samples/fabridge/swfobject" />
</target>
<target name="swfobject-fabridge-clean" description="Deletes swobject.js from fabridge">
<delete failonerror="false" includeemptydirs="true">
<fileset dir="${basedir}/javascript/FABridge/samples/fabridge/swfobject">
<include name="swfobject.js"/>
</fileset>
</delete>
</target>
<!--============================================================================= -->
<!-- Optional Jars. Licenses are not compatible with Apache v2 license. -->
<!--============================================================================= -->
<!--
flex-messaging-common.jar - BlazeDS interface for -service compiler option
This does not get installed if build.noprompt is set.
-->
<target name="blazeds-jar-check" unless="blazeds.donot.ask"
description="Checks if flex-messaging-common.jar is in optional lib directory.">
<available file="${lib.opt.dir}/flex-messaging-common.jar" property="blazeds.donot.ask"/>
<condition property="blazeds.donot.ask">
<isset property="build.noprompt"/>
</condition>
</target>
<target name="blazeds-jar" depends="blazeds-jar-check,get-blazeds-jar"
description="Downloads and copies flex-messaging-common.jar to the optional lib directory."/>
<!-- Prompt before downloading. -->
<target name="ask-blazeds" unless="blazeds.donot.ask"
description="Prompt the user before downloading BlaseDS">
<property name="blazeds.prompt.text"
value="Apache Flex can optionally integrate with Adobe BlazeDS.
${line.separator}This feature requires flex-messaging-common.jar from the Adobe Flex SDK.
${line.separator}The Adobe SDK license agreement for Adobe Flex 4.6 applies to this jar.
${line.separator}This license is not compatible with the Apache v2 license.
${adobe.flex.license}
${line.separator}Do you want to install this jar from the Adobe Flex SDK?"/>
<input
message="${blazeds.prompt.text}"
validargs="y,n"
defaultvalue="n"
addproperty="input.blazeds.download"/>
<condition property="do.blazeds.install">
<equals arg1="y" arg2="${input.blazeds.download}"/>
</condition>
<!-- Only ask once per ant run. -->
<property name="blazeds.donot.ask" value="set"/>
</target>
<target name="get-blazeds-jar" depends="ask-blazeds" if="do.blazeds.install">
<available file="${download.dir}/${adobe.flex.dir}" type="dir"
property="adobe.flex.sdk.exists"/>
<antcall target="get-adobe-flex-sdk"/>
<copy file="${download.dir}/${adobe.flex.dir}/lib/flex-messaging-common.jar"
todir="${lib.opt.dir}" verbose="true"/>
<copy file="${download.dir}/${adobe.flex.dir}/license-adobesdk.htm"
tofile="${lib.opt.dir}/flex-messaging-common-LICENSE.htm" verbose="true"/>
</target>
<!--
Embedded Font Support
This does not get installed if build.noprompt is set.
-->
<target name="font-jars-check" unless="font.donot.ask"
description="Checks if font jars are in the optional lib directory.">
<condition property="font.donot.ask">
<and>
<available file="${lib.opt.dir}/flex-fontkit.jar"/>
<available file="${lib.opt.dir}/afe.jar"/>
<available file="${lib.opt.dir}/aglj40.jar"/>
<available file="${lib.opt.dir}/rideau.jar"/>
</and>
</condition>
<condition property="font.donot.ask">
<isset property="build.noprompt"/>
</condition>
</target>
<target name="font-jars" depends="font-jars-check,get-font-jars"
description="Downloads and copies font jars to the optional lib directory."/>
<!-- Prompt before downloading. -->
<target name="ask-font" unless="font.donot.ask"
description="Prompt the user before downloading BlaseDS">
<property name="font.prompt.text"
value="Apache Flex can optionally integrate with Adobe's embedded font support.
${line.separator}This feature requires a few font jars from the Adobe Flex SDK.
${line.separator}The Adobe SDK license agreement for Adobe Flex 4.6 applies to these jars.
${line.separator}This license is not compatible with the Apache v2 license.
${adobe.flex.license}
${line.separator}Do you want to install these jars from the Adobe Flex SDK?"/>
<input
message="${font.prompt.text}"
validargs="y,n"
defaultvalue="n"
addproperty="input.font.download"/>
<condition property="do.font.install">
<equals arg1="y" arg2="${input.font.download}"/>
</condition>
<!-- Only ask once per ant run. -->
<property name="font.donot.ask" value="set"/>
</target>
<target name="get-font-jars" depends="ask-font" if="do.font.install">
<available file="${download.dir}/${adobe.flex.dir}" type="dir"
property="adobe.flex.sdk.exists"/>
<antcall target="get-adobe-flex-sdk"/>
<copy todir="${lib.opt.dir}" verbose="true">
<fileset dir="${download.dir}/${adobe.flex.dir}/lib">
<include name="afe.jar" />
<include name="aglj40.jar" />
<include name="flex-fontkit.jar" />
<include name="rideau.jar" />
</fileset>
</copy>
<copy file="${download.dir}/${adobe.flex.dir}/license-adobesdk.htm"
tofile="${lib.opt.dir}/flex-fontkit-LICENSE.htm" verbose="true"/>
<copy file="${download.dir}/${adobe.flex.dir}/license-adobesdk.htm"
tofile="${lib.opt.dir}/afe-LICENSE.htm" verbose="true"/>
<copy file="${download.dir}/${adobe.flex.dir}/license-adobesdk.htm"
tofile="${lib.opt.dir}/aglj40-LICENSE.htm" verbose="true"/>
<copy file="${download.dir}/${adobe.flex.dir}/license-adobesdk.htm"
tofile="${lib.opt.dir}/rideau.jar-LICENSE.htm" verbose="true"/>
</target>
<target name="get-adobe-flex-sdk" unless="adobe.flex.sdk.exists"
description="Downloads the Adobe Flex 4.6 SDK">
<available file="${download.dir}/${adobe.flex.zip.file}" type="file"
property="adobe.flex.sdk.download.exists"/>
<antcall target="download-adobe-flex-sdk" />
<unzip src="${download.dir}/${adobe.flex.zip.file}"
dest="${download.dir}/${adobe.flex.dir}">
<patternset>
<include name="license-adobesdk.htm"/>
<include name="lib/flex-messaging-common.jar"/>
<include name="lib/afe.jar" />
<include name="lib/aglj40.jar" />
<include name="lib/flex-fontkit.jar" />
<include name="lib/rideau.jar" />
</patternset>
</unzip>
</target>
<target name="download-adobe-flex-sdk" unless="adobe.flex.sdk.download.exists" >
<mkdir dir="${download.dir}"/>
<get src="http://fpdownload.adobe.com/pub/flex/sdk/builds/flex4.6/${adobe.flex.zip.file}"
dest="${download.dir}/${adobe.flex.zip.file}"/>
</target>
<target name="clean-adobe-flex-sdk">
<delete dir="${download.dir}/${adobe.flex.dir}"/>
</target>
</project>