4 Copyright 2004 Sun Microsystems, Inc. All rights reserved.
5 SUN PROPRIETARY/CONFIDENTIAL. Use is subject to license terms.
8 <project name="javainstaller2" default="build" basedir=".">
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"/>
24 <target name="build" depends="prepare, info_uptodate, info_notuptodate, compile-javainstaller, jar-javainstaller, clean">
25 <echo message="Done"/>
28 <!-- INITIALIZATION TASKS -->
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"/>
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}"/>
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="--------------------------------------------------------------------------------" />
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="--------------------------------------------------------------------------------" />
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}">
69 <copy todir="${build.dir}/${classes.dir}/${name}/org/openoffice/setup">
70 <fileset dir="${build.dir}" includes="*.properties"/>
72 <copy todir="${build.dir}/${classes.dir}/${name}/org/openoffice/setup/Icons">
73 <fileset dir="${source.dir}/org/openoffice/setup/Icons" includes="*.gif,*.png"/>
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="**/*"/>
81 <attribute name="Main-Class" value="org.openoffice.setup.Main"/>
86 <!-- CLEAN UP OUTPUT TREES -->
87 <target name="clean" unless="jarFile.uptodate">
88 <!-- <delete dir="${build.dir}"/> -->
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"/>
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"/>