| <?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="FLEXJS_HOME" location="../.."/> |
| |
| <!-- properties --> |
| <property file="${FLEXJS_HOME}/build.properties"/> |
| <property name="FLEX_HOME" value="${env.FLEX_HOME}" /> |
| |
| <property name="download.dir" value="${FLEXJS_HOME}/in"/> |
| |
| <!-- |
| 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,flat-ui-download,gcl-download" |
| description="Copies third-party software into place for build"> |
| <echo message="Use thirdparty-clean or super-clean to remove these."/> |
| </target> |
| |
| <target name="clean" depends="swfobject-clean,flat-ui-clean,gcl-clean" |
| description="Cleans thirdparty downloaded files."> |
| </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="${FLEXJS_HOME}/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="https://codeload.github.com/swfobject/swfobject/zip/2.2" |
| dest="${download.dir}/swfobject_2_2.zip" |
| verbose="false"/> |
| |
| <unzip src="${download.dir}/swfobject_2_2.zip" dest="${FLEXJS_HOME}/templates/swfobject"> |
| <patternset> |
| <include name="swfobject-2.2/swfobject/expressInstall.swf"/> |
| <include name="swfobject-2.2/swfobject/swfobject.js"/> |
| </patternset> |
| <flattenmapper /> |
| </unzip> |
| <mkdir dir="${FLEXJS_HOME}/templates/swfobject/history"/> |
| <copy toDir="${FLEXJS_HOME}/templates/swfobject/history" > |
| <fileset dir="${FLEXJS_HOME}/templates/swfobject/history"> |
| <include name="**"/> |
| </fileset> |
| </copy> |
| </target> |
| |
| <target name="swfobject-clean" description="Deletes templates swfobject code."> |
| <delete failonerror="false"> |
| <fileset dir="${FLEXJS_HOME}/templates/swfobject"> |
| <include name="**/**"/> |
| <exclude name="index.template.html"/> |
| </fileset> |
| </delete> |
| </target> |
| |
| <!-- swfobject.js (Version 2.2) --> |
| <!-- Because this requires a network connection it downloads SWFObject only if it doesn't already exist. --> |
| <target name="flat-ui-check" description="Checks if SWFObject has been downloaded."> |
| <available file="${FLEXJS_HOME}/frameworks/fonts/flat-ui-icons-regular.ttf" property="flat.donot.ask"/> |
| <condition property="flat.donot.ask"> |
| <isset property="build.noprompt"/> |
| </condition> |
| <condition property="do.flat.install"> |
| <isset property="build.noprompt"/> |
| </condition> |
| </target> |
| |
| <target name="ask-flat" unless="flat.donot.ask" |
| description="Prompt the user before downloading Flat fonts"> |
| |
| <property name="flat.prompt.text" |
| value="Apache FlexJS includes an optional component set that |
| ${line.separator}uses fonts from designmodo.com. |
| ${line.separator}The font files are subject to and governed by the |
| ${line.separator}Creative Commons Attribution-NonCommercial-NoDerivs 3.0 Unported license: |
| ${line.separator}http://creativecommons.org/licenses/by-nc-nd/3.0/ |
| ${line.separator}This license is not compatible with the Apache v2 license. |
| ${line.separator}Do you want to install the designmodo fonts?"/> |
| <input |
| message="${flat.prompt.text}" |
| validargs="y,n" |
| defaultvalue="n" |
| addproperty="input.flat.download"/> |
| <condition property="do.flat.install"> |
| <equals arg1="y" arg2="${input.flat.download}"/> |
| </condition> |
| <!-- Only ask once per ant run. --> |
| <property name="flat.donot.ask" value="set"/> |
| </target> |
| |
| <target name="flat-ui-download" depends="flat-ui-check,get-flat-fonts" |
| description="Copies FlatUI from github" /> |
| |
| <target name="get-flat-fonts" depends="ask-flat" if="do.flat.install" > |
| |
| <mkdir dir="${download.dir}"/> |
| <get src="https://github.com/designmodo/Flat-UI/archive/2.2.2.zip" |
| dest="${download.dir}/flat-ui_2_2.zip" |
| verbose="false"/> |
| |
| <mkdir dir="${FLEXJS_HOME}/frameworks/fonts"/> |
| <unzip src="${download.dir}/flat-ui_2_2.zip" dest="${FLEXJS_HOME}/frameworks/fonts"> |
| <patternset> |
| <include name="Flat-UI-2.2.2/fonts/glyphicons/flat-ui-icons-regular.eot"/> |
| <include name="Flat-UI-2.2.2/fonts/glyphicons/flat-ui-icons-regular.ttf"/> |
| <include name="Flat-UI-2.2.2/fonts/glyphicons/flat-ui-icons-regular.svg"/> |
| <include name="Flat-UI-2.2.2/fonts/glyphicons/flat-ui-icons-regular.woff"/> |
| </patternset> |
| <flattenmapper /> |
| </unzip> |
| <unzip src="${download.dir}/flat-ui_2_2.zip" dest="${FLEXJS_HOME}/frameworks/fonts"> |
| <patternset> |
| <include name="Flat-UI-2.2.2/README.md"/> |
| </patternset> |
| <flattenmapper /> |
| </unzip> |
| </target> |
| |
| <target name="flat-ui-clean" description="Deletes flat-ui fonts."> |
| <delete failonerror="false"> |
| <fileset dir="${FLEXJS_HOME}/frameworks/fonts"> |
| <include name="**"/> |
| </fileset> |
| </delete> |
| </target> |
| |
| <!-- Google Closure Library --> |
| <target name="gcl-download" depends="check-goog-home" unless="GOOG_HOME" description="Downloads Google Closure Library"> |
| <mkdir dir="${download.dir}"/> |
| <get src="https://github.com/google/closure-library/archive/master.zip" |
| dest="${download.dir}/google-closure-library-master.zip" |
| verbose="false"/> |
| |
| <mkdir dir="${FLEXJS_HOME}/js/lib/google/closure-library"/> |
| <unzip src="${download.dir}/google-closure-library-master.zip" dest="${FLEXJS_HOME}/js/lib/google/closure-library"> |
| <cutdirsmapper dirs="1" /> |
| </unzip> |
| </target> |
| |
| <target name="gcl-clean" description="Deletes Google Closure Library"> |
| <echo message="Deleting Google Closure Library"/> |
| <delete dir="${FLEXJS_HOME}/js/lib" failonerror="false" /> |
| </target> |
| |
| <target name="check-goog-home" description="Check that GOOG_HOME is a directory"> |
| <echo message="GOOG_HOME is ${env.GOOG_HOME}"/> |
| <available file="${env.GOOG_HOME}" |
| type="dir" |
| property="GOOG_HOME" |
| value="${env.GOOG_HOME}" /> |
| </target> |
| |
| </project> |