blob: 2e2a6e03a623f164c95f7793b830d7e67484b8e9 [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="mustella" default="main" basedir=".">
<property name="ROYALE_HOME" location=".."/>
<property file="${ROYALE_HOME}/env.properties"/>
<property environment="env"/>
<property file="${ROYALE_HOME}/build.properties"/>
<property name="ROYALE_HOME" value="${ROYALE_HOME}"/>
<property name="target.name" value="${ant.project.name}.swc" />
<target name="main" depends="clean,check-compiler,compile,compile-js" description="Full build of ${ant.project.name}.swc">
</target>
<target name="compile-js" unless="env.AIR_HOME">
<echo message="Compiling ${ant.project.name}.swc"/>
<echo message="ROYALE_HOME: ${ROYALE_HOME}"/>
<echo message="ROYALE_COMPILER_HOME: ${ROYALE_COMPILER_HOME}"/>
<java jar="${ROYALE_COMPILER_HOME}/lib/compc.jar" fork="true" >
<jvmarg value="-Xmx384m" />
<jvmarg value="-Dsun.io.useCanonCaches=false" />
<jvmarg value="-Droyalelib=${ROYALE_HOME}/frameworks" />
<arg value="+royalelib=${ROYALE_HOME}/frameworks" />
<arg value="+playerglobal.version=${playerglobal.version}" />
<arg value="+env.PLAYERGLOBAL_HOME=${env.PLAYERGLOBAL_HOME}" />
<arg value="-compiler.strict-xml=true" />
<arg value="-compiler.targets=SWF,JSRoyale" />
<arg value="-output=${basedir}/${target.name}" />
<arg value="-load-config=${ROYALE_HOME}/frameworks/js-config.xml" />
<arg value="-load-config+=${basedir}/src/main/config/compile-js-config.xml" />
<arg value="-js-load-config=${ROYALE_HOME}/frameworks/js-config.xml" />
<arg value="-js-load-config+=${basedir}/src/main/config/compile-js-config.xml" />
</java>
</target>
<target name="clean">
<delete file="${target.name}" failonerror="false" />
</target>
<target name="compile" description="Compiles .as files into .swc" if="env.AIR_HOME">
<echo message="Compiling ${ant.project.name}.swc"/>
<echo message="ROYALE_HOME: ${ROYALE_HOME}"/>
<echo message="ROYALE_COMPILER_HOME: ${ROYALE_COMPILER_HOME}"/>
<java jar="${ROYALE_COMPILER_HOME}/lib/compc.jar" fork="true" >
<jvmarg value="-Xmx384m" />
<jvmarg value="-Dsun.io.useCanonCaches=false" />
<jvmarg value="-Droyalelib=${ROYALE_HOME}/frameworks" />
<arg value="+royalelib=${ROYALE_HOME}/frameworks" />
<arg value="+playerglobal.version=${playerglobal.version}" />
<arg value="+env.PLAYERGLOBAL_HOME=${env.PLAYERGLOBAL_HOME}" />
<arg value="+env.AIR_HOME=${env.AIR_HOME}" />
<arg value="-compiler.strict-xml=true" />
<arg value="-compiler.targets=SWF,JSRoyale" />
<arg value="-output=${basedir}/${target.name}" />
<arg value="-load-config=${basedir}/src/main/config/compile-swf-config.xml" />
<arg value="-js-load-config=${ROYALE_HOME}/frameworks/js-config.xml" />
<arg value="-js-load-config+=${basedir}/src/main/config/compile-js-config.xml" />
</java>
</target>
<target name="check-compiler" depends="check-compiler-home">
<path id="lib.path">
<fileset dir="${ROYALE_COMPILER_HOME}/lib" includes="compiler-royaleTasks.jar"/>
</path>
<taskdef resource="flexTasks.tasks" classpathref="lib.path"/>
</target>
<target name="check-compiler-home"
description="Set ROYALE_COMPILER_HOME to point at the cross-compiler.">
<available file="${ROYALE_HOME}/js/lib/jsc.jar"
type="file"
property="ROYALE_COMPILER_HOME"
value="${ROYALE_HOME}/js"/>
<fail message="ROYALE_COMPILER_HOME must be set to a folder with a lib sub-folder containing jsc.jar such as the compiler-jx folder in royale-compiler repo or the js folder of a Royale SDK"
unless="ROYALE_COMPILER_HOME"/>
</target>
</project>