update dev300-m58
[ooovba.git] / javainstaller2 / build.xml
blob235b18b94ee2b27100d5b48d59b6ad917b1784bf
1 <?xml version="1.0"?>
3 <!--
4  Copyright 2004 Sun Microsystems, Inc. All rights reserved.
5  SUN PROPRIETARY/CONFIDENTIAL. Use is subject to license terms.
6 -->
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"/>
23   <!-- MAIN TARGET -->
24   <target name="build" depends="prepare, info_uptodate, info_notuptodate, compile-javainstaller, jar-javainstaller, clean">
25     <echo message="Done"/>
26   </target>
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>
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>
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>
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>
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>  
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>
86   <!-- CLEAN UP OUTPUT TREES -->    
87   <target name="clean" unless="jarFile.uptodate">
88    <!-- <delete dir="${build.dir}"/> -->
89   </target>
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>