blob: 7e1504abb7a15fc064b6f8e3049e74bb55b5c07c [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="framework" 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}/framework_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}/framework_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>
<mkdir dir="${basedir}/bundles/@{locale}/docs" />
<zip destfile="${FLEX_HOME}/frameworks/locale/@{locale}/framework_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="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>
<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>
<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 framework.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, assets-clean">
<delete failonerror="false">
<fileset dir="${basedir}" >
<include name="bundles.properties"/>
<include name="bundles/en_US/packages.dita"/>
</fileset>
<fileset dir="${FLEX_HOME}/frameworks/libs">
<include name="framework.swc"/>
<include name="framework.swc.incr"/>
</fileset>
</delete>
</target>
<target name="bundles-clean">
<delete failonerror="false">
<fileset dir="${FLEX_HOME}/frameworks/locale">
<include name="*/framework_rb.swc"/>
<include name="*/framework_rb.swc.incr"/>
</fileset>
</delete>
</target>
<target name="pixelbender-clean">
<delete failonerror="false">
<fileset dir="${FLEX_HOME}/frameworks/projects/framework/src/mx/graphics/shaderClasses">
<include name="**/*.pbj"/>
</fileset>
</delete>
</target>
<target name="assets-clean">
<delete failonerror="false">
<fileset dir="${FLEX_HOME}/frameworks/projects/framework/assets">
<include name="**/*.swf"/>
</fileset>
</delete>
</target>
<target name="pixelbender-compile" unless="isLinux">
<!-- diagnose GPU and OpenGL -->
<exec executable="${env.PIXELBENDER_HOME}/sniffer_gpu.exe" os="windows"/>
<exec executable="${env.PIXELBENDER_HOME}/pbutil">
<arg value="${FLEX_HOME}/frameworks/projects/framework/src/mx/graphics/shaderClasses/Color.pbk" />
<arg value="${FLEX_HOME}/frameworks/projects/framework/src/mx/graphics/shaderClasses/Color.pbj" />
</exec>
<exec executable="${env.PIXELBENDER_HOME}/pbutil">
<arg value="${FLEX_HOME}/frameworks/projects/framework/src/mx/graphics/shaderClasses/ColorBurn.pbk" />
<arg value="${FLEX_HOME}/frameworks/projects/framework/src/mx/graphics/shaderClasses/ColorBurn.pbj" />
</exec>
<exec executable="${env.PIXELBENDER_HOME}/pbutil">
<arg value="${FLEX_HOME}/frameworks/projects/framework/src/mx/graphics/shaderClasses/ColorDodge.pbk" />
<arg value="${FLEX_HOME}/frameworks/projects/framework/src/mx/graphics/shaderClasses/ColorDodge.pbj" />
</exec>
<exec executable="${env.PIXELBENDER_HOME}/pbutil">
<arg value="${FLEX_HOME}/frameworks/projects/framework/src/mx/graphics/shaderClasses/Exclusion.pbk" />
<arg value="${FLEX_HOME}/frameworks/projects/framework/src/mx/graphics/shaderClasses/Exclusion.pbj" />
</exec>
<exec executable="${env.PIXELBENDER_HOME}/pbutil">
<arg value="${FLEX_HOME}/frameworks/projects/framework/src/mx/graphics/shaderClasses/Hue.pbk" />
<arg value="${FLEX_HOME}/frameworks/projects/framework/src/mx/graphics/shaderClasses/Hue.pbj" />
</exec>
<exec executable="${env.PIXELBENDER_HOME}/pbutil">
<arg value="${FLEX_HOME}/frameworks/projects/framework/src/mx/graphics/shaderClasses/Luminosity.pbk" />
<arg value="${FLEX_HOME}/frameworks/projects/framework/src/mx/graphics/shaderClasses/Luminosity.pbj" />
</exec>
<exec executable="${env.PIXELBENDER_HOME}/pbutil">
<arg value="${FLEX_HOME}/frameworks/projects/framework/src/mx/graphics/shaderClasses/LuminosityMaskFilter.pbk" />
<arg value="${FLEX_HOME}/frameworks/projects/framework/src/mx/graphics/shaderClasses/LuminosityMaskFilter.pbj" />
</exec>
<exec executable="${env.PIXELBENDER_HOME}/pbutil">
<arg value="${FLEX_HOME}/frameworks/projects/framework/src/mx/graphics/shaderClasses/Saturation.pbk" />
<arg value="${FLEX_HOME}/frameworks/projects/framework/src/mx/graphics/shaderClasses/Saturation.pbj" />
</exec>
<exec executable="${env.PIXELBENDER_HOME}/pbutil">
<arg value="${FLEX_HOME}/frameworks/projects/framework/src/mx/graphics/shaderClasses/SoftLight.pbk" />
<arg value="${FLEX_HOME}/frameworks/projects/framework/src/mx/graphics/shaderClasses/SoftLight.pbj" />
</exec>
</target>
<target name="assets-compile">
<!-- 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"/>
<mxmlc fork="true"
file="${FLEX_HOME}/frameworks/projects/framework/assets/Assets.as"
output="${FLEX_HOME}/frameworks/projects/framework/assets/Assets.swf"
>
<jvmarg line="${compc.jvm.args}"/>
<target-player>${playerglobal.version}</target-player>
<library-path/>
<external-library-path dir="${env.PLAYERGLOBAL_HOME}">
<include name="${playerglobal.version}/playerglobal.swc"/>
</external-library-path>
</mxmlc>
</target>
<target name="compile" depends="assets-compile" description="Compiles framework.swc">
<echo message="Compiling frameworks/libs/framework.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 FrameworkClasses.as,
because these aren't referenced by the manifest classes.
Keep the standard metadata when compiling.
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/framework.swc">
<jvmarg line="${compc.jvm.args}"/>
<load-config filename="${FLEX_HOME}/frameworks/flex-config.xml"/>
<load-config filename="framework-config.xml"/>
<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 framework.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"/>
<load-config filename="${FLEX_HOME}/frameworks/flex-config.xml"/>
<load-config filename="framework-config.xml"/>
<doc-classes class="FrameworkClasses"/>
<doc-namespaces uri="http://www.adobe.com/2006/mxml"/>
<namespace uri="http://www.adobe.com/2006/mxml" manifest="${basedir}/manifest.xml"/>
<jvmarg line="${asdoc.jvm.args}"/>
</asdoc>
<!-- updates framework.swc with asdoc xml -->
<zip destfile="${FLEX_HOME}/frameworks/locale/en_US/framework_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>