|
| 1 | +<?xml version="1.0"?> |
| 2 | +<!-- |
| 3 | +
|
| 4 | + Licensed to the Apache Software Foundation (ASF) under one or more |
| 5 | + contributor license agreements. See the NOTICE file distributed with |
| 6 | + this work for additional information regarding copyright ownership. |
| 7 | + The ASF licenses this file to You under the Apache License, Version 2.0 |
| 8 | + (the "License"); you may not use this file except in compliance with |
| 9 | + the License. You may obtain a copy of the License at |
| 10 | +
|
| 11 | + http://www.apache.org/licenses/LICENSE-2.0 |
| 12 | +
|
| 13 | + Unless required by applicable law or agreed to in writing, software |
| 14 | + distributed under the License is distributed on an "AS IS" BASIS, |
| 15 | + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| 16 | + See the License for the specific language governing permissions and |
| 17 | + limitations under the License. |
| 18 | +
|
| 19 | +--> |
| 20 | + |
| 21 | + |
| 22 | +<project name="Jewel-Light-NoFlat-Emphasized-Emerald-Theme" default="main" basedir="."> |
| 23 | + <property name="ROYALE_HOME" location="../../.."/> |
| 24 | + |
| 25 | + <property file="${ROYALE_HOME}/env.properties"/> |
| 26 | + <property environment="env"/> |
| 27 | + <property file="${ROYALE_HOME}/build.properties"/> |
| 28 | + <property name="ROYALE_HOME" value="${ROYALE_HOME}"/> |
| 29 | + |
| 30 | + <property name="target.name" value="${ant.project.name}.swc" /> |
| 31 | + |
| 32 | + <!-- doesn't contain compiled files so only need to compile JS version --> |
| 33 | + <target name="main" depends="clean,check-compiler,compile,compile-js,copy-swc,test" description="Full build of ${ant.project.name}.swc"> |
| 34 | + </target> |
| 35 | + |
| 36 | + <target name="compile-js"> |
| 37 | + <!-- doesn't contain compiled files so only need to compile JS version |
| 38 | + <ant dir="${ROYALE_HOME}/frameworks/js/projects/${ant.project.name}JS/" inheritAll="false" > |
| 39 | + <property name="ROYALE_SWF_COMPILER_HOME" value="${ROYALE_SWF_COMPILER_HOME}"/> |
| 40 | + <property name="ROYALE_COMPILER_HOME" value="${ROYALE_COMPILER_HOME}"/> |
| 41 | + <property name="ROYALE_HOME" value="${ROYALE_HOME}"/> |
| 42 | + </ant> |
| 43 | + --> |
| 44 | + </target> |
| 45 | + |
| 46 | + <target name="copy-swc" if="env.AIR_HOME"> |
| 47 | + <copy file="${basedir}/target/${target.name}" tofile="${ROYALE_HOME}/frameworks/libs/${target.name}" /> |
| 48 | + </target> |
| 49 | + |
| 50 | + <target name="check-for-tests" > |
| 51 | + <condition property="skip-tests" > |
| 52 | + <not> |
| 53 | + <available file="${basedir}/src/test/royale/build.xml" /> |
| 54 | + </not> |
| 55 | + </condition> |
| 56 | + </target> |
| 57 | + |
| 58 | + <target name="test" depends="check-for-tests" unless="skip-tests"> |
| 59 | + <ant dir="src/test/royale" /> |
| 60 | + </target> |
| 61 | + |
| 62 | + <target name="clean"> |
| 63 | + <delete failonerror="false"> |
| 64 | + <fileset dir="${ROYALE_HOME}/frameworks/libs"> |
| 65 | + <include name="${target.name}"/> |
| 66 | + </fileset> |
| 67 | + </delete> |
| 68 | + <delete failonerror="false" includeemptydirs="true"> |
| 69 | + <fileset dir="${basedir}/target"> |
| 70 | + <include name="**/**"/> |
| 71 | + </fileset> |
| 72 | + </delete> |
| 73 | + <antcall target="clean-tests" /> |
| 74 | + </target> |
| 75 | + |
| 76 | + <target name="clean-tests" depends="check-for-tests" unless="skip-tests"> |
| 77 | + <ant dir="src/test/royale" target="clean"/> |
| 78 | + </target> |
| 79 | + |
| 80 | + <target name="compile" description="Compiles .as files into .swc" if="env.AIR_HOME"> |
| 81 | + <echo message="Compiling libs/${ant.project.name}.swc"/> |
| 82 | + <echo message="ROYALE_HOME: ${ROYALE_HOME}"/> |
| 83 | + <echo message="ROYALE_SWF_COMPILER_HOME: ${ROYALE_SWF_COMPILER_HOME}"/> |
| 84 | + <echo message="ROYALE_COMPILER_HOME: ${ROYALE_COMPILER_HOME}"/> |
| 85 | + |
| 86 | + <java jar="${ROYALE_COMPILER_HOME}/lib/compc.jar" fork="true" > |
| 87 | + <jvmarg value="-Xmx384m" /> |
| 88 | + <jvmarg value="-Dsun.io.useCanonCaches=false" /> |
| 89 | + <jvmarg value="-Droyalelib=${ROYALE_HOME}/frameworks" /> |
| 90 | + <arg value="+royalelib=${ROYALE_HOME}/frameworks" /> |
| 91 | + <arg value="+playerglobal.version=${playerglobal.version}" /> |
| 92 | + <arg value="+env.AIR_HOME=${env.AIR_HOME}" /> |
| 93 | + <arg value="-compiler.strict-xml=true" /> |
| 94 | + <arg value="-compiler.targets=SWF,JSRoyale" /> |
| 95 | + <arg value="-output=${basedir}/target/${target.name}" /> |
| 96 | + <arg value="-load-config=${basedir}/src/main/config/compile-swf-config.xml" /> |
| 97 | + <arg value="-js-load-config=${ROYALE_HOME}/frameworks/js-config.xml" /> |
| 98 | + <arg value="-js-load-config+=${basedir}/../../js/themes/${ant.project.name}JS/src/main/config/compile-js-config.xml" /> |
| 99 | + </java> |
| 100 | + </target> |
| 101 | + |
| 102 | + <target name="check-compiler" depends="check-compiler-home,check-transpiler-home"> |
| 103 | + <path id="lib.path"> |
| 104 | + <fileset dir="${ROYALE_COMPILER_HOME}/lib" includes="compiler-royaleTasks.jar"/> |
| 105 | + </path> |
| 106 | + <taskdef resource="flexTasks.tasks" classpathref="lib.path"/> |
| 107 | + </target> |
| 108 | + |
| 109 | + <target name="check-compiler-home" |
| 110 | + description="Set ROYALE_SWF_COMPILER_HOME to point at the compiler."> |
| 111 | + |
| 112 | + <available file="${ROYALE_HOME}/lib/compiler-mxmlc.jar" |
| 113 | + type="file" |
| 114 | + property="ROYALE_SWF_COMPILER_HOME" |
| 115 | + value="${ROYALE_HOME}"/> |
| 116 | + |
| 117 | + <fail message="ROYALE_SWF_COMPILER_HOME must be set to a folder with a lib sub-folder containing compiler-mxmlc.jar such as the compiler folder in royale-compiler repo or the root of a Royale SDK" |
| 118 | + unless="ROYALE_SWF_COMPILER_HOME"/> |
| 119 | + </target> |
| 120 | + |
| 121 | + <target name="check-transpiler-home" |
| 122 | + description="Set ROYALE_COMPILER_HOME to point at the cross-compiler."> |
| 123 | + |
| 124 | + <available file="${ROYALE_HOME}/js/lib/jsc.jar" |
| 125 | + type="file" |
| 126 | + property="ROYALE_COMPILER_HOME" |
| 127 | + value="${ROYALE_HOME}/js"/> |
| 128 | + |
| 129 | + <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" |
| 130 | + unless="ROYALE_COMPILER_HOME"/> |
| 131 | + </target> |
| 132 | + |
| 133 | +</project> |
0 commit comments