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