UNPKG

@apache-royale/royale-js

Version:

Apache Royale (formerly FlexJS)

1,084 lines (939 loc) 97.2 kB
<?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="asjs" default="main" basedir="."> <property name="ROYALE_HOME" location="${basedir}"/> <!-- Required for OSX 10.6 / Snow Leopard Performance. --> <!-- Java 7 on Mac requires OSX 10.7.3 or higher and is 64-bit only --> <!-- local.d32 is set/used in build.properties so this needs to be done first. --> <condition property="local.d32" value="-d32"> <and> <os family="windows"/> <equals arg1="${sun.arch.data.model}" arg2="64"/> <equals arg1="${os.arch}" arg2="x86_64"/> <equals arg1="${ant.java.version}" arg2="1.6"/> </and> </condition> <property file="${ROYALE_HOME}/env.properties"/> <property environment="env"/> <property file="${ROYALE_HOME}/local.properties"/> <property file="${ROYALE_HOME}/build.properties"/> <condition property="swf.distribution"> <isset property="env.AIR_HOME" /> </condition> <condition property="AIR_HOME" value="${env.AIR_HOME}"> <isset property="env.AIR_HOME" /> </condition> <property name="AIR_HOME" value="${ROYALE_HOME}"/> <condition property="PLAYERGLOBAL_HOME" value="${env.PLAYERGLOBAL_HOME}"> <isset property="env.PLAYERGLOBAL_HOME" /> </condition> <property name="PLAYERGLOBAL_HOME" value="${ROYALE_HOME}/frameworks/libs/player"/> <property name="debug" value="true"/> <property name="strict" value="true"/> <property name="javac.src" value="11"/> <property name="kit.prefix" value="apache-royale-${release.version}"/> <property name="source.kit" value="${kit.prefix}-src"/> <condition property="binary.kit" value="${kit.prefix}-bin-js"> <not> <isset property="swf.distribution" /> </not> </condition> <property name="binary.kit" value="${kit.prefix}-bin-js-swf"/> <property name="binary-js.kit" value="${kit.prefix}-bin-js"/> <property name="staging-dir" value="${basedir}/temp/royale-asjs" /> <condition property="isMac" value="mac"> <os family="mac" /> </condition> <condition property="isWindows" value="windows"> <os family="windows" /> </condition> <condition property="isLinux" value="linux"> <and> <os family="unix" /> <not> <isset property="isMac" /> </not> </and> </condition> <!-- turn off SWF portion of checkintest if no swf.distribution --> <condition property="runtime.setup"> <not> <isset property="swf.distribution" /> </not> </condition> <condition property="mxmlc.jar.exists"> <not> <isset property="swf.distribution" /> </not> </condition> <!-- Optional jars but should be in place for a real release build. For <grep> put AntelopeTasks_*.jar in this path. See version-update. For <rat> apache-rat-0.8.jar and apache-rat-tasks-0.8.jar should be in classpath. See rat-check. --> <path id="anttask.classpath"> <fileset dir="${env.ANT_HOME}/lib"> <include name="**/AntelopeTasks_*.jar"/> <include name="**/apache-rat*.jar"/> </fileset> <fileset dir="${user.home}"> <include name=".ant/lib/**/AntelopeTasks_*.jar"/> <include name=".ant/lib/**/apache-rat*.jar"/> </fileset> </path> <!-- Notes: If you're running the main target, then there is no need to call clean first. Each of the main targets for the modules will call clean themselves before proceeding. --> <target name="main" depends="check-if-ide,prebuild,frameworks,post-build,last-message-if-airsdk" description="Full build" unless="airsdk.found"> <tstamp> <format property="build.datetime" pattern="MM/dd/yyyy hh:mm:ss aa" /> </tstamp> <echo>ant main target completed on ${build.datetime}</echo> </target> <target name="main-jenkins" depends="dump-config,prebuild,frameworks,post-build" description="Full build"> <tstamp> <format property="build.datetime" pattern="MM/dd/yyyy hh:mm:ss aa" /> </tstamp> <echo>ant main target completed on ${build.datetime}</echo> </target> <target name="dump-config" unless="airsdk.found" > <property name="is.jenkins" value="true" /> <echo>env.USERNAME is: ${env.USERNAME}</echo> <condition property="FLASHLOG" value="c:/Documents and Settings/${env.USERNAME}/Application Data/Macromedia/Flash Player/Logs/flashlog.txt"> <available file="c:/Documents and Settings/${env.USERNAME}/Application Data/Macromedia/Flash Player/Logs/flashlog.txt" type="file"/> </condition> <condition property="FLASHLOG" value="c:/Users/${env.USERNAME}/AppData/Roaming/Macromedia/Flash Player/Logs/flashlog.txt"> <available file="c:/Users/${env.USERNAME}/AppData/Roaming/Macromedia/Flash Player/Logs/flashlog.txt" type="file"/> </condition> <!-- Check the system user profile --> <condition property="FLASHLOG" value="C:/Windows/system32/config/systemprofile/AppData/Roaming/Macromedia/Flash Player/Logs/flashlog.txt"> <available file="C:/Windows/system32/config/systemprofile/AppData/Roaming/Macromedia/Flash Player/Logs/flashlog.txt" type="file"/> </condition> <antcall target="copy-flashlog"/> </target> <target name="copy-flashlog" if="FLASHLOG"> <echo>copying last flashlog.txt from ${FLASHLOG}</echo> <copy file="${FLASHLOG}" tofile="${basedir}/lastflashlog.txt" /> </target> <target name="block-flat-fonts"> <property name="flat.donot.ask" value="true" /> </target> <target name="release" depends="block-flat-fonts,check-compiler-home,check-typedefs-home,source-release,binary-release,rat-check" description="Creates source and binary kits for Apache Royale."/> <target name="release-jenkins" depends="check-compile-env,check-runtime-env,check-compiler-home,source-release,binary-release-jenkins,rat-check" description="Creates source and binary kits for Apache Royale."/> <target name="source-release" depends="super-clean,create-description,create-config,source-package" description="Packages the source release kit which is the official Apache release."/> <target name="binary-release" depends="setup-binary-release,set.base.folder,build-all,main,sample-themes,checkintests,check-goog-home,binary-package,jsonly-package" description="Builds and packages the binary kit which is provided as a convenience."/> <target name="binary-release-jenkins" depends="setup-binary-release,main-jenkins,sample-themes,binary-package" description="Builds and packages the binary kit which is provided as a convenience."/> <target name="source-release-noclean" depends="create-description,create-config,source-package" description="Packages the source release kit which is the official Apache release."/> <target name="binary-release-noclean" depends="main,sample-themes,checkintests,binary-package" description="Builds and packages the binary kit which is provided as a convenience."/> <target name="doc-packages" depends="asdoc-package,javadocs" description="Build and package the asdocs for the framework clases and the javadocs."/> <target name="help"> <echo message="run ant -projecthelp to see the available targets"/> </target> <!-- To clean these you must call thirdparty-clean or super-clean to clean everything. clean does not remove these since they don't change often and the downloads take time. --> <target name="thirdparty-downloads" description="Downloads all the required thirdparty code." unless="airsdk.found"> <ant dir="${basedir}/frameworks" target="thirdparty-downloads"/> <condition property="env.GOOG_HOME" value="${basedir}/js/lib/google/closure-library"> <not> <isset property="env.GOOG_HOME" /> </not> </condition> <!-- <ant dir="${basedir}/frameworks/js" target="thirdparty-downloads"/> --> <!-- don't ask again about these since we just did if these weren't already set --> <property name="build.noprompt" value="set" /> <!-- this flag is used by frameworks/build.xml to prevent a second download --> <property name="no.thirdparty-downloads" value="set" /> </target> <target name="prebuild" depends="check-compile-env,thirdparty-downloads,create-description,copy-externs,copy-playerglobal,copy-airglobal,copy-compiler,create-config" description="Stuff that needs to be done before any builds." unless="airsdk.found"/> <target name="check-compile-env" depends="check-playerglobal-home,check-air-home,check-compiler-home" unless="airsdk.found" description="Check for the required environment variables for compilation."> <echo>OS: ${os.name} / ${os.version} / ${os.arch}</echo> <echo>VM: ${java.vm.name} / ${java.vm.version}</echo> <echo>Java: ${java.version}</echo> <echo>Ant: ${ant.version} Ant Java Version: ${ant.java.version}</echo> </target> <target name="check-playerglobal-home" if="env.PLAYERGLOBAL_HOME" description="Check PLAYERGLOBAL_HOME for both a directory and a swc file"> <echo message="PLAYERGLOBAL_HOME is ${env.PLAYERGLOBAL_HOME}"/> <echo message="playerglobal.version is ${playerglobal.version}"/> <available file="${env.PLAYERGLOBAL_HOME}" type="dir" property="PLAYERGLOBAL_HOME.set"/> <fail message="The environment variable PLAYERGLOBAL_HOME is not set to a directory" unless="PLAYERGLOBAL_HOME.set"/> <property name="playerglobal.swc" value="${env.PLAYERGLOBAL_HOME}/${playerglobal.version}/playerglobal.swc"/> <available file="${playerglobal.swc}" type="file" property="playerglobal.swc.exists"/> <fail message="The file ${playerglobal.swc} does not exist" unless="playerglobal.swc.exists"/> <echo message="playerglobal.swc is ${playerglobal.swc}"/> </target> <target name="check-air-home" if="env.AIR_HOME" description="Check that AIR_HOME is a directory"> <echo message="AIR_HOME is ${env.AIR_HOME}"/> <condition property="AIR_HOME.set"> <and> <length string="${env.AIR_HOME}" when="greater" length="0" /> <available file="${env.AIR_HOME}" type="dir"/> <!--available file="${env.AIR_HOME}/bin/adt" type="file"/--> </and> </condition> <fail message="The environment variable AIR_HOME must be set to the AIR SDK Kit directory" unless="AIR_HOME.set"/> </target> <target name="check-goog-home" unless="GOOG_HOME" description="Check that GOOG_HOME is a directory"> <echo message="GOOG_HOME is ${env.GOOG_HOME}"/> <available file="${env.GOOG_HOME}" type="dir" property="GOOG_HOME" value="${env.GOOG_HOME}" /> </target> <target name="check-compiler-home" unless="ROYALE_COMPILER_REPO" description="Check ROYALE_COMPILER_REPO is a directory."> <echo message="env.ROYALE_COMPILER_REPO is ${env.ROYALE_COMPILER_REPO}"/> <available file="${env.ROYALE_COMPILER_REPO}/compiler/lib/compiler-mxmlc.jar" type="file" property="ROYALE_COMPILER_REPO" value="${env.ROYALE_COMPILER_REPO}"/> <echo message="ROYALE_COMPILER_REPO is ${ROYALE_COMPILER_REPO}"/> <condition property="ROYALE_COMPILER_REPO" value="${basedir}/../royale-compiler"> <and> <available file="${basedir}/../royale-compiler/compiler/lib/compiler-mxmlc.jar" type="file" /> <not> <isset property="ROYALE_COMPILER_REPO" /> </not> </and> </condition> <echo message="ROYALE_COMPILER_REPO is ${ROYALE_COMPILER_REPO}"/> <fail message="ROYALE_COMPILER_REPO must be set to a folder with a compiler/lib sub-folder containing compiler-mxmlc.jar such as the top-level folder in royale-compiler repo" unless="ROYALE_COMPILER_REPO"/> </target> <target name="check-typedefs-home" unless="ROYALE_TYPEDEFS_HOME" description="Check ROYALE_TYPEDEFS_HOME is a directory."> <echo message="ROYALE_TYPEDEFS_HOME is ${env.ROYALE_TYPEDEFS_HOME}"/> <available file="${env.ROYALE_TYPEDEFS_HOME}/js/target/js.swc" type="file" property="ROYALE_TYPEDEFS_HOME" value="${env.ROYALE_TYPEDEFS_HOME}"/> <available file="${basedir}/../royale-typedefs/js/target/js.swc" type="file" property="ROYALE_TYPEDEFS_HOME" value="${basedir}/../royale-typedefs"/> <available file="${basedir}/js/target/js.swc" type="file" property="ROYALE_TYPEDEFS_HOME" value="${basedir}"/> <echo>basedir is ${basedir}</echo> <fail message="ROYALE_TYPEDEFS_HOME must be set to a folder containing js/target/js.swc such as the royale-typedefs repo" unless="ROYALE_TYPEDEFS_HOME"/> </target> <target name="swf-js-output-royale-description" if="env.PLAYERGLOBAL_HOME"> <echo file="${basedir}/royale-sdk-description.xml" append="true"> &lt;output-targets&gt; &lt;output-target name="js" version="Ecma5Strict" /&gt; &lt;output-target name="swf" version="AS3" AIR="${air.version}" Flash="${playerglobal.version}" /&gt; &lt;/output-targets&gt; &lt;/royale-sdk-description&gt; </echo> </target> <target name="js-output-royale-description" unless="env.PLAYERGLOBAL_HOME"> <echo file="${basedir}/royale-sdk-description.xml" append="true"> &lt;output-targets&gt; &lt;output-target name="js" version="Ecma5Strict" /&gt; &lt;/output-targets&gt; &lt;/royale-sdk-description&gt; </echo> </target> <target name="create-jsonly-description"> <tstamp> <format property="build.number.date" pattern="yyyyMMdd" /> </tstamp> <echo message="build.number is ${build.number.date}"/> <echo file="${basedir}/temp/royale-asjs/royale-sdk-description.xml">&lt;?xml version="1.0"?&gt; &lt;!-- 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. --&gt; &lt;royale-sdk-description&gt; &lt;name&gt;${release.name}&lt;/name&gt; &lt;version&gt;${release.version}&lt;/version&gt; &lt;build&gt;${build.number.date}&lt;/build&gt; &lt;output-targets&gt; &lt;output-target name="js" version="Ecma5Strict" /&gt; &lt;/output-targets&gt; &lt;/royale-sdk-description&gt; </echo> </target> <target name="create-description" description="Generate flex-sdk-description.xml" unless="airsdk.found"> <tstamp> <format property="build.number.date" pattern="yyyyMMdd" /> </tstamp> <echo message="build.number is ${build.number.date}"/> <echo file="${basedir}/flex-sdk-description.xml">&lt;?xml version="1.0"?&gt; &lt;!-- 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. --&gt; &lt;flex-sdk-description&gt; &lt;name&gt;${release.name} ${release.version} FP${playerglobal.version} AIR${air.version} ${locale}&lt;/name&gt; &lt;version&gt;${fb.release.version}&lt;/version&gt; &lt;build&gt;${build.number.date}&lt;/build&gt; &lt;/flex-sdk-description&gt; </echo> <echo file="${basedir}/royale-sdk-description.xml">&lt;?xml version="1.0"?&gt; &lt;!-- 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. --&gt; &lt;royale-sdk-description&gt; &lt;name&gt;${release.name}&lt;/name&gt; &lt;version&gt;${release.version}&lt;/version&gt; &lt;build&gt;${build.number.date}&lt;/build&gt; </echo> <antcall target="js-output-royale-description" /> <antcall target="swf-js-output-royale-description" /> </target> <target name="create-config" description="Create config files" unless="airsdk.found"> <ant dir="${basedir}/frameworks" target="create-config"> <property name="configname" value="royale" /> </ant> <antcall target="tweak-for-jsonly" /> <ant dir="${basedir}/frameworks" target="create-config"> <property name="configname" value="air" /> </ant> <ant dir="${basedir}/frameworks" target="create-config"> <property name="configname" value="js" /> </ant> <ant dir="${basedir}/frameworks" target="create-config"> <property name="configname" value="ace" /> </ant> <ant dir="${basedir}/frameworks" target="create-config"> <property name="configname" value="jquery" /> </ant> <ant dir="${basedir}/frameworks" target="create-config"> <property name="configname" value="createjs" /> </ant> <ant dir="${basedir}/frameworks" target="create-config"> <property name="configname" value="node" /> </ant> <ant dir="${basedir}/frameworks" target="create-config"> <property name="configname" value="flex" /> </ant> <!-- hack to keep compiler happy --> <mkdir dir="${ROYALE_HOME}/frameworks/themes/Spark" /> <echo file="${ROYALE_HOME}/frameworks/themes/Spark/spark.css">/* * 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. * */ /* generated by build script */ </echo> </target> <target name="copy-externs" depends="check-typedefs-home" description="Copy extern swcs into this folder"> <mkdir dir="${basedir}/js/libs" /> <copy todir="${basedir}/js/libs" flatten="true"> <fileset dir="${ROYALE_TYPEDEFS_HOME}"> <include name="**/*.swc"/> <exclude name="airglobal/**/*.swc"/> <exclude name="playerglobal/**/*.swc"/> </fileset> </copy> <antcall target="rename_jquery" /> </target> <target name="copy-playerglobal" depends="check-typedefs-home" unless="env.PLAYERGLOBAL_HOME"> <copy todir="${basedir}/frameworks/libs/player/${playerglobal.version}" flatten="true" overwrite="true" failonerror="true"> <fileset dir="${ROYALE_TYPEDEFS_HOME}/playerglobal/target"> <include name="playerglobal.swc"/> </fileset> </copy> </target> <target name="copy-airglobal" depends="check-typedefs-home" unless="env.AIR_HOME"> <copy todir="${basedir}/frameworks/libs/air" flatten="true" overwrite="true" failonerror="true"> <fileset dir="${ROYALE_TYPEDEFS_HOME}/airglobal/target"> <include name="airglobal.swc"/> </fileset> </copy> </target> <target name="copy-compiler" depends="check-compiler-home" description="Copy compiler jars to where they are supposed to go"> <mkdir dir="${basedir}/lib" /> <echo>Copying Compiler from ${ROYALE_COMPILER_REPO}</echo> <copy todir="${basedir}/lib"> <fileset dir="${ROYALE_COMPILER_REPO}/compiler/lib"> <include name="**"/> <exclude name="external/jburg.jar"/> <exclude name="external/jflex*"/> <exclude name="external/junit*"/> </fileset> </copy> <mkdir dir="${basedir}/bin" /> <copy todir="${basedir}/bin"> <fileset dir="${ROYALE_COMPILER_REPO}/compiler/src/assembly/scripts"> <include name="**"/> </fileset> </copy> <!-- compiler-jx has some optional scripts that override the ones from compiler. the core SWF compiler doesn't understand our royale-config.xml because it sets a number of JS-related compiler options, so its original scripts will fail when executed and report unknown tag errors. the override scripts call compiler-jx with -targets=SWF to preserve the original behavior while handling the extended options included in royale-config.xml. --> <copy todir="${basedir}/bin" overwrite="true"> <fileset dir="${ROYALE_COMPILER_REPO}/compiler-jx/src/assembly/compiler-override-scripts"> <include name="**"/> </fileset> </copy> <chmod dir="${basedir}/bin" excludes="**/*.bat" perm="+x" /> <mkdir dir="${basedir}/js/lib" /> <echo>Copying Transpiler from ${ROYALE_COMPILER_REPO}</echo> <copy todir="${basedir}/js/lib"> <fileset dir="${ROYALE_COMPILER_REPO}/compiler-jx/lib"> <include name="**"/> <exclude name="junit*"/> </fileset> </copy> <!-- needed to make Flash Builder accept folder as a Flex SDK --> <copy file="${ROYALE_COMPILER_REPO}/compiler/lib/compiler-mxmlc.jar" tofile="${basedir}/lib/mxmlc.jar" /> <copy file="${ROYALE_COMPILER_REPO}/compiler/lib/compiler-mxmlc.jar" tofile="${basedir}/lib/adt.jar" /> <!-- compc used to come from flex-compiler-oem, hopefull this one is ok as well --> <copy file="${ROYALE_COMPILER_REPO}/compiler/lib/compiler-compc.jar" tofile="${basedir}/lib/compc.jar" /> </target> <target name="check_jquery" > <condition property="jquery_exists"> <available file="${basedir}/js/libs/jquery.swc" /> </condition> </target> <target name="rename_jquery" depends="check_jquery" unless="jquery_exists" > <move file="${basedir}/js/libs/jquery-1.9.swc" tofile="${basedir}/js/libs/jquery.swc" /> </target> <target name="setup-binary-release" depends="thirdparty-clean" description="Set properties needed to turn on features for release sdk"> <!-- For a release build, download everything fresh. Build changes to the downloads, might not be caught by the refresh logic. thirdparty-clean should leave this directory empty but just in case... --> <delete dir="${basedir}/in" failonerror="false" includeEmptyDirs="true" /> <!-- generate localized compiler message jars --> <property name="localized.jars" value="true" /> <property name="release.target" value="true" /> </target> <!-- Cleanup --> <target name="super-clean" depends="thirdparty-clean,clean" description="Cleans everything including thirdparty downloads."> <delete dir="${basedir}/mustella/tests/basicTests/bin"/> <delete dir="${basedir}/mustella/tests/mxtests/basicTests/bin"/> <delete dir="${basedir}/bin" failonerror="false"> <include name="**"/> <exclude name=".gitignore"/> </delete> <delete dir="${basedir}/lib" failonerror="false" includeEmptyDirs="true"/> <delete dir="${basedir}/js/lib" failonerror="false" includeEmptyDirs="true"/> <delete dir="${ROYALE_HOME}/frameworks/libs/player" failonerror="false" includeEmptyDirs="true"/> <delete dir="${ROYALE_HOME}/frameworks/libs/air" failonerror="false" includeEmptyDirs="true"/> <delete dir="${ROYALE_HOME}/frameworks/locale" failonerror="false" includeEmptyDirs="true"/> <delete dir="${ROYALE_HOME}/frameworks/mx" failonerror="false" includeEmptyDirs="true"/> <delete dir="${ROYALE_HOME}/frameworks/rsls" failonerror="false" includeEmptyDirs="true"/> <delete dir="${ROYALE_HOME}/frameworks/themes/Halo" failonerror="false" includeEmptyDirs="true"/> <delete dir="${ROYALE_HOME}/frameworks/themes/Spark" failonerror="false" includeEmptyDirs="true"/> <delete file="${ROYALE_HOME}/frameworks/airmobile-config.xml" failonerror="false"/> <delete file="${ROYALE_HOME}/frameworks/macfonts.ser" failonerror="false"/> <delete file="${ROYALE_HOME}/frameworks/winfonts.ser" failonerror="false"/> <delete file="${ROYALE_HOME}/frameworks/localfonts.ser" failonerror="false"/> <delete file="${ROYALE_HOME}/frameworks/mxml-manifest.xml" failonerror="false"/> <delete file="${ROYALE_HOME}/frameworks/spark-manifest.xml" failonerror="false"/> <delete file="${ROYALE_HOME}/ide/flashbuilder/flashbuilder-config.xml" failonerror="false"/> <delete dir="${basedir}" failonerror="false"> <include name="**/*.log"/> <include name="**/*.mdmp"/> </delete> </target> <target name="thirdparty-clean" description="Removes all thirdparty downloads."> <ant dir="${basedir}/frameworks" target="thirdparty-clean"/> <delete dir="${basedir}/in"/> <delete dir="${basedir}/lib"/> <delete dir="${basedir}/marmotinni/java/lib"/> </target> <target name="clean" depends="examples-clean,frameworks-clean,package-clean,checkintests-clean,mxtests-clean" description="Full clean excluding thirdparty downloads"> <delete file="${basedir}/royale-sdk-description.xml" failonerror="false"/> <delete file="${basedir}/rat.report" failonerror="false"/> <delete dir="${basedir}/examples" failonerror="false"> <include name="**/*.swc"/> <include name="**/*.swf"/> </delete> <delete dir="${basedir}/js/libs" failonerror="false" includeEmptyDirs="true"/> <delete dir="${basedir}/out" failonerror="false" includeEmptyDirs="true"/> <delete dir="${basedir}/temp" failonerror="false" includeEmptyDirs="true"/> <delete dir="${basedir}/tempDoc" failonerror="false" includeEmptyDirs="true"/> <ant dir="${basedir}/asdoc" target="clean" /> <!-- <ant dir="${basedir}/ide/flashbuilder" target="clean" /> --> </target> <target name="examples-clean"> <ant dir="${basedir}/examples" target="clean"/> <ant dir="${basedir}/manualtests" target="clean"/> </target> <target name="frameworks-clean"> <ant dir="${basedir}/frameworks" target="clean"/> <ant dir="${basedir}/frameworks/js" target="clean"/> </target> <target name="package-clean"> <delete dir="${basedir}/out" failonerror="false" includeEmptyDirs="true"/> <antcall target="clean-temp"/> </target> <target name="checkintests-clean"> <delete file="${basedir}/mustella/tests/basicTests/BasicTestsApp.swf" failonerror="false"/> <delete dir="${basedir}/mustella/tests/basicTests/bin" failonerror="false" includeEmptyDirs="true"/> </target> <target name="player-clean"> <delete dir="${basedir}/in/player" failonerror="false" includeEmptyDirs="true"/> </target> <!-- Build Examples --> <target name="examples" description="Build the examples" depends="prebuild,check-goog-home"> <ant dir="${basedir}/examples"/> </target> <!-- Build framework SWCs --> <target name="frameworks" description="Full build of all Actionscript framework SWCs, including resource bundles and themes" unless="airsdk.found"> <ant dir="${basedir}/frameworks"> <property name="locale" value="${locale}"/> </ant> <antcall target="tweak-for-jsonly"/> </target> <target name="sample-themes" description="Build the sample themes"> <!--<ant dir="${basedir}/samples/themes/zen" target="main" /> --> </target> <target name="javadocs" description="Build javadoc for compiler oem interface"> <javadoc destdir="${basedir}/javadoc" useexternalfile="yes" maxmemory="128m"> <classpath> <fileset dir="${basedir}/lib"> <include name="flex-compiler-oem.jar"/> </fileset> </classpath> <fileset dir="${basedir}/modules/compiler/src/java/royale2/tools/oem"> <include name="*.java"/> <exclude name="**/*.properties"/> </fileset> </javadoc> <mkdir dir="${basedir}/out"/> <zip destfile="${basedir}/out/${kit.prefix}-compiler-api-javadocs.zip" basedir="${ROYALE_HOME}/javadoc"/> <delete dir="${basedir}/javadoc" failonerror="false" includeEmptyDirs="true"/> </target> <target name="ide" description="Build any ide specific files" unless="airsdk.found"> <!--<ant dir="${basedir}/ide/flashbuilder" />--> </target> <target name="post-build" depends="ide" description="Handle post-build activities" unless="airsdk.found"> <!-- fake a bunch of files to make the folder appear like a valid Flex SDK to Flash Builder --> <echo file="${ROYALE_HOME}/ide/flashbuilder/flashbuilder-config.xml">&lt;?xml version="1.0"?&gt; &lt;!-- 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. --&gt; &lt;flashbuilder-config&gt; &lt;express-install-swf&gt;expressInstall.swf&lt;/express-install-swf&gt; &lt;/flashbuilder-config&gt; </echo> <echo file="${ROYALE_HOME}/frameworks/mxml-manifest.xml">&lt;?xml version="1.0"?&gt; &lt;!-- 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. --&gt; &lt;componentPackage&gt; &lt;/componentPackage&gt; </echo> <echo file="${ROYALE_HOME}/frameworks/spark-manifest.xml">&lt;?xml version="1.0"?&gt; &lt;!-- 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. --&gt; &lt;componentPackage&gt; &lt;/componentPackage&gt; </echo> <mkdir dir="${ROYALE_HOME}/frameworks/locale" /> <mkdir dir="${ROYALE_HOME}/frameworks/mx" /> <mkdir dir="${ROYALE_HOME}/frameworks/projects" /> <mkdir dir="${ROYALE_HOME}/frameworks/rsls" /> <mkdir dir="${ROYALE_HOME}/frameworks/themes/Halo" /> <copy file="${ROYALE_HOME}/js/libs/js.swc" tofile="${ROYALE_HOME}/frameworks/themes/Halo/Halo.swc" /> <copy file="${ROYALE_HOME}/frameworks/air-config.xml" tofile="${ROYALE_HOME}/frameworks/airmobile-config.xml" /> <touch file="${ROYALE_HOME}/frameworks/macfonts.ser" /> <touch file="${ROYALE_HOME}/frameworks/winfonts.ser" /> <touch file="${ROYALE_HOME}/frameworks/localfonts.ser" /> </target> <!-- Build the ASDoc html pages. --> <target name="asdoc" description="asdoc"> <ant dir="${basedir}/asdoc" /> </target> <!-- Package up the Apache Royale sources. Do not include empty directories. Note: even if cleaned, this will package up unversioned files that happen to be in the tree. FixMe: clean needs to clean - add code to detect unversioned files --> <target name="source-package" depends="stage-source,stage-compiler,stage-typedefs,stage-top-level,source-package-zip,source-package-tgz" description="Package source files required to build in zip and tar-gzip file"> </target> <target name="stage-compiler" > <echo file="${ROYALE_COMPILER_REPO}/env.properties">env.ASJS_HOME=${basedir}</echo> <!-- windows needs backslashes escaped --> <replaceregexp file="${ROYALE_COMPILER_REPO}/env.properties" match="\\" replace="\\\\\\\\" flags="g" /> <ant dir="${ROYALE_COMPILER_REPO}" target="wipe-all" /> <ant dir="${ROYALE_COMPILER_REPO}" target="stage-all" > <property name="staging-dir" value="${basedir}/temp/royale-compiler" /> </ant> </target> <target name="stage-typedefs" > <ant dir="${ROYALE_TYPEDEFS_HOME}" target="wipe" /> <mkdir dir="${staging-dir}/../royale-typedefs"/> <copy todir="${staging-dir}/../royale-typedefs" includeEmptyDirs="false" > <fileset dir="${ROYALE_TYPEDEFS_HOME}" includes="**" /> </copy> </target> <target name="stage-top-level" > <copy file="${basedir}/npm/js-swf/package.json" todir="${basedir}/temp" /> <copy todir="${basedir}/temp" includeEmptyDirs="false"> <fileset dir="${basedir}/releasemgr" includes="**" /> </copy> <!-- use royale-asjs LICENSE at top-level as well for now since it doesn't really need to be different --> <copy file="${basedir}/LICENSE" todir="${basedir}/temp" /> </target> <!-- Packages the source distribution with ZIP. --> <target name="source-package-zip" unless="no.zip"> <mkdir dir="${basedir}/out"/> <zip destfile="${basedir}/out/${source.kit}.zip" basedir="${basedir}/temp"/> </target> <!-- Packages the source distribution with TAR-GZIP. --> <target name="source-package-tgz" unless="no.zip"> <tar-gzip name="${source.kit}" /> </target> <target name="stage-source" description="Package source files required to build in zip file" > <antcall target="clean-temp"/> <sleep seconds="3" /> <mkdir dir="${staging-dir}"/> <copy todir="${staging-dir}" includeEmptyDirs="true"> <fileset dir="${basedir}"> <include name="**"/> <exclude name="local.properties"/> <exclude name="nightly.properties"/> <exclude name="releasecandidate.xml"/> <exclude name="ApproveRoyale.xml"/> <exclude name=".DS_Store"/> <exclude name="**/.DS_Store"/> <exclude name=".git/**"/> <exclude name="in/**"/> <exclude name="out/**"/> <exclude name="**/out/**"/> <exclude name="**/target/**"/> <exclude name="manualtests/**"/> <exclude name="marmotinni/**"/> <exclude name="mustella/**"/> <exclude name="src/site/**"/> <exclude name="testsuite/**"/> <exclude name="fxg2svg/**"/> <exclude name="temp/**"/> <exclude name="vf2js/**"/> <exclude name="**/RoyaleTest_again/**" /> <exclude name="**/VanillaSDK_POC/**" /> <exclude name="**/.plxarc"/> <exclude name="**/.settings/**"/> <exclude name="frameworks/fb.properties"/> <exclude name="frameworks/fonts/**"/> <exclude name="frameworks/test*/**"/> <exclude name="frameworks/js/VanillaSDK/**"/> <exclude name="**/*.iml"/> <!-- the below is used in one case as a binary vector format for generating svg vector content --> <exclude name="**/*.afdesign"/> </fileset> </copy> <tstamp> <format property="build.number.date" pattern="yyyyMMdd" /> </tstamp> <property name="build.version" value="${release.version}.${build.number.date}" /> <!-- now that config xml files are in temp, fix them up for release. --> <echo message="Updating config file air-config.xml with version ${build.version}"/> <fix-config-file file="${staging-dir}/frameworks/air-config-template.xml" version="${build.version}" /> <echo message="Updating config file royale-config.xml with version ${build.version}"/> <fix-config-file file="${staging-dir}/frameworks/royale-config-template.xml" version="${build.version}" /> <echo message="Updating config file js-config.xml with version ${build.version}"/> <fix-config-file file="${staging-dir}/frameworks/js-config-template.xml" version="${build.version}" /> <echo message="Updating config file jquery-config.xml with version ${build.version}"/> <fix-config-file file="${staging-dir}/frameworks/jquery-config-template.xml" version="${build.version}" /> <echo message="Updating config file ace-config.xml with version ${build.version}"/> <fix-config-file file="${staging-dir}/frameworks/ace-config-template.xml" version="${build.version}" /> <echo message="Updating config file createjs-config.xml with version ${build.version}"/> <fix-config-file file="${staging-dir}/frameworks/createjs-config-template.xml" version="${build.version}" /> <echo message="Updating config file node-config.xml with version ${build.version}"/> <fix-config-file file="${staging-dir}/frameworks/node-config-template.xml" version="${build.version}" /> <fixcrlf srcdir="${staging-dir}/bin" eol="crlf" fixlast="false"> <include name="**/*.bat"/> </fixcrlf> <fixcrlf srcdir="${staging-dir}/js/bin" eol="crlf" fixlast="false"> <include name="**/*.bat"/> </fixcrlf> <!-- Unix shell scripts need the correct line endings. --> <fixcrlf srcdir="${staging-dir}/bin" eol="unix" fixlast="false"> <exclude name="**/*.bat"/> </fixcrlf> <fixcrlf srcdir="${staging-dir}/js/bin" eol="unix" fixlast="false"> <exclude name="**/*.bat"/> </fixcrlf> <chmod dir="${staging-dir}/js/bin" excludes="**/*.bat" perm="+x" /> <chmod dir="${staging-dir}/bin" excludes="**/*.bat" perm="+x" /> <!-- Source files have Windows line endings. Most UNIX editors can handle either type of line endings but the converse is often not true. --> <fixcrlf srcdir="${staging-dir}/frameworks" eol="crlf" fixlast="false"> <exclude name="bin/**"/> <exclude name="**/assets/**"/> <exclude name="**/*.fla"/> <exclude name="**/*.flv"/> <exclude name="**/*.gif"/> <exclude name="**/*.mp3"/> <exclude name="**/*.jpg"/> <exclude name="**/*.pbj"/> <exclude name="**/*.png"/> <exclude name="**/*.sh"/> <exclude name="**/*.swf"/> <exclude name="**/*.swc"/> </fixcrlf> <!-- Unix shell scripts need the correct line endings. The bin directory is handled in stage-bin. --> <fixcrlf srcdir="${staging-dir}/" eol="unix" fixlast="false"> <include name="**.sh"/> <exclude name="bin/**"/> </fixcrlf> <!-- delete any left-over empty directories --> <delete includeemptydirs="true"> <fileset dir="${staging-dir}/frameworks/projects"> <and> <size value="0"/> <type type="dir"/> </and> </fileset> </delete> <delete includeemptydirs="true"> <fileset dir="${staging-dir}/frameworks/js/projects"> <and> <size value="0"/> <type type="dir"/> </and> </fileset> </delete> <delete includeemptydirs="true"> <fileset dir="${staging-dir}/examples"> <and> <size value="0"/> <type type="dir"/> </and> </fileset> </delete> </target> <target name="jsonly-package" if="swf.distribution" description="subset binary package to be a js-only package if AIR_HOME is set and we built a SWF+JS package"> <!-- assumes temp folder contains the binary package with SWF stuff in it --> <delete dir="${basedir}/temp/royale-asjs/frameworks/libs" failonerror="false" includeEmptyDirs="true" /> <mkdir dir="${basedir}/temp/royale-asjs/frameworks/libs" /> <copy file="${ROYALE_HOME}/js/libs/js.swc" tofile="${basedir}/temp/royale-asjs/frameworks/libs/KeepsFBFromHanging.swc" /> <mkdir dir="${basedir}/temp/royale-asjs/frameworks/libs/player/${playerglobal.version}"/> <copy file="${ROYALE_HOME}/js/libs/js.swc" tofile="${basedir}/temp/royale-asjs/frameworks/libs/player/${playerglobal.version}/playerglobal.swc" /> <mkdir dir="${basedir}/temp/royale-asjs/frameworks/libs/air"/> <copy file="${ROYALE_HOME}/js/libs/js.swc" tofile="${basedir}/temp/royale-asjs/frameworks/libs/air/airglobal.swc" /> <replace token="{playerglobalHome}" value="libs/player" > <fileset dir="${staging-dir}/frameworks"> <include name="air-config.xml"/> <include name="airmobile-config.xml"/> <include name="createjs-config.xml"/> <include name="flex-config.xml"/> <include name="jquery-config.xml"/> <include name="ace-config.xml"/> <include name="js-config.xml"/> <include name="node-config.xml"/> <include name="royale-config.xml"/> </fileset> </replace> <replace token="&lt;path-element&gt;libs&lt;/path-element&gt;" value="&lt;path-element&gt;js/libs&lt;/path-element&gt;" > <fileset dir="${staging-dir}/frameworks"> <include name="air-config.xml"/> <include name="airmobile-config.xml"/> <include name="createjs-config.xml"/> <include name="flex-config.xml"/> <include name="jquery-config.xml"/> <include name="ace-config.xml"/> <include name="js-config.xml"/> <include name="node-config.xml"/> <include name="royale-config.xml"/> </fileset> </replace> <replace token="&lt;target&gt;SWF&lt;/target&gt;" value="" > <fileset dir="${staging-dir}/frameworks"> <include name="air-config.xml"/> <include name="airmobile-config.xml"/> <include name="createjs-config.xml"/> <include name="flex-config.xml"/> <include name="jquery-config.xml"/> <include name="ace-config.xml"/> <include name="js-config.xml"/> <include name="node-config.xml"/> <include name="royale-config.xml"/> </fileset> </replace> <replaceregexp file="${staging-dir}/frameworks/royale-config.xml" match="(\s+?)&lt;path-element&gt;libs\/[^\.]+\.swc&lt;\/path-element&gt;(\s+?)" replace="" flags ="g"/> <replace file="${staging-dir}/frameworks/royale-config.xml" token="&lt;path-element&gt;libs/player/{targetPlayerMajorVersion}.{targetPlayerMinorVersion}&lt;/path-element&gt;" value="&lt;path-element&gt;libs/KeepsFBFromHanging.swc&lt;/path-element&gt;"/> <!-- replace npm descriptor with js-only descriptor --> <antcall target="create-jsonly-description" /> <copy file="${basedir}/npm/js-only/package.json" todir="${basedir}/temp" overwrite="true"/> <zip destfile="${basedir}/out/${binary-js.kit}.zip" basedir="${basedir}/temp"/> <tar-gzip name="${binary-js.kit}" /> </target> <target name="binary-package" description="Package binary files in zip and tar-gzip file."> <antcall target="stage-source"/> <!-- concat the license file with the binary license file for the 3rd party deps --> <concat destfile="${basedir}/temp/LICENSE"> <filelist dir="${basedir}" files="LICENSE,LICENSE.bin"/> </concat> <antcall target="copy-gcl-from-goog-home"/> <antcall target="copy-gcl-from-downloaded"/> <antcall target="inject-asf-header" /> <antcall target="