| <?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="flex-compiler-oem" default="main" basedir="."> |
| |
| <!-- |
| |
| PROPERTIES |
| |
| --> |
| |
| <!-- The 'compiler' property is the absolute path, with forward slashes, --> |
| <!-- to the 'compiler' directory that contains this file. --> |
| <!-- All input paths are expressed as absolute paths starting with ${compiler}. --> |
| <pathconvert property="oem" dirsep="/"> |
| <path location="${basedir}"/> |
| </pathconvert> |
| <property name="compiler" value="${basedir}/../compiler" /> |
| |
| <!-- The 'env' property contains all the environment variables --> |
| <property environment="env"/> |
| |
| <!-- Properties can be overridden locally by loading a local.properties file --> |
| <property file="${compiler}/local.properties"/> |
| <property file="${compiler}/../build.properties"/> |
| |
| <!-- set FLEX_HOME from environment if not already set --> |
| <property name="FLEX_HOME" value="${env.FLEX_HOME}"/> |
| |
| <!-- The 'sdk' property is the absolute path, with forward slashes, to the compiler directory --> |
| <!-- where a Falcon SDK is built --> |
| <!-- All output paths are expressed as absolute paths starting with ${sdk} --> |
| <property name="sdk" value="${compiler}"/> |
| |
| <property name="src.depend" value="true"/> |
| |
| <!-- Options for <javac> tasks --> |
| <property name="javac.debug" value="true"/> |
| <property name="javac.deprecation" value="false"/> |
| <property name="javac.src" value="1.6"/> |
| |
| <!-- JAR manifest entries --> |
| <property name="manifest.sealed" value="false"/> |
| <property name="manifest.Implementation-Title" value="Apache Flex Compiler"/> |
| <property name="manifest.Implementation-Version" value="${release.version}"/> |
| <property name="manifest.Implementation-Vendor" value="Apache Software Foundation"/> |
| |
| <property name="compiler.ant.binaries" value="org/apache/flex/compiler/ant/**/*.class"/> |
| <property name="compiler.font.binaries" value="org/apache/flex/fonts/**"/> |
| |
| <!-- label is set by CruiseControl script based on P4 label incrementer --> |
| <condition property="build.number" value="${label}"> |
| <isset property="label"/> |
| </condition> |
| |
| <target name="download_check" description="determine if we have downloaded/bundled swfutils source"> |
| <available file="${oem}/target/downloads/java/flash/swf/Action.java" |
| type="file" |
| property="swfutils.bundled" |
| value="true" /> |
| </target> |
| |
| <target name="downloads" depends="download_check" unless="swfutils.bundled"> |
| <mkdir dir="${oem}/target/downloads/java/flash" /> |
| <get src="https://git-wip-us.apache.org/repos/asf/flex-sdk/repo?p=flex-sdk.git;a=snapshot;h=2cfbdd592ef87b40704d3d7145f4da9a369429eb;sf=tgz" |
| dest="${oem}/target/downloads/flex-sdk-modules-swfutils.tar.gz" ignoreerrors="true"/> |
| <antcall target="get-from-cache-if-needed" > |
| <param name="srcFile" value="flex-sdk-modules-swfutils.tar.gz" /> |
| <param name="destFile" value="flex-sdk-modules-swfutils.tar.gz" /> |
| <param name="destDir" value="${oem}/target/downloads" /> |
| </antcall> |
| <antcall target="fail-if-not-found" > |
| <param name="destFile" value="flex-sdk-modules-swfutils.tar.gz" /> |
| <param name="destDir" value="${oem}/target/downloads" /> |
| </antcall> |
| <untar src="${oem}/target/downloads/flex-sdk-modules-swfutils.tar.gz" dest="${oem}/target/downloads/java/flash" compression="gzip"> |
| <patternset> |
| <include name="**/localization/**"/> |
| <include name="**/swf/Movie.java"/> |
| <include name="**/swf/actions/**"/> |
| <include name="**/swf/Action.java"/> |
| <include name="**/swf/ActionConstants.java"/> |
| <include name="**/swf/ActionDecoder.java"/> |
| <include name="**/swf/ActionFactory.java"/> |
| <include name="**/swf/ActionHandler.java"/> |
| <include name="**/swf/CompressionLevel.java"/> |
| <include name="**/swf/debug/**"/> |
| <include name="**/swf/DebugDecoder.java"/> |
| <include name="**/swf/DebugHandler.java"/> |
| <include name="**/swf/DebugTags.java"/> |
| <include name="**/swf/Dictionary.java"/> |
| <include name="**/swf/Frame.java"/> |
| <include name="**/swf/Header.java"/> |
| <include name="**/swf/MovieMetaData.java"/> |
| <include name="**/swf/RandomAccessBuffer.java"/> |
| <include name="**/swf/SwfDecoder.java"/> |
| <include name="**/swf/SwfEncoder.java"/> |
| <include name="**/swf/SwfFormatException.java"/> |
| <include name="**/swf/Tag.java"/> |
| <include name="**/swf/TagDecoder.java"/> |
| <include name="**/swf/TagHandler.java"/> |
| <include name="**/swf/TagValues.java"/> |
| <include name="**/swf/tags/**"/> |
| <include name="**/swf/tools/Disassembler.java"/> |
| <include name="**/swf/types/**"/> |
| <include name="**/util/ExceptionUtil.java"/> |
| <include name="**/util/FieldFormat.java"/> |
| <include name="**/util/FileUtils.java"/> |
| <include name="**/util/IntMap.java"/> |
| <include name="**/util/Trace.java"/> |
| </patternset> |
| <cutdirsmapper dirs="1"/> |
| </untar> |
| </target> |
| |
| <!-- |
| |
| CLASSPATHS |
| |
| --> |
| |
| <path id="classpath"> |
| <fileset dir="${sdk}/lib" includes="**/*.jar"/> |
| <fileset dir="../compiler-jx/lib" includes="jsc.jar"/> |
| </path> |
| |
| |
| <!-- |
| |
| BUILDING |
| |
| --> |
| |
| <target name="src.depend" if="src.depend"> |
| <depend srcdir="${oem}/src/main/java" |
| destdir="${oem}/target/classes" cache="${oem}/target/classes"/> |
| </target> |
| |
| <target name="compile" depends="src.depend" description="compile"> |
| <javac debug="${javac.debug}" deprecation="${javac.deprecation}" |
| source="${javac.src}" target="${javac.src}" |
| includes="**/*.java" destdir="${oem}/target/classes" classpathref="classpath" includeAntRuntime="true"> |
| <src path="${oem}/src/main/java"/> |
| <src path="${oem}/target/downloads/java"/> |
| </javac> |
| <!-- |
| <copy todir="${compiler}/generated/classes"> |
| <fileset dir="${compiler}/src" includes="**/*.properties"/> |
| </copy> |
| --> |
| </target> |
| |
| |
| <target name="set.compc.jar.uptodate"> |
| <uptodate property="compc.jar.uptodate" |
| targetfile="${sdk}/lib/compc.jar"> |
| <srcfiles dir="${compiler}/target/classes"> |
| <include name="**/*.class"/> |
| <include name="**/*.properties"/> |
| </srcfiles> |
| </uptodate> |
| </target> |
| |
| <target name="compc.jar" depends="oem.jar,set.compc.jar.uptodate" unless="compc.jar.uptodate"> |
| <mkdir dir="${sdk}/lib"/> |
| <jar file="${sdk}/lib/compc.jar" basedir="${compiler}/target/classes" whenmanifestonly="create"> |
| <include name="META-INF/LICENSE"/> |
| <include name="META-INF/NOTICE"/> |
| <manifest> |
| <attribute name="Sealed" value="${manifest.sealed}"/> |
| <attribute name="Implementation-Title" value="${manifest.Implementation-Title} - COMPC Command Line Compiler"/> |
| <attribute name="Implementation-Version" value="${manifest.Implementation-Version}.${build.number}"/> |
| <attribute name="Implementation-Vendor" value="${manifest.Implementation-Vendor}"/> |
| <attribute name="Main-Class" value="flex2.tools.Compc"/> |
| <attribute name="Class-Path" value="flex-compiler-oem.jar"/> |
| </manifest> |
| </jar> |
| </target> |
| |
| <target name="set.oem.jar.uptodate"> |
| <uptodate property="oem.jar.uptodate" |
| targetfile="${sdk}/lib/flex-compiler-oem.jar"> |
| <srcfiles dir="${oem}/target/classes"> |
| <include name="**/*.class"/> |
| <include name="**/*.properties"/> |
| </srcfiles> |
| </uptodate> |
| </target> |
| |
| <target name="oem.jar" depends="compile, set.oem.jar.uptodate" unless="oem.jar.uptodate" |
| description="Builds flex-oem-compiler.jar"> |
| <mkdir dir="${sdk}/lib"/> |
| <mkdir dir="${oem}/target/classes/META-INF"/> |
| <copy file="${basedir}/../LICENSE.base" tofile="${oem}/target/classes/META-INF/LICENSE"/> |
| <copy file="${basedir}/../NOTICE.oem" tofile="${oem}/target/classes/META-INF/NOTICE"/> |
| <jar file="${sdk}/lib/flex-compiler-oem.jar" basedir="${oem}/target/classes" includes="**/*.properties,**/*"> |
| <include name="META-INF/LICENSE"/> |
| <include name="META-INF/NOTICE"/> |
| <manifest> |
| <attribute name="Sealed" value="${manifest.sealed}"/> |
| <attribute name="Implementation-Title" value="${manifest.Implementation-Title}"/> |
| <attribute name="Implementation-Version" value="${manifest.Implementation-Version}.${build.number}"/> |
| <attribute name="Implementation-Vendor" value="${manifest.Implementation-Vendor}"/> |
| <attribute name="Main-Class" value="flex2.tools.Mxmlc"/> |
| <attribute name="Class-Path" value="compiler.jar ../js/lib/jsc.jar"/> |
| </manifest> |
| </jar> |
| </target> |
| |
| <target name="jar" depends="downloads, oem.jar, compc.jar" |
| description="Creates JAR files"/> |
| |
| <target name="sdk" depends="jar" description="Builds a Falcon SDK"/> |
| |
| <target name="main" depends="sdk" description="Default target - Builds a Falcon SDK and builds Falcon Javadoc"> |
| <tstamp> |
| <format property="build.datetime" pattern="MM/dd/yyyy hh:mm:ss aa"/> |
| </tstamp> |
| <echo>flex-compiler-oem main completed on ${build.datetime}</echo> |
| </target> |
| |
| <!-- |
| |
| CLEANUP |
| |
| --> |
| |
| <target name="clean" description="clean"> |
| <delete dir="${oem}/target/classes"/> |
| </target> |
| |
| <target name="wipe" depends="clean" > |
| <delete dir="${oem}/target"/> |
| </target> |
| |
| <target name="fail-if-not-found"> |
| <fail message="${destDir}/${destFile} could not be downloaded or found in cache"> |
| <condition> |
| <not> |
| <available file="${destDir}/${destFile}" /> |
| </not> |
| </condition> |
| </fail> |
| </target> |
| |
| <target name="double-check-file" > |
| <echo>${env.FLEX_DOWNLOAD_CACHE}</echo> |
| <condition property="still-no-file" value="true"> |
| <and> |
| <not> |
| <available file="${destDir}/${destFile}" /> |
| </not> |
| <isset property="env.FLEX_DOWNLOAD_CACHE" /> |
| </and> |
| </condition> |
| <echo>Need file: ${still_no_file}</echo> |
| </target> |
| <target name="get-from-cache-if-needed" depends="double-check-file" if="still-no-file"> |
| <copy file="${env.FLEX_DOWNLOAD_CACHE}/${srcFile}" tofile="${destDir}/${destFile}" /> |
| </target> |
| |
| </project> |