blob: d0be172b786ba778902b93cab0424c2a34e004d4 [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 default="test" basedir=".">
<property file="${basedir}/env.properties"/>
<property environment="env"/>
<property file="${basedir}/local.properties"/>
<property file="${basedir}/build.properties"/>
<condition property="FLEX_HOME" value="${env.FLEX_HOME}">
<isset property="env.FLEX_HOME" />
</condition>
<condition property="AIR_HOME" value="${env.AIR_HOME}">
<isset property="env.AIR_HOME" />
</condition>
<condition property="PLAYERGLOBAL_HOME" value="${env.PLAYERGLOBAL_HOME}">
<isset property="env.PLAYERGLOBAL_HOME" />
</condition>
<!-- SDK properties -->
<property name="FLEX_HOME" value="C:/air3_beta2"/>
<property name="AIR_HOME" value="C:/air3_beta2"/>
<property name="MXMLC.JAR" value="${FLEX_HOME}/lib/mxmlc.jar"/>
<property name="COMPC.JAR" value="${FLEX_HOME}/lib/compc.jar"/>
<property name="ADL" value="${AIR_HOME}/bin/adl.exe"/>
<property name="ADT.JAR" value="${AIR_HOME}/lib/adt.jar"/>
<property name="playerglobal.version" value="15.0" />
<property name="OUTPUT_DIR" value="libs"/>
<macrodef name="create-rsl">
<attribute name="rsl-dir"/>
<attribute name="swc-dir"/>
<attribute name="swc-name"/>
<sequential>
<mkdir dir="@{rsl-dir}"/>
<delete>
<fileset dir="@{rsl-dir}">
<include name="@{swc-name}.swc"/>
</fileset>
</delete>
<unzip src="@{swc-dir}/@{swc-name}.swc" dest="@{rsl-dir}" overwrite="true">
<patternset>
<include name="library.swf"/>
</patternset>
<mapper type="glob" from="library.swf" to="@{swc-name}.library.swf"/>
</unzip>
<exec executable="${FLEX_HOME}/bin/optimizer.bat"
output="${OUTPUT_DIR}/flex-optimizer-@{swc-name}.log" append="true" osfamily="windows">
<arg value="-input=@{rsl-dir}/@{swc-name}.library.swf"/>
<arg value="-output=@{rsl-dir}/@{swc-name}.swf"/>
</exec>
<exec executable="${FLEX_HOME}/bin//digest.bat"
output="${OUTPUT_DIR}/flex-optimizer-@{swc-name}.log" append="true" osfamily="windows">
<arg value="-digest.rsl-file=@{rsl-dir}/@{swc-name}.swf"/>
<arg value="-digest.swc-path=@{swc-dir}/@{swc-name}.swc"/>
</exec>
<delete file="@{rsl-dir}/@{swc-name}.library.swf"/>
</sequential>
</macrodef>
<!-- To remove along with the condition check in the target "extract-rsls" as soon as "optimize" and "digest"
will be setup and tested on Mac and Unix based OSes, see the MacroDef "create-rsl" -->
<condition property="isWindows">
<os family="windows" />
</condition>
<target name="extract-rsls" if="isWindows">
<create-rsl rsl-dir="${OUTPUT_DIR}/rsls" swc-dir="${OUTPUT_DIR}"
swc-name="ApacheFlexLinguisticUtils"/>
<create-rsl rsl-dir="${OUTPUT_DIR}/rsls" swc-dir="${OUTPUT_DIR}"
swc-name="ApacheFlexSpellingEngine"/>
<create-rsl rsl-dir="${OUTPUT_DIR}/rsls" swc-dir="${OUTPUT_DIR}"
swc-name="ApacheFlexSpellingFramework"/>
<create-rsl rsl-dir="${OUTPUT_DIR}/rsls" swc-dir="${OUTPUT_DIR}"
swc-name="ApacheFlexSpellingUI"/>
<create-rsl rsl-dir="${OUTPUT_DIR}/rsls" swc-dir="${OUTPUT_DIR}"
swc-name="ApacheFlexSpellingUIAPI"/>
<create-rsl rsl-dir="${OUTPUT_DIR}/rsls" swc-dir="${OUTPUT_DIR}"
swc-name="ApacheFlexSpellingUITLF"/>
<create-rsl rsl-dir="${OUTPUT_DIR}/rsls" swc-dir="${OUTPUT_DIR}"
swc-name="ApacheFlexSpellingUIEx"/>
</target>
<target name="init" depends="clean">
<mkdir dir="${OUTPUT_DIR}"/>
</target>
<target name="compilelinguistics" depends="init">
<java jar="${COMPC.JAR}" fork="true" failonerror="true">
<arg value="-swf-version"/>
<arg value="25"/>
<arg value="+flexlib=${FLEX_HOME}/frameworks"/>
<arg value="-source-path"/>
<arg value="LinguisticUtils/src"/>
<arg value="-include-sources"/>
<arg value="LinguisticUtils/src"/>
<arg value="-output"/>
<arg value="${OUTPUT_DIR}/ApacheFlexLinguisticUtils.swc"/>
</java>
</target>
<target name="compileengine" depends="init">
<java jar="${COMPC.JAR}" fork="true" failonerror="true">
<arg value="-swf-version"/>
<arg value="25"/>
<arg value="+flexlib=${FLEX_HOME}/frameworks"/>
<arg value="-source-path"/>
<arg value="SpellingEngine/src"/>
<arg value="-include-sources"/>
<arg value="SpellingEngine/src"/>
<arg value="-output"/>
<arg value="${OUTPUT_DIR}/ApacheFlexSpellingEngine.swc"/>
</java>
</target>
<target name="compileframework" depends="init">
<java jar="${COMPC.JAR}" fork="true" failonerror="true">
<arg value="-swf-version"/>
<arg value="25"/>
<arg value="+flexlib=${FLEX_HOME}/frameworks"/>
<arg value="-source-path"/>
<arg value="SpellingFramework/src"/>
<arg value="-include-sources"/>
<arg value="SpellingFramework/src"/>
<arg value="-external-library-path"/>
<arg value="${FLEX_HOME}/frameworks/libs/framework.swc"/>
<arg value="-external-library-path"/>
<arg value="${FLEX_HOME}/frameworks/libs/mx/mx.swc"/>
<arg value="-external-library-path"/>
<arg value="${FLEX_HOME}/frameworks/libs/spark.swc"/>
<arg value="-external-library-path"/>
<arg value="${FLEX_HOME}/frameworks/libs/textLayout.swc"/>
<arg value="-external-library-path"/>
<arg value="${PLAYERGLOBAL_HOME}/${playerglobal.version}/playerglobal.swc"/>
<arg value="-external-library-path"/>
<arg value="${OUTPUT_DIR}/ApacheFlexLinguisticUtils.swc"/>
<arg value="-external-library-path"/>
<arg value="${OUTPUT_DIR}/ApacheFlexSpellingEngine.swc"/>
<arg value="-output"/>
<arg value="${OUTPUT_DIR}/ApacheFlexSpellingFramework.swc"/>
</java>
</target>
<target name="compileui" depends="init">
<java jar="${COMPC.JAR}" fork="true" failonerror="true">
<arg value="-swf-version"/>
<arg value="25"/>
<arg value="+flexlib=${FLEX_HOME}/frameworks"/>
<arg value="-source-path"/>
<arg value="SpellingUI/src"/>
<arg value="-include-sources"/>
<arg value="SpellingUI/src"/>
<arg value="-external-library-path"/>
<arg value="${FLEX_HOME}/frameworks/libs/framework.swc"/>
<arg value="-external-library-path"/>
<arg value="${FLEX_HOME}/frameworks/libs/mx/mx.swc"/>
<arg value="-external-library-path"/>
<arg value="${FLEX_HOME}/frameworks/libs/spark.swc"/>
<arg value="-external-library-path"/>
<arg value="${FLEX_HOME}/frameworks/libs/textLayout.swc"/>
<arg value="-external-library-path"/>
<arg value="${PLAYERGLOBAL_HOME}/${playerglobal.version}/playerglobal.swc"/>
<arg value="-external-library-path"/>
<arg value="${OUTPUT_DIR}/ApacheFlexLinguisticUtils.swc"/>
<arg value="-external-library-path"/>
<arg value="${OUTPUT_DIR}/ApacheFlexSpellingEngine.swc"/>
<arg value="-external-library-path"/>
<arg value="${OUTPUT_DIR}/ApacheFlexSpellingFramework.swc"/>
<arg value="-output"/>
<arg value="${OUTPUT_DIR}/ApacheFlexSpellingUI.swc"/>
</java>
</target>
<target name="compileuiapi" depends="init">
<java jar="${COMPC.JAR}" fork="true" failonerror="true">
<arg value="-swf-version"/>
<arg value="25"/>
<arg value="+flexlib=${FLEX_HOME}/frameworks"/>
<arg value="-source-path"/>
<arg value="SpellingUIAPI/src"/>
<arg value="-include-sources"/>
<arg value="SpellingUIAPI/src"/>
<arg value="-external-library-path"/>
<arg value="${FLEX_HOME}/frameworks/libs/framework.swc"/>
<arg value="-external-library-path"/>
<arg value="${FLEX_HOME}/frameworks/libs/mx/mx.swc"/>
<arg value="-external-library-path"/>
<arg value="${FLEX_HOME}/frameworks/libs/spark.swc"/>
<arg value="-external-library-path"/>
<arg value="${FLEX_HOME}/frameworks/libs/textLayout.swc"/>
<arg value="-external-library-path"/>
<arg value="${PLAYERGLOBAL_HOME}/${playerglobal.version}/playerglobal.swc"/>
<arg value="-external-library-path"/>
<arg value="${OUTPUT_DIR}/ApacheFlexLinguisticUtils.swc"/>
<arg value="-external-library-path"/>
<arg value="${OUTPUT_DIR}/ApacheFlexSpellingEngine.swc"/>
<arg value="-external-library-path"/>
<arg value="${OUTPUT_DIR}/ApacheFlexSpellingFramework.swc"/>
<arg value="-output"/>
<arg value="${OUTPUT_DIR}/ApacheFlexSpellingUIAPI.swc"/>
</java>
</target>
<target name="compileuitlf" depends="init">
<java jar="${COMPC.JAR}" fork="true" failonerror="true">
<arg value="-swf-version"/>
<arg value="25"/>
<arg value="+flexlib=${FLEX_HOME}/frameworks"/>
<arg value="-source-path"/>
<arg value="SpellingUITLF/src"/>
<arg value="-include-sources"/>
<arg value="SpellingUITLF/src"/>
<arg value="-external-library-path"/>
<arg value="${FLEX_HOME}/frameworks/libs/textLayout.swc"/>
<arg value="-external-library-path"/>
<arg value="${PLAYERGLOBAL_HOME}/${playerglobal.version}/playerglobal.swc"/>
<arg value="-external-library-path"/>
<arg value="${OUTPUT_DIR}/ApacheFlexLinguisticUtils.swc"/>
<arg value="-external-library-path"/>
<arg value="${OUTPUT_DIR}/ApacheFlexSpellingEngine.swc"/>
<arg value="-external-library-path"/>
<arg value="${OUTPUT_DIR}/ApacheFlexSpellingFramework.swc"/>
<arg value="-external-library-path"/>
<arg value="${OUTPUT_DIR}/ApacheFlexSpellingUI.swc"/>
<arg value="-output"/>
<arg value="${OUTPUT_DIR}/ApacheFlexSpellingUITLF.swc"/>
</java>
</target>
<target name="compileuiex" depends="init">
<java jar="${COMPC.JAR}" fork="true" failonerror="true">
<arg value="-swf-version"/>
<arg value="25"/>
<arg value="+flexlib=${FLEX_HOME}/frameworks"/>
<arg value="-source-path"/>
<arg value="SpellingUIEx/src"/>
<arg value="-include-sources"/>
<arg value="SpellingUIEx/src"/>
<arg value="-external-library-path"/>
<arg value="${FLEX_HOME}/frameworks/libs/framework.swc"/>
<arg value="-external-library-path"/>
<arg value="${FLEX_HOME}/frameworks/libs/mx/mx.swc"/>
<arg value="-external-library-path"/>
<arg value="${FLEX_HOME}/frameworks/libs/spark.swc"/>
<arg value="-external-library-path"/>
<arg value="${FLEX_HOME}/frameworks/libs/textLayout.swc"/>
<arg value="-external-library-path"/>
<arg value="${PLAYERGLOBAL_HOME}/${playerglobal.version}/playerglobal.swc"/>
<arg value="-external-library-path"/>
<arg value="${OUTPUT_DIR}/ApacheFlexLinguisticUtils.swc"/>
<arg value="-external-library-path"/>
<arg value="${OUTPUT_DIR}/ApacheFlexSpellingEngine.swc"/>
<arg value="-external-library-path"/>
<arg value="${OUTPUT_DIR}/ApacheFlexSpellingFramework.swc"/>
<arg value="-output"/>
<arg value="${OUTPUT_DIR}/ApacheFlexSpellingUIEx.swc"/>
</java>
</target>
<target name="test" depends="compilelinguistics, compileengine, compileframework, compileui, compileuiapi, compileuitlf, compileuiex, extract-rsls"/>
<target name="clean" description="clean up">
<delete dir="${OUTPUT_DIR}"/>
</target>
<target name="unit-tests" description="Runs the FlexUnit tests for this project">
<ant dir="SpellingUIEx" target="unit-tests" />
<ant dir="SpellingUI" target="unit-tests" />
</target>
</project>