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