xref: /trunk/main/javainstaller2/build.xml (revision e5e61ed1)
1<?xml version="1.0"?>
2<!--***********************************************************
3 *
4 * Licensed to the Apache Software Foundation (ASF) under one
5 * or more contributor license agreements.  See the NOTICE file
6 * distributed with this work for additional information
7 * regarding copyright ownership.  The ASF licenses this file
8 * to you under the Apache License, Version 2.0 (the
9 * "License"); you may not use this file except in compliance
10 * with the License.  You may obtain a copy of the License at
11 *
12 *   http://www.apache.org/licenses/LICENSE-2.0
13 *
14 * Unless required by applicable law or agreed to in writing,
15 * software distributed under the License is distributed on an
16 * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
17 * KIND, either express or implied.  See the License for the
18 * specific language governing permissions and limitations
19 * under the License.
20 *
21 ***********************************************************-->
22
23
24<project name="javainstaller2" default="build" basedir=".">
25
26  <!-- build output directory -->
27  <property name="name"                   value="JavaSetup"/>
28  <property name="out"                    value="build"/>
29  <property name="classes.dir"            value="classes"/>
30  <property name="source.dir"             location="${basedir}/src/${name}"/>
31  <property name="build.dir"              location="${out}/misc"/>
32  <property name="dist.dir"               location="${out}/bin"/>
33  <property name="compile.debug"          value="true"/>
34  <property name="compile.optimize"       value="false"/>
35  <property name="lib.dir"                location="{$basedir}/lib"/>
36  <property name="verbose"                value="false"/>
37  <property name="javainstaller.jar.file" location="{$basedir}/lib"/>
38
39  <!-- MAIN TARGET -->
40  <target name="build" depends="prepare, info_uptodate, info_notuptodate, compile-javainstaller, jar-javainstaller, clean">
41    <echo message="Done"/>
42  </target>
43
44  <!-- INITIALIZATION TASKS -->
45  <target name="init">
46    <!-- up to date checks -->
47    <uptodate property="jarFile.uptodate" targetfile="${dist.dir}/${name}.jar">
48      <srcfiles dir="${source.dir}" includes="**/*.gif,**/*.png,**/*.java"/>
49      <srcfiles dir="${build.dir}" includes="**/*.properties"/>
50    </uptodate>
51  </target>
52
53  <target name="prepare" depends="init" unless="jarFile.uptodate">
54    <mkdir dir="${build.dir}"/>
55    <mkdir dir="${build.dir}/${classes.dir}"/>
56    <mkdir dir="${build.dir}/${classes.dir}/${name}"/>
57    <mkdir dir="${dist.dir}"/>
58  </target>
59
60  <!-- show information about current sub target in recursive builds -->
61  <target name="info_uptodate" depends="init" if="jarFile.uptodate">
62    <tstamp prefix="start"/>
63    <echo message="--------------------------------------------------------------------------------" />
64    <echo message="Nothing to do. ${dist.dir}/${name}.jar is up to date."/>
65    <echo message="--------------------------------------------------------------------------------" />
66  </target>
67
68  <!-- show information about current sub target in recursive builds -->
69  <target name="info_notuptodate" depends="init" unless="jarFile.uptodate">
70    <tstamp prefix="start"/>
71    <echo message="--------------------------------------------------------------------------------" />
72    <echo message="Source dir: ${source.dir}"/>
73    <echo message="Build dir: ${build.dir}"/>
74    <echo message="Dist dir: ${dist.dir}"/>
75    <echo message="Debug is ${debug}"/>
76    <echo message="--------------------------------------------------------------------------------" />
77  </target>
78
79  <target name="compile-javainstaller" depends="prepare" unless="jarFile.uptodate">
80    <javac  srcdir="${source.dir}" source="1.4" target="1.4"
81            destdir="${build.dir}/${classes.dir}/${name}"
82            debug="${compile.debug}"
83            optimize="${compile.optimize}">
84    </javac>
85    <copy todir="${build.dir}/${classes.dir}/${name}/org/openoffice/setup">
86      <fileset dir="${build.dir}" includes="*.properties"/>
87    </copy>
88    <copy todir="${build.dir}/${classes.dir}/${name}/org/openoffice/setup/Icons">
89      <fileset dir="${source.dir}/org/openoffice/setup/Icons" includes="*.gif,*.png"/>
90    </copy>
91  </target>
92
93  <target name="jar-javainstaller" depends="compile-javainstaller" unless="jarFile.uptodate">
94    <jar file="${dist.dir}/${name}.jar">
95        <fileset dir="${build.dir}/${classes.dir}/${name}" includes="**/*"/>
96        <manifest>
97          <attribute name="Main-Class" value="org.openoffice.setup.Main"/>
98        </manifest>
99    </jar>
100  </target>
101
102  <!-- CLEAN UP OUTPUT TREES -->
103  <target name="clean" unless="jarFile.uptodate">
104   <!-- <delete dir="${build.dir}"/> -->
105  </target>
106
107  <!-- execution section -->
108  <target name="run" depends="jar-javainstaller">
109    <echo message="Starting: java -jar ${dist.dir}/${name}.jar" />
110    <java jar="${dist.dir}/${name}.jar" fork="true"/>
111     <!-- </java> -->
112  </target>
113
114  <target name="debug" depends="jar-javainstaller">
115    <echo message="Starting for debugging: java -jar ${dist.dir}/${name}.jar" />
116    <java jar="${dist.dir}/${name}.jar" fork="true"/>
117     <!-- </java> -->
118</target>
119
120
121</project>
122