blob: c1e3d0d4c3f15996be60c609d214d8496392903f [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="swfutils" default="main" basedir=".">
<property name="FLEX_HOME" location="../.."/>
<!-- properties -->
<property file="${FLEX_HOME}/build.properties" />
<property name="lib.dir" value="${FLEX_HOME}/lib"/>
<property name="module.dir" value="${basedir}"/>
<property name="module.src" value="${module.dir}/src/java"/>
<property name="javac.src" value="1.5"/>
<property name="module.classes" value="${module.dir}/classes"/>
<property name="build.number" value=""/>
<target name="main" depends="clean,dev" description="cleans and runs the full build"/>
<target name="dev" depends="jar" description="runs src.depend build for development"/>
<path id="swfutils.classpath">
<fileset dir="${lib.dir}">
<include name="*.jar"/>
</fileset>
</path>
<target name="compile" depends="prepare,run-depend" description="compile">
<javac source="${javac.src}" target="${javac.src}" debug="${src.debug}" destdir="${module.classes}" srcdir="${module.src}"
includes="**/*.java" >
<classpath refid="swfutils.classpath"/>
</javac>
</target>
<target name="jar" depends="compile" description="compile and create swfutils.jar">
<mkdir dir="${lib.dir}" />
<mkdir dir="${basedir}/classes/META-INF"/>
<copy file="${FLEX_HOME}/licenseParts/LICENSE.base" tofile="${basedir}/classes/META-INF/LICENSE"/>
<copy file="${FLEX_HOME}/licenseParts/NOTICE.base" tofile="${basedir}/classes/META-INF/NOTICE"/>
<echo message="Building lib/swfutils.jar"/>
<jar file="${lib.dir}/swfutils.jar" basedir="${module.classes}" includes="**/*">
<manifest>
<attribute name="Sealed" value="${manifest.sealed}"/>
<attribute name="Implementation-Title" value="${manifest.Implementation-Title} - SWF Kit"/>
<attribute name="Implementation-Version" value="${manifest.Implementation-Version}.${build.number}"/>
<attribute name="Implementation-Vendor" value="${manifest.Implementation-Vendor}"/>
<attribute name="Implementation-Vendor-Id" value="${manifest.Implementation-Vendor-Id}"/>
</manifest>
</jar>
<echo message="Building lib/swfdump.jar"/>
<jar file="${lib.dir}/swfdump.jar" basedir="${module.classes}">
<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} - SWF Dump"/>
<attribute name="Implementation-Version" value="${manifest.Implementation-Version}.${build.number}"/>
<attribute name="Implementation-Vendor" value="${manifest.Implementation-Vendor}"/>
<attribute name="Implementation-Vendor-Id" value="${manifest.Implementation-Vendor-Id}"/>
<attribute name="Main-Class" value="flash.swf.tools.SwfxPrinter"/>
<attribute name="Class-Path" value="asc.jar swfutils.jar"/>
</manifest>
</jar>
</target>
<target name="clean" description="clean">
<delete failonerror="false" includeEmptyDirs="true">
<fileset file="${lib.dir}/swfutils.jar"/>
<fileset file="${lib.dir}/swfdump.jar"/>
<fileset dir="${module.classes}"/>
</delete>
</target>
<!-- private helper targets -->
<target name="prepare">
<mkdir dir="${lib.dir}"/>
<mkdir dir="${module.classes}"/>
</target>
<!-- if src.depend is specified, delete the stuff which has changed so it can be recompiled -->
<target name="run-depend" if="src.depend">
<echo level="info" message="Removing class files that changed and dependent class files."/>
<depend cache="${module.classes}" srcdir="${module.src}" destdir="${module.classes}"/>
</target>
</project>