4814N/A<?xml version="1.0" encoding="UTF-8"?>
4814N/A<!--
4814N/ACopyright 2012, Oracle and/or its affiliates. All rights reserved.
4814N/A
4814N/ADO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4814N/A
4814N/AThis code is free software; you can redistribute it and/or modify it
4814N/Aunder the terms of the GNU General Public License version 2 only, as
4814N/Apublished by the Free Software Foundation. Oracle designates this
4814N/Aparticular file as subject to the "Classpath" exception as provided
4814N/Aby Oracle in the LICENSE file that accompanied this code.
4814N/A
4814N/AThis code is distributed in the hope that it will be useful, but WITHOUT
4814N/AANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
4814N/AFITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
4814N/Aversion 2 for more details (a copy is included in the LICENSE file that
4814N/Aaccompanied this code).
4814N/A
4814N/AYou should have received a copy of the GNU General Public License version
4814N/A2 along with this work; if not, write to the Free Software Foundation,
4814N/AInc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
4814N/A
4814N/APlease contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
4814N/Aor visit www.oracle.com if you need additional information or have any
4814N/Aquestions.
4814N/A-->
4814N/A
4814N/A<project name="appbundler" default="package">
4814N/A <property environment="env"/>
4814N/A
4814N/A <property file="build.properties"/>
4814N/A
4814N/A <property name="folder.src" value="src"/>
4814N/A <property name="folder.test" value="test"/>
4814N/A <property name="folder.native" value="native"/>
4814N/A <property name="folder.bin" value="bin"/>
4814N/A <property name="folder.classes" value="${folder.bin}/classes"/>
4814N/A
4814N/A <!-- Compile target -->
4814N/A <target name="compile">
4814N/A <mkdir dir="${ant.project.name}/${folder.classes}"/>
4814N/A <javac destDir="${ant.project.name}/${folder.classes}"
4814N/A includejavaruntime="true"
4814N/A includeantruntime="true"
4814N/A deprecation="true"
4814N/A debug="true"
4814N/A encoding="UTF-8"
4814N/A failonerror="true">
4814N/A <src>
4814N/A <dirset dir="${ant.project.name}">
4814N/A <include name="${folder.src}"/>
4814N/A <include name="${folder.test}"/>
4814N/A </dirset>
4814N/A </src>
4814N/A <compilerarg line="-Xlint:all"/>
4814N/A <classpath>
4814N/A <dirset dir="${basedir}" includes="**/${folder.classes}"/>
4814N/A <fileset dir="${ant.project.name}" includes="lib/**/*.jar"/>
4814N/A </classpath>
4814N/A </javac>
4814N/A <copy todir="${ant.project.name}/${folder.classes}" includeEmptyDirs="false">
4814N/A <fileset dir="${ant.project.name}/${folder.src}">
4814N/A <exclude name="**/*.java"/>
4814N/A <exclude name="**/package.html"/>
4814N/A </fileset>
4814N/A <fileset dir="${ant.project.name}/${folder.test}" erroronmissingdir="false">
4814N/A <exclude name="**/*.java"/>
4814N/A <exclude name="**/package.html"/>
4814N/A </fileset>
4814N/A </copy>
4814N/A
4814N/A <!-- TODO Move this to a makefile so we can reference the defines required by JLI_Launch() -->
4814N/A <exec executable="gcc">
4814N/A <arg value="-I"/>
4814N/A <arg value="${env.JAVA_HOME}/include"/>
4814N/A <arg value="-I"/>
4814N/A <arg value="${env.JAVA_HOME}/include/darwin"/>
4814N/A <arg value="-o"/>
4814N/A <arg value="${ant.project.name}/${folder.classes}/com/oracle/appbundler/JavaAppLauncher"/>
4814N/A <arg value="-framework"/>
4814N/A <arg value="Cocoa"/>
4814N/A <arg value="-F"/>
4814N/A <arg value="${env.JAVA_HOME}/../.."/>
4814N/A <arg value="-m64"/>
4814N/A <arg value="-std=c99"/>
4814N/A <arg value="appbundler/native/main.m"/>
4814N/A </exec>
4814N/A </target>
4814N/A
4814N/A <!-- Clean target -->
4814N/A <target name="clean">
4814N/A <delete dir="${ant.project.name}/${folder.classes}"/>
4814N/A <delete file="${ant.project.name}/${folder.bin}/${ant.project.name}-${version}.jar"/>
4814N/A <delete dir="HelloWorld.app"/>
4814N/A <delete dir="SwingSet2.app"/>
4814N/A </target>
4814N/A
4814N/A <!-- Package target -->
4814N/A <target name="package" depends="compile">
4814N/A <property name="destfile" value="${ant.project.name}/${folder.bin}/${ant.project.name}-${version}.jar"/>
4814N/A
4814N/A <delete file="${destfile}"/>
4814N/A <jar destfile="${destfile}" index="true">
4814N/A <manifest>
4814N/A <attribute name="Implementation-Vendor-Id" value="com.oracle"/>
4814N/A <attribute name="Implementation-Vendor" value="Oracle"/>
4814N/A <attribute name="Implementation-Title" value="App Bundler Ant Task"/>
4814N/A <attribute name="Implementation-Version" value="${version}"/>
4814N/A </manifest>
4814N/A <fileset dir="${ant.project.name}/${folder.classes}">
4814N/A <exclude name="**/${folder.test}/**"/>
4814N/A </fileset>
4814N/A <fileset dir="${ant.project.name}/${folder.bin}">
4814N/A <include name="JavaAppLauncher"/>
4814N/A </fileset>
4814N/A </jar>
4814N/A </target>
4814N/A
4814N/A <!-- Test targets -->
4814N/A <target name="test-hello" depends="package">
4814N/A <taskdef name="bundleapp" classname="com.oracle.appbundler.AppBundlerTask"
4814N/A classpath="${ant.project.name}/${folder.bin}/${ant.project.name}-${version}.jar"/>
4814N/A
4814N/A <bundleapp outputdirectory="."
4814N/A name="HelloWorld"
4814N/A displayname="Hello World Test"
4814N/A identifier="com.oracle.appbundler.Test"
4814N/A shortversion="1.0"
4814N/A runtime="${env.JAVA_HOME}/../.."
4814N/A mainclassname="Test">
4814N/A <classpath dir="${ant.project.name}/${folder.classes}" includes="Test.class"/>
4814N/A <option value="-Xms32M"/>
4814N/A <option value="-Xmx256M"/>
4814N/A <argument value="foo=bar"/>
4814N/A </bundleapp>
4814N/A </target>
4814N/A
4814N/A <target name="test-swingset" depends="package">
4814N/A <taskdef name="bundleapp" classname="com.oracle.appbundler.AppBundlerTask"
4814N/A classpath="${ant.project.name}/${folder.bin}/${ant.project.name}-${version}.jar"/>
4814N/A
4814N/A <bundleapp outputdirectory="."
4814N/A name="SwingSet2"
4814N/A displayname="SwingSet 2"
4814N/A identifier="com.oracle.javax.swing.SwingSet2"
4814N/A shortversion="1.0"
4814N/A runtime="${env.JAVA_HOME}/../.."
4814N/A mainclassname="SwingSet2">
4814N/A <classpath file="/Library/Java/Demos/JFC/SwingSet2/SwingSet2.jar"/>
4814N/A <option value="-Xms32M"/>
4814N/A <option value="-Xmx256M"/>
4814N/A <option value="-Dapple.laf.useScreenMenuBar=true"/>
4814N/A <argument value="foo=bar"/>
4814N/A </bundleapp>
4814N/A </target>
4814N/A
4814N/A <!-- Trim whitespace target -->
4814N/A <target name="trim-whitespace">
4814N/A <fileset id="trimfiles" dir=".">
4814N/A <include name="**/*.h"/>
4814N/A <include name="**/*.html"/>
4814N/A <include name="**/*.java"/>
4814N/A <include name="**/*.m"/>
4814N/A <include name="**/*.properties"/>
4814N/A <include name="**/*.xml"/>
4814N/A </fileset>
4814N/A <replaceregexp match="[\t]" replace=" " flags="gm" byline="true">
4814N/A <fileset refid="trimfiles"/>
4814N/A </replaceregexp>
4814N/A <replaceregexp match="[\t ]+$" replace="" flags="gm" byline="true">
4814N/A <fileset refid="trimfiles"/>
4814N/A </replaceregexp>
4814N/A </target>
4814N/A</project>