| <?xml version="1.0"?> |
| <!--*********************************************************** |
| * |
| * Licensed to the Apache Software Foundation (ASF) under one |
| * or more contributor license agreements. See the NOTICE file |
| * distributed with this work for additional information |
| * regarding copyright ownership. The ASF licenses this file |
| * to you under the Apache License, Version 2.0 (the |
| * "License"); you may not use this file except in compliance |
| * with the License. You may obtain a copy of the License at |
| * |
| * http://www.apache.org/licenses/LICENSE-2.0 |
| * |
| * Unless required by applicable law or agreed to in writing, |
| * software distributed under the License is distributed on an |
| * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY |
| * KIND, either express or implied. See the License for the |
| * specific language governing permissions and limitations |
| * under the License. |
| * |
| ***********************************************************--> |
| |
| |
| <project name="javainstaller2" default="build" basedir="."> |
| |
| <!-- build output directory --> |
| <property name="name" value="JavaSetup"/> |
| <property name="out" value="build"/> |
| <property name="classes.dir" value="classes"/> |
| <property name="source.dir" location="${basedir}/src/${name}"/> |
| <property name="build.dir" location="${out}/misc"/> |
| <property name="dist.dir" location="${out}/bin"/> |
| <property name="compile.debug" value="true"/> |
| <property name="compile.optimize" value="false"/> |
| <property name="lib.dir" location="{$basedir}/lib"/> |
| <property name="verbose" value="false"/> |
| <property name="javainstaller.jar.file" location="{$basedir}/lib"/> |
| |
| <!-- MAIN TARGET --> |
| <target name="build" depends="prepare, info_uptodate, info_notuptodate, compile-javainstaller, jar-javainstaller, clean"> |
| <echo message="Done"/> |
| </target> |
| |
| <!-- INITIALIZATION TASKS --> |
| <target name="init"> |
| <!-- up to date checks --> |
| <uptodate property="jarFile.uptodate" targetfile="${dist.dir}/${name}.jar"> |
| <srcfiles dir="${source.dir}" includes="**/*.gif,**/*.png,**/*.java"/> |
| <srcfiles dir="${build.dir}" includes="**/*.properties"/> |
| </uptodate> |
| </target> |
| |
| <target name="prepare" depends="init" unless="jarFile.uptodate"> |
| <mkdir dir="${build.dir}"/> |
| <mkdir dir="${build.dir}/${classes.dir}"/> |
| <mkdir dir="${build.dir}/${classes.dir}/${name}"/> |
| <mkdir dir="${dist.dir}"/> |
| </target> |
| |
| <!-- show information about current sub target in recursive builds --> |
| <target name="info_uptodate" depends="init" if="jarFile.uptodate"> |
| <tstamp prefix="start"/> |
| <echo message="--------------------------------------------------------------------------------" /> |
| <echo message="Nothing to do. ${dist.dir}/${name}.jar is up to date."/> |
| <echo message="--------------------------------------------------------------------------------" /> |
| </target> |
| |
| <!-- show information about current sub target in recursive builds --> |
| <target name="info_notuptodate" depends="init" unless="jarFile.uptodate"> |
| <tstamp prefix="start"/> |
| <echo message="--------------------------------------------------------------------------------" /> |
| <echo message="Source dir: ${source.dir}"/> |
| <echo message="Build dir: ${build.dir}"/> |
| <echo message="Dist dir: ${dist.dir}"/> |
| <echo message="Debug is ${debug}"/> |
| <echo message="--------------------------------------------------------------------------------" /> |
| </target> |
| |
| <target name="compile-javainstaller" depends="prepare" unless="jarFile.uptodate"> |
| <javac srcdir="${source.dir}" source="1.4" target="1.4" |
| destdir="${build.dir}/${classes.dir}/${name}" |
| debug="${compile.debug}" |
| optimize="${compile.optimize}"> |
| </javac> |
| <copy todir="${build.dir}/${classes.dir}/${name}/org/openoffice/setup"> |
| <fileset dir="${build.dir}" includes="*.properties"/> |
| </copy> |
| <copy todir="${build.dir}/${classes.dir}/${name}/org/openoffice/setup/Icons"> |
| <fileset dir="${source.dir}/org/openoffice/setup/Icons" includes="*.gif,*.png"/> |
| </copy> |
| </target> |
| |
| <target name="jar-javainstaller" depends="compile-javainstaller" unless="jarFile.uptodate"> |
| <jar file="${dist.dir}/${name}.jar"> |
| <fileset dir="${build.dir}/${classes.dir}/${name}" includes="**/*"/> |
| <manifest> |
| <attribute name="Main-Class" value="org.openoffice.setup.Main"/> |
| </manifest> |
| </jar> |
| </target> |
| |
| <!-- CLEAN UP OUTPUT TREES --> |
| <target name="clean" unless="jarFile.uptodate"> |
| <!-- <delete dir="${build.dir}"/> --> |
| </target> |
| |
| <!-- execution section --> |
| <target name="run" depends="jar-javainstaller"> |
| <echo message="Starting: java -jar ${dist.dir}/${name}.jar" /> |
| <java jar="${dist.dir}/${name}.jar" fork="true"/> |
| <!-- </java> --> |
| </target> |
| |
| <target name="debug" depends="jar-javainstaller"> |
| <echo message="Starting for debugging: java -jar ${dist.dir}/${name}.jar" /> |
| <java jar="${dist.dir}/${name}.jar" fork="true"/> |
| <!-- </java> --> |
| </target> |
| |
| |
| </project> |