1*cdf0e10cSrcweir<?xml version="1.0"?> 2*cdf0e10cSrcweir 3*cdf0e10cSrcweir<!-- 4*cdf0e10cSrcweir Copyright 2004 Sun Microsystems, Inc. All rights reserved. 5*cdf0e10cSrcweir SUN PROPRIETARY/CONFIDENTIAL. Use is subject to license terms. 6*cdf0e10cSrcweir--> 7*cdf0e10cSrcweir 8*cdf0e10cSrcweir<project name="javainstaller2" default="build" basedir="."> 9*cdf0e10cSrcweir 10*cdf0e10cSrcweir <!-- build output directory --> 11*cdf0e10cSrcweir <property name="name" value="JavaSetup"/> 12*cdf0e10cSrcweir <property name="out" value="build"/> 13*cdf0e10cSrcweir <property name="classes.dir" value="classes"/> 14*cdf0e10cSrcweir <property name="source.dir" location="${basedir}/src/${name}"/> 15*cdf0e10cSrcweir <property name="build.dir" location="${out}/misc"/> 16*cdf0e10cSrcweir <property name="dist.dir" location="${out}/bin"/> 17*cdf0e10cSrcweir <property name="compile.debug" value="true"/> 18*cdf0e10cSrcweir <property name="compile.optimize" value="false"/> 19*cdf0e10cSrcweir <property name="lib.dir" location="{$basedir}/lib"/> 20*cdf0e10cSrcweir <property name="verbose" value="false"/> 21*cdf0e10cSrcweir <property name="javainstaller.jar.file" location="{$basedir}/lib"/> 22*cdf0e10cSrcweir 23*cdf0e10cSrcweir <!-- MAIN TARGET --> 24*cdf0e10cSrcweir <target name="build" depends="prepare, info_uptodate, info_notuptodate, compile-javainstaller, jar-javainstaller, clean"> 25*cdf0e10cSrcweir <echo message="Done"/> 26*cdf0e10cSrcweir </target> 27*cdf0e10cSrcweir 28*cdf0e10cSrcweir <!-- INITIALIZATION TASKS --> 29*cdf0e10cSrcweir <target name="init"> 30*cdf0e10cSrcweir <!-- up to date checks --> 31*cdf0e10cSrcweir <uptodate property="jarFile.uptodate" targetfile="${dist.dir}/${name}.jar"> 32*cdf0e10cSrcweir <srcfiles dir="${source.dir}" includes="**/*.gif,**/*.png,**/*.java"/> 33*cdf0e10cSrcweir <srcfiles dir="${build.dir}" includes="**/*.properties"/> 34*cdf0e10cSrcweir </uptodate> 35*cdf0e10cSrcweir </target> 36*cdf0e10cSrcweir 37*cdf0e10cSrcweir <target name="prepare" depends="init" unless="jarFile.uptodate"> 38*cdf0e10cSrcweir <mkdir dir="${build.dir}"/> 39*cdf0e10cSrcweir <mkdir dir="${build.dir}/${classes.dir}"/> 40*cdf0e10cSrcweir <mkdir dir="${build.dir}/${classes.dir}/${name}"/> 41*cdf0e10cSrcweir <mkdir dir="${dist.dir}"/> 42*cdf0e10cSrcweir </target> 43*cdf0e10cSrcweir 44*cdf0e10cSrcweir <!-- show information about current sub target in recursive builds --> 45*cdf0e10cSrcweir <target name="info_uptodate" depends="init" if="jarFile.uptodate"> 46*cdf0e10cSrcweir <tstamp prefix="start"/> 47*cdf0e10cSrcweir <echo message="--------------------------------------------------------------------------------" /> 48*cdf0e10cSrcweir <echo message="Nothing to do. ${dist.dir}/${name}.jar is up to date."/> 49*cdf0e10cSrcweir <echo message="--------------------------------------------------------------------------------" /> 50*cdf0e10cSrcweir </target> 51*cdf0e10cSrcweir 52*cdf0e10cSrcweir <!-- show information about current sub target in recursive builds --> 53*cdf0e10cSrcweir <target name="info_notuptodate" depends="init" unless="jarFile.uptodate"> 54*cdf0e10cSrcweir <tstamp prefix="start"/> 55*cdf0e10cSrcweir <echo message="--------------------------------------------------------------------------------" /> 56*cdf0e10cSrcweir <echo message="Source dir: ${source.dir}"/> 57*cdf0e10cSrcweir <echo message="Build dir: ${build.dir}"/> 58*cdf0e10cSrcweir <echo message="Dist dir: ${dist.dir}"/> 59*cdf0e10cSrcweir <echo message="Debug is ${debug}"/> 60*cdf0e10cSrcweir <echo message="--------------------------------------------------------------------------------" /> 61*cdf0e10cSrcweir </target> 62*cdf0e10cSrcweir 63*cdf0e10cSrcweir <target name="compile-javainstaller" depends="prepare" unless="jarFile.uptodate"> 64*cdf0e10cSrcweir <javac srcdir="${source.dir}" source="1.4" target="1.4" 65*cdf0e10cSrcweir destdir="${build.dir}/${classes.dir}/${name}" 66*cdf0e10cSrcweir debug="${compile.debug}" 67*cdf0e10cSrcweir optimize="${compile.optimize}"> 68*cdf0e10cSrcweir </javac> 69*cdf0e10cSrcweir <copy todir="${build.dir}/${classes.dir}/${name}/org/openoffice/setup"> 70*cdf0e10cSrcweir <fileset dir="${build.dir}" includes="*.properties"/> 71*cdf0e10cSrcweir </copy> 72*cdf0e10cSrcweir <copy todir="${build.dir}/${classes.dir}/${name}/org/openoffice/setup/Icons"> 73*cdf0e10cSrcweir <fileset dir="${source.dir}/org/openoffice/setup/Icons" includes="*.gif,*.png"/> 74*cdf0e10cSrcweir </copy> 75*cdf0e10cSrcweir </target> 76*cdf0e10cSrcweir 77*cdf0e10cSrcweir <target name="jar-javainstaller" depends="compile-javainstaller" unless="jarFile.uptodate"> 78*cdf0e10cSrcweir <jar file="${dist.dir}/${name}.jar"> 79*cdf0e10cSrcweir <fileset dir="${build.dir}/${classes.dir}/${name}" includes="**/*"/> 80*cdf0e10cSrcweir <manifest> 81*cdf0e10cSrcweir <attribute name="Main-Class" value="org.openoffice.setup.Main"/> 82*cdf0e10cSrcweir </manifest> 83*cdf0e10cSrcweir </jar> 84*cdf0e10cSrcweir </target> 85*cdf0e10cSrcweir 86*cdf0e10cSrcweir <!-- CLEAN UP OUTPUT TREES --> 87*cdf0e10cSrcweir <target name="clean" unless="jarFile.uptodate"> 88*cdf0e10cSrcweir <!-- <delete dir="${build.dir}"/> --> 89*cdf0e10cSrcweir </target> 90*cdf0e10cSrcweir 91*cdf0e10cSrcweir <!-- execution section --> 92*cdf0e10cSrcweir <target name="run" depends="jar-javainstaller"> 93*cdf0e10cSrcweir <echo message="Starting: java -jar ${dist.dir}/${name}.jar" /> 94*cdf0e10cSrcweir <java jar="${dist.dir}/${name}.jar" fork="true"/> 95*cdf0e10cSrcweir <!-- </java> --> 96*cdf0e10cSrcweir </target> 97*cdf0e10cSrcweir 98*cdf0e10cSrcweir <target name="debug" depends="jar-javainstaller"> 99*cdf0e10cSrcweir <echo message="Starting for debugging: java -jar ${dist.dir}/${name}.jar" /> 100*cdf0e10cSrcweir <java jar="${dist.dir}/${name}.jar" fork="true"/> 101*cdf0e10cSrcweir <!-- </java> --> 102*cdf0e10cSrcweir</target> 103*cdf0e10cSrcweir 104*cdf0e10cSrcweir 105*cdf0e10cSrcweir</project> 106