blob: 5dacbc97494e4bdc6b76513cbfc742ca9e4df844 [file] [log] [blame]
<!--
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="combined" default="main" basedir=".">
<property name="FLEX_HOME" location="${basedir}/../../.."/>
<property file="${FLEX_HOME}/env.properties"/>
<property environment="env"/>
<property file="${FLEX_HOME}/local.properties"/>
<property file="${FLEX_HOME}/build.properties"/>
<property name="output.file" value="${FLEX_HOME}/frameworks/libs/textLayout.swc"/>
<property name="output.docs" value="${FLEX_HOME}/tempDoc"/>
<property name="flexTasks.location" value="${FLEX_HOME}/lib/flexTasks.jar"/>
<property name="project.uri" value="library://ns.adobe.com/flashx/textLayout"/>
<available file="${FLEX_HOME}/../flex-tlf/textLayout"
type="dir"
property="TLF_HOME"
value="${FLEX_HOME}/../flex-tlf" />
<available file="${FLEX_HOME}/../tlf/textLayout"
type="dir"
property="TLF_HOME"
value="${FLEX_HOME}/../tlf" />
<available file="src"
type="dir"
property="src.folder.exists"/>
<available file="src"
type="dir"
property="TLF_HOME"
value="${FLEX_HOME}/frameworks/projects" />
<!-- We use abbreviated token names here as, the 'release'
and 'debug' tokens conflict with those specified in
build.properties
-->
<property name="dbg" value="false"/>
<property name="rel" value="true"/>
<macrodef name="bundle">
<attribute name="locale"/>
<sequential>
<echo message="Compiling frameworks/locale/@{locale}/textLayout_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}/textLayout_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}" />
<!-- this is the directory the bundles dir is in -->
<arg value="+srcdir=${basedir}" />
</compc>
</sequential>
</macrodef>
<macrodef name="fat-swc">
<attribute name="locale"/>
<sequential>
<echo message="creating 'fat-swc' in textLayout_rb.swc for @{locale}"/>
<mkdir dir="bundles/@{locale}/docs" />
<zip destfile="${FLEX_HOME}/frameworks/locale/@{locale}/textLayout_rb.swc" update="true">
<zipfileset dir="bundles/@{locale}/docs" prefix="docs">
<include name="*.*"/>
<exclude name="ASDoc_Config.xml"/>
<exclude name="overviews.xml"/>
</zipfileset>
</zip>
</sequential>
</macrodef>
<macrodef name="bundle-clean">
<attribute name="locale"/>
<sequential>
<delete failonerror="false">
<fileset dir="${FLEX_HOME}/frameworks/locale">
<include name="@{locale}/textLayout_rb.swc"/>
<include name="@{locale}/textLayout_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>
<target name="main" depends="check-tlf-home,clean,compile,compile.external" description="Clean build of textLayout.swc">
<bundle locale="${locale}"/>
</target>
<target name="check-tlf-home" unless="TLF_HOME"
description="Check TLF_HOME is a directory.">
<echo message="TLF_HOME is ${env.TLF_HOME}"/>
<available file="${env.TLF_HOME}"
type="dir"
property="TLF_HOME"
value="${env.TLF_HOME}"/>
<fail message="TLF_HOME must be set correctly for a release build"
unless="TLF_HOME"/>
</target>
<target name="other.locales" depends="bundles" description="Build other locale SWCs"/>
<!-- This is a private target for building automation_rb.swc for various locales. -->
<!-- The targets below set the 'locale' parameter -->
<target name="bundles">
<!-- these languages do not have localized docs-->
<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="en_US"><!-- American English resources -->
<run.fat.swc>
<fat-swc locale="en_US"/>
</run.fat.swc>
</bundler>
<bundler locale="el_GR"/><!-- Greek Language resources -->
<bundler locale="en_AU"/><!-- Australian resources -->
<bundler locale="en_GB"/><!-- United Kingdom resources -->
<bundler locale="en_CA"/><!-- Canadian resources -->
<bundler locale="es_ES"/><!-- Spanish resources -->
<bundler locale="fi_FI"/><!-- Finnish 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 -->
</target>
<target name="clean" depends="check-tlf-home,bundles-clean,clean-external" description="Deletes the combined swc">
<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="textLayout.swc"/>
<include name="combined_link.xml"/>
</fileset>
</delete>
</target>
<target name="bundles-clean">
<delete failonerror="false">
<fileset dir="${FLEX_HOME}/frameworks/locale">
<include name="*/textLayout_rb.swc"/>
<include name="*/textLayout_rb.swc.incr"/>
</fileset>
</delete>
</target>
<target name="compile" description="Compiles textLayout.swc" if="src.folder.exists">
<taskdef resource="flexTasks.tasks" classpath="${flexTasks.location}"/>
<compc fork="true"
output="${output.file}">
<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}" />
<!--<arg value="+source.dir=${tlf.branch}" />-->
<define name="CONFIG::debug" value="${dbg}"/>
<define name="CONFIG::release" value="${rel}"/>
</compc>
</target>
<target name="compile.external" description="Compile textLayout.swc in flex-tlf repo" unless="src.folder.exists">
<ant dir="${TLF_HOME}" target="textLayout_flex"/>
<copy file="${TLF_HOME}/bin/textLayout.swc" toDir="${FLEX_HOME}/frameworks/libs" />
</target>
<target name="clean-external" description="clean in flex-tlf repo" unless="src.folder.exists">
<echo message="cleaning ${TLF_HOME}" />
<ant dir="${TLF_HOME}" target="clean"/>
</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="doc" depends="clean-temp-docs" description="updates textLayout.swc with asdoc xml">
<available file="${FLEX_HOME}/frameworks/locale/en_US/textLayout_rb.swc" property="resource.exists"/>
<fail message="${FLEX_HOME}/frameworks/locale/en_US/textLayout_rb.swc does not exist." unless="resource.exists"/>
<!-- 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="${TLF_HOME}/textLayout/src"/>
<compiler.show-actionscript-warnings>false</compiler.show-actionscript-warnings>
<doc-classes class="flashx.textLayout.CoreClasses"/>
<doc-classes class="flashx.textLayout.EditClasses"/>
<doc-classes class="flashx.textLayout.ConversionClasses"/>
<doc-namespaces uri="library://ns.adobe.com/flashx/textLayout"/>
<namespace uri="library://ns.adobe.com/flashx/textLayout" manifest="${TLF_HOME}/textLayout/manifest.xml"/>
<jvmarg line="${asdoc.jvm.args}"/>
<static-link-runtime-shared-libraries/>
<define name="CONFIG::debug" value="${dbg}"/>
<define name="CONFIG::release" value="${rel}"/>
</asdoc>
<!-- updates textLayout_rb.swc with asdoc xml -->
<zip destfile="${FLEX_HOME}/frameworks/locale/en_US/textLayout_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>
</project>