3 <project name="jSite" default="compile">
5 <!-- create this file if you want to re-distribute jSite -->
6 <property file="build.properties" />
8 <!-- default values if no build.properties is present -->
9 <property name="version" value="custom" />
10 <property name="javac.debug" value="false" />
12 <property name="src.dir" value="${basedir}/src" />
13 <property name="bin.dir" value="${basedir}/build" />
14 <property name="dist.dir" value="${basedir}/dist" />
15 <property name="images.dir" value="${basedir}/images" />
17 <!-- if the next lines fails, disable or delete it. you don't need it. unless you stole my development machine. -->
18 <available filepath="${basedir}/../todesbaum-lib" file="build.xml" property="maintainer-build" />
19 <available filepath="${basedir}/../todesbaum-lib" file="build.xml" property="todesbaum.src" value="${basedir}/../todesbaum-lib/src" />
21 <!-- default values for non-maintainer builds -->
22 <property name="todesbaum.src" value="${src.dir}" />
24 <target name="prepare">
25 <mkdir dir="${bin.dir}" />
28 <target name="compile-maintainer" depends="prepare" if="maintainer-build">
29 <javac destdir="${bin.dir}" debug="false" optimize="true">
30 <src path="${src.dir}" />
31 <sourcepath path="${todesbaum.src}" />
35 <target name="compile-non-maintainer" depends="prepare" unless="maintainer-build">
36 <javac destdir="${bin.dir}" debug="false" optimize="true">
37 <src path="${src.dir}" />
38 <sourcepath path="${todesbaum.src}" />
42 <target name="compile" depends="compile-maintainer, compile-non-maintainer" description="compile jSite">
43 <copy todir="${bin.dir}">
44 <fileset dir="${src.dir}">
45 <include name="**/*.properties" />
47 <fileset dir="${images.dir}">
48 <include name="**/*.png" />
53 <target name="clean" description="cleans the build environment">
54 <delete dir="${bin.dir}" />
57 <target name="dist-clean" depends="clean" description="cleans build and distribution environments">
58 <delete dir="${dist.dir}" />
61 <target name="prepare-dist">
62 <mkdir dir="${dist.dir}" />
65 <target name="prepare-src-dist" depends="prepare-dist">
66 <mkdir dir="${dist.dir}/${ant.project.name}-${version}" />
67 <mkdir dir="${dist.dir}/${ant.project.name}-${version}/src" />
68 <mkdir dir="${dist.dir}/${ant.project.name}-${version}/images" />
71 <target name="jar" depends="compile, prepare-dist" description="creates jSite jar file">
72 <jar destfile="${dist.dir}/${ant.project.name}-${version}.jar">
73 <fileset dir="${bin.dir}" />
75 <attribute name="Main-Class" value="de.todesbaum.jsite.main.Main"/>
80 <target name="dist-bin-zip" depends="jar" description="create binary distribution zip">
81 <zip destfile="${dist.dir}/${ant.project.name}-${version}-bin.zip">
82 <fileset dir="${dist.dir}">
83 <include name="${ant.project.name}-${version}.jar" />
85 <fileset dir="${basedir}">
86 <include name="COPYING" />
91 <target name="dist-bin-tbz2" depends="jar" description="create binary distribution tar.bz2">
92 <tar destfile="${dist.dir}/${ant.project.name}-${version}-bin.tar.bz2" compression="bzip2">
93 <tarfileset dir="${dist.dir}">
94 <include name="${ant.project.name}-${version}.jar" />
96 <tarfileset dir="${basedir}">
97 <include name="COPYING" />
102 <target name="dist-bin" depends="dist-bin-zip, dist-bin-tbz2"/>
104 <target name="collect-maintainer-src" depends="prepare-src-dist" if="maintainer-build">
105 <copy todir="${dist.dir}/${ant.project.name}-${version}/src">
106 <fileset dir="${todesbaum.src}">
107 <includesfile name="build.collect-src.files" />
112 <target name="collect-src" depends="prepare-src-dist, collect-maintainer-src">
113 <copy todir="${dist.dir}/${ant.project.name}-${version}/src">
114 <fileset dir="${src.dir}">
115 <include name="**/*.java" />
116 <include name="**/*.properties" />
119 <copy todir="${dist.dir}/${ant.project.name}-${version}/images">
120 <fileset dir="${images.dir}">
121 <include name="**/*.png" />
124 <copy todir="${dist.dir}/${ant.project.name}-${version}">
125 <fileset dir="${basedir}">
126 <include name="COPYING" />
127 <include name="build.xml" />
132 <target name="dist-src" depends="dist-src-zip, dist-src-tbz2" />
134 <target name="dist-src-zip" depends="collect-src" description="create source distribution zip">
135 <zip destfile="${dist.dir}/${ant.project.name}-${version}-src.zip">
136 <fileset dir="${dist.dir}">
137 <include name="${ant.project.name}-${version}/**/*" />
142 <target name="dist-src-tbz2" depends="collect-src" description="create source distribution tar.bz2">
143 <tar destfile="${dist.dir}/${ant.project.name}-${version}-src.tar.bz2" compression="bzip2">
144 <tarfileset dir="${dist.dir}">
145 <include name="${ant.project.name}-${version}/**/*" />
150 <target name="dist" depends="dist-bin, dist-src" description="creates all distribution files"/>
152 <target name="build-collect-src" depends="clean, compile" if="maintainer-build">
153 <exec executable="/bin/sh" output="build.collect-src.files">
155 <arg value="find build -type f | grep -v '\$' | sed 's,^build/,,' | grep '^de/todesbaum/util/' | sed 's,class$,java,'" />