| <?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="spark" default="main" basedir="."> |
| <property name="FLEX_HOME" location="${basedir}/../../.."/> |
| |
| <property file="${FLEX_HOME}/env.properties"/> |
| <property environment="env"/> |
| <property file="${FLEX_HOME}/build.properties"/> |
| |
| <macrodef name="bundle"> |
| <attribute name="locale"/> |
| <sequential> |
| <echo message="Compiling frameworks/locale/@{locale}/spark_rb.swc"/> |
| |
| <!-- Load the <compc> task. We can't do this at the <project> level --> |
| <!-- because targets that run before flexTasks.jar gets built would fail. --> |
| <taskdef resource="flexTasks.tasks" classpath="${FLEX_HOME}/lib/flexTasks.jar"/> |
| <compc fork="true" |
| output="${FLEX_HOME}/frameworks/locale/@{locale}/spark_rb.swc"> |
| <jvmarg line="${compc.jvm.args}"/> |
| <load-config filename="bundle-config.xml" /> |
| <arg value="+playerglobal.version=${playerglobal.version}" /> |
| <arg value="+env.PLAYERGLOBAL_HOME=${env.PLAYERGLOBAL_HOME}" /> |
| <arg value="+locale=@{locale}" /> |
| </compc> |
| </sequential> |
| </macrodef> |
| |
| <macrodef name="fat-swc"> |
| <attribute name="locale"/> |
| <sequential> |
| <echo message="creating 'fat-swc' in spark_rb.swc for @{locale}"/> |
| <mkdir dir="${basedir}/bundles/@{locale}/docs" /> |
| <zip destfile="${FLEX_HOME}/frameworks/locale/@{locale}/spark_rb.swc" update="true"> |
| <zipfileset dir="${basedir}/bundles/@{locale}/docs" prefix="docs"> |
| <include name="*.*"/> |
| </zipfileset> |
| <zipfileset dir="${basedir}/bundles/en_US" prefix="docs"> |
| <include name="packages.dita"/> |
| </zipfileset> |
| </zip> |
| </sequential> |
| </macrodef> |
| |
| <macrodef name="bundler"> |
| <attribute name="locale"/> |
| <element name="run.fat.swc" optional="yes"/> |
| <sequential> |
| <bundle-clean locale="@{locale}"/> |
| <bundle locale="@{locale}"/> |
| <run.fat.swc/> |
| </sequential> |
| </macrodef> |
| |
| <macrodef name="bundle-clean"> |
| <attribute name="locale"/> |
| <sequential> |
| <delete failonerror="false"> |
| <fileset dir="${FLEX_HOME}/frameworks/locale"> |
| <include name="@{locale}/spark_rb.swc"/> |
| <include name="@{locale}/spark_rb.swc.incr"/> |
| <include name="@{locale}/flex4_rb.swc"/> |
| </fileset> |
| </delete> |
| </sequential> |
| </macrodef> |
| |
| <condition property="isMac"> |
| <os family="mac"/> |
| </condition> |
| <condition property="isWindows"> |
| <os family="windows" /> |
| </condition> |
| <condition property="isLinux"> |
| <and> |
| <os family="unix"/> |
| <not> |
| <os family="mac"/> |
| </not> |
| </and> |
| </condition> |
| |
| <target name="main" depends="clean,compile" description="Clean build of spark.swc and en_US"> |
| <bundle locale="${locale}"/> |
| </target> |
| |
| <target name="other.locales" depends="bundles" description="Build other locale SWCs"/> |
| |
| <!-- This is a private target for building automation_flashflexkit_rb.swc for various locales. --> |
| <!-- The targets below set the 'locale' parameter and call it with <antcall>. --> |
| <target name="bundles"> |
| <!-- these languages do not have localized docs--> |
| <bundler locale="en_AU"/><!-- Australian resources --> |
| <bundler locale="en_GB"/><!-- United Kingdom resources --> |
| <bundler locale="en_CA"/><!-- Canadian resources --> |
| <bundler locale="da_DK"/><!-- Danish resources --> |
| <bundler locale="de_DE"><!-- German resources --> |
| <run.fat.swc> |
| <fat-swc locale="de_DE"/> |
| </run.fat.swc> |
| </bundler> |
| <bundler locale="de_CH"/><!-- Swiss German resources --> |
| <bundler locale="es_ES"/><!-- Spanish resources --> |
| <bundler locale="fi_FI"/><!-- Finnish resources--> |
| <bundler locale="fr_CH"/><!-- Swiss French resources --> |
| <bundler locale="fr_FR"><!-- French resources --> |
| <run.fat.swc> |
| <fat-swc locale="fr_FR"/> |
| </run.fat.swc> |
| </bundler> |
| <bundler locale="it_IT"/><!-- Italian resources --> |
| <bundler locale="ja_JP"><!-- Japanese resources --> |
| <run.fat.swc> |
| <fat-swc locale="ja_JP"/> |
| </run.fat.swc> |
| </bundler> |
| <bundler locale="ko_KR"/><!-- Korean resources --> |
| <bundler locale="nb_NO"/><!-- Norwegian Bokmal resources --> |
| <bundler locale="nl_NL"/><!-- Dutch resources --> |
| <bundler locale="pt_BR"/><!-- Brazilian Portuguese resources --> |
| <bundler locale="pt_PT"/><!-- Portugal Portuguese resources --> |
| <bundler locale="ru_RU"><!-- Russian resources --> |
| <run.fat.swc> |
| <fat-swc locale="ru_RU"/> |
| </run.fat.swc> |
| </bundler> |
| <bundler locale="sv_SE"/><!-- Swedish resources --> |
| <bundler locale="zh_CN"><!-- Simplified Chinese resources --> |
| <run.fat.swc> |
| <fat-swc locale="zh_CN"/> |
| </run.fat.swc> |
| </bundler> |
| <bundler locale="zh_TW"/><!-- Traditional Chinese resources --> |
| <bundler locale="el_GR"/><!-- Greek Language resources --> |
| </target> |
| |
| <target name="clean" depends="bundles-clean"> |
| <delete failonerror="false"> |
| <fileset dir="${basedir}" > |
| <include name="bundles.properties"/> |
| <include name="bundles/en_US/packages.dita"/> |
| <include name="manifest.xml"/> |
| </fileset> |
| <fileset dir="${FLEX_HOME}/frameworks/libs"> |
| <include name="spark.swc"/> |
| <include name="graphics.swc"/> |
| <include name="spark.swc.incr"/> |
| <include name="flex4.swc"/> |
| </fileset> |
| </delete> |
| </target> |
| |
| <target name="bundles-clean"> |
| <delete failonerror="false"> |
| <fileset dir="${FLEX_HOME}/frameworks/locale"> |
| <include name="*/spark_rb.swc"/> |
| <include name="*/spark_rb.swc.incr"/> |
| <include name="*/flex4_rb.swc"/> |
| </fileset> |
| </delete> |
| </target> |
| |
| <target name="pixelbender-clean"> |
| <delete failonerror="false"> |
| <fileset dir="${FLEX_HOME}/frameworks/projects/spark/asdoc/en_US/spark/effects/examples/assets"> |
| <include name="**/*.pbj"/> |
| </fileset> |
| <fileset dir="${FLEX_HOME}/frameworks/projects/spark/src/spark/effects"> |
| <include name="**/*.pbj"/> |
| </fileset> |
| </delete> |
| </target> |
| |
| <target name="compile" depends="swc-compile" description="Compiles spark.swc"/> |
| |
| <target name="pixelbender-compile" unless="isLinux"> |
| <exec executable="${env.PIXELBENDER_HOME}/pbutil"> |
| <arg value="${FLEX_HOME}/frameworks/projects/spark/asdoc/en_US/spark/effects/examples/assets/twist.pbk" /> |
| <arg value="${FLEX_HOME}/frameworks/projects/spark/asdoc/en_US/spark/effects/examples/assets/twist.pbj" /> |
| </exec> |
| <exec executable="${env.PIXELBENDER_HOME}/pbutil"> |
| <arg value="${FLEX_HOME}/frameworks/projects/spark/src/spark/effects/CrossFade.pbk" /> |
| <arg value="${FLEX_HOME}/frameworks/projects/spark/src/spark/effects/CrossFade.pbj" /> |
| </exec> |
| <exec executable="${env.PIXELBENDER_HOME}/pbutil"> |
| <arg value="${FLEX_HOME}/frameworks/projects/spark/src/spark/effects/WipeDown.pbk" /> |
| <arg value="${FLEX_HOME}/frameworks/projects/spark/src/spark/effects/WipeDown.pbj" /> |
| </exec> |
| <exec executable="${env.PIXELBENDER_HOME}/pbutil"> |
| <arg value="${FLEX_HOME}/frameworks/projects/spark/src/spark/effects/WipeUp.pbk" /> |
| <arg value="${FLEX_HOME}/frameworks/projects/spark/src/spark/effects/WipeUp.pbj" /> |
| </exec> |
| <exec executable="${env.PIXELBENDER_HOME}/pbutil"> |
| <arg value="${FLEX_HOME}/frameworks/projects/spark/src/spark/effects/WipeLeft.pbk" /> |
| <arg value="${FLEX_HOME}/frameworks/projects/spark/src/spark/effects/WipeLeft.pbj" /> |
| </exec> |
| <exec executable="${env.PIXELBENDER_HOME}/pbutil"> |
| <arg value="${FLEX_HOME}/frameworks/projects/spark/src/spark/effects/WipeRight.pbk" /> |
| <arg value="${FLEX_HOME}/frameworks/projects/spark/src/spark/effects/WipeRight.pbj" /> |
| </exec> |
| </target> |
| |
| <target name="prepare" description="Copies manifests to project directories so the IDE can find them"> |
| <copy file="${FLEX_HOME}/frameworks/spark-manifest.xml" tofile="${basedir}/manifest.xml" overwrite="true"/> |
| </target> |
| |
| <target name="swc-compile" depends="prepare" description="Compiles spark.swc"> |
| <echo message="Compiling frameworks/libs/spark.swc"/> |
| |
| <!-- Load the <compc> task. We can't do this at the <project> level --> |
| <!-- because targets that run before flexTasks.jar gets built would fail. --> |
| <taskdef resource="flexTasks.tasks" classpath="${FLEX_HOME}/lib/flexTasks.jar"/> |
| <!-- |
| Link in the classes (and their dependencies) for the MXML tags |
| listed in this project's manifest.xml. |
| Also link the additional classes (and their dependencies) |
| listed in SparkClasses.as, |
| because these aren't referenced by the manifest classes. |
| Link in accessibility support. |
| Include the appropriate CSS files and assets in the SWC. |
| Don't include any resources in the SWC. |
| Write a bundle list of referenced resource bundles |
| into the file bundles.properties in this directory. |
| --> |
| <compc fork="true" |
| output="${FLEX_HOME}/frameworks/libs/spark.swc"> |
| <jvmarg line="${compc.jvm.args}"/> |
| <load-config filename="compile-config.xml" /> |
| <arg value="+playerglobal.version=${playerglobal.version}" /> |
| <arg value="+env.PLAYERGLOBAL_HOME=${env.PLAYERGLOBAL_HOME}" /> |
| </compc> |
| </target> |
| |
| <target name="doc" depends="clean-temp-docs" description="updates spark.swc with asdoc xml"> |
| <!-- Load the <asdoc> task. We can't do this at the <project> level --> |
| <!-- because targets that run before flexTasks.jar gets built would fail. --> |
| <taskdef resource="flexTasks.tasks" classpath="${FLEX_HOME}/lib/flexTasks.jar"/> |
| |
| <condition property="asdoc.jvm.args" value="-Xmx384m"> |
| <os family="windows"/> |
| </condition> |
| |
| <condition property="asdoc.jvm.args" value="-Xmx512m"> |
| <os family="mac"/> |
| </condition> |
| |
| <condition property="asdoc.jvm.args" value="-Xmx512m"> |
| <os family="unix"/> |
| </condition> |
| |
| <!-- Call asdoc to generate dita xml files --> |
| <asdoc output="${FLEX_HOME}/tempDoc" lenient="true" failonerror="true" keep-xml="true" skip-xsl="true" fork="true"> |
| <compiler.source-path path-element="${basedir}/src"/> |
| <doc-classes class="SparkClasses"/> |
| <doc-namespaces uri="library://ns.adobe.com/flex/spark"/> |
| <namespace uri="library://ns.adobe.com/flex/spark" manifest="${basedir}/manifest.xml"/> |
| <jvmarg line="${asdoc.jvm.args}"/> |
| </asdoc> |
| |
| <!-- updates spark.swc with asdoc xml --> |
| <zip destfile="${FLEX_HOME}/frameworks/locale/en_US/spark_rb.swc" update="true"> |
| <zipfileset dir="${FLEX_HOME}/tempDoc/tempdita" prefix="docs"> |
| <include name="*.*"/> |
| <exclude name="ASDoc_Config.xml"/> |
| <exclude name="overviews.xml"/> |
| </zipfileset> |
| </zip> |
| <copy file="${FLEX_HOME}/tempDoc/tempdita/packages.dita" tofile="${basedir}/bundles/en_US/packages.dita"/> |
| </target> |
| |
| <target name="clean-temp-docs"> |
| <delete dir="${FLEX_HOME}/tempDoc" failonerror="false" includeEmptyDirs="true"/> |
| <delete file="${basedir}/bundles/en_US/packages.dita" failonerror="false"/> |
| </target> |
| |
| <target name="test" description="Runs the FlexUnit tests for this project"> |
| <ant antfile="${FLEX_HOME}/flexunit-tests.xml"> |
| <property name="project.root" value="${basedir}"/> |
| </ant> |
| </target> |
| |
| </project> |
| |
| |