1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123
|
<!-- (jEdit options) :folding=explicit:collapseFolds=1: -->
<project name="cmdline" default="dist" basedir=".">
<description>My experiment at making standalone cmdline java tools that use things in king</description>
<!-- global properties that we always want defined {{{ -->
<property name="src" location="src"/>
<property name="resource" location="resource"/>
<property name="build" location="build"/>
<property name="dist" location="dist"/>
<!-- Version control: creates timestamp, updates ${buildnum}, loads ${version} -->
<target name="init">
<tstamp>
<format property="DSTAMP_SIX" pattern="yyMMdd"/>
</tstamp>
<propertyfile file="${resource}/${ant.project.name}/buildnum.props">
<entry key="buildnum" value="${DSTAMP}.${TSTAMP}"/>
</propertyfile>
<property file="${resource}/${ant.project.name}/buildnum.props"/>
<property file="${resource}/${ant.project.name}/version.props"/>
</target>
<!-- }}} -->
<!-- build, compile {{{ -->
<!-- Bundles up all needed class and resource files into a JAR -->
<target name="build" description="Build class files" depends="init,compile">
<echo message="Version ${version}"/>
<echo message="Build # ${buildnum}"/>
<jar jarfile="${ant.project.name}.jar" manifest="Manifest.mf" index="false">
<fileset dir="${build}"/>
<fileset dir="${resource}"/>
<fileset dir="../driftwood/build/">
<!--<exclude name="driftwood/moldb*/"/>-->
</fileset>
<fileset dir="../driftwood/resource/">
<!--<exclude name="driftwood/moldb*/"/>-->
</fileset>
<fileset dir="../king/build/">
<!--<exclude name="driftwood/moldb*/"/>-->
</fileset>
<fileset dir="../king/resource/">
<!--<exclude name="driftwood/moldb*/"/>-->
</fileset>
<fileset dir="../molikin/build/">
</fileset>
</jar>
</target>
<!-- Compiles all .java files for this package -->
<target name="compile" depends="init">
<ant antfile="../driftwood/build.xml" inheritAll="false" target="compile">
<!-- inherited properties go here -->
</ant>
<ant antfile="../king/build.xml" inheritAll="false" target="compile">
<!-- inherited properties go here -->
</ant>
<mkdir dir="${build}"/>
<javac srcdir="${src}"
destdir="${build}"
includes="**/*.java"
excludes="**/old/"
debug="on" debuglevel="lines,source"
target="1.5" source="1.5">
<classpath>
<pathelement location="../driftwood/build"/>
<pathelement location="../king/build"/>
<pathelement location="../molikin/build"/>
<pathelement location="../chiropraxis/build"/>
</classpath>
</javac>
</target>
<!-- }}} -->
<!-- dist, dist-src, dist-exe {{{ -->
<!-- Makes .zip and .tgz files from the ${dist} directory -->
<target name="dist" description="Generate the distributions" depends="init,clean,build,dist-src,dist-exe">
<zip destfile="${dist}/${ant.project.name}-${version}-src.zip">
<zipfileset dir="${dist}" includes="${ant.project.name}-${version}-src/"/>
<zipfileset dir="../driftwood/dist/" includes="driftwood-*-src/"/>
</zip>
<zip basedir="${dist}"
destfile="${dist}/${ant.project.name}-${version}.zip"
includes="${ant.project.name}-${version}/"/>
</target>
<!-- Makes the source code distribution -->
<target name="dist-src" depends="init">
<ant antfile="../driftwood/build.xml" inheritAll="false" target="dist-src">
<!-- inherited properties go here -->
</ant>
<mkdir dir="${dist}/${ant.project.name}-${version}-src"/>
<copy todir="${dist}/${ant.project.name}-${version}-src" preservelastmodified="true">
<fileset dir="${basedir}">
<exclude name="build/"/>
<exclude name="dist/"/>
<exclude name="**/old/"/>
</fileset>
</copy>
</target>
<!-- Makes the end-user distribution -->
<target name="dist-exe" depends="init,build">
<mkdir dir="${dist}/${ant.project.name}-${version}"/>
<copy todir="${dist}/${ant.project.name}-${version}" preservelastmodified="true">
<fileset dir="${basedir}">
<include name="${ant.project.name}.jar"/>
<include name="README*"/>
<include name="LICENSE*"/>
<include name="doc/"/>
<exclude name="doc/work/"/>
</fileset>
</copy>
</target>
<!-- }}} -->
<!-- clean, backup {{{ -->
<!-- Removes products of compilation -->
<target name="clean" description="Clean up build/ and dist/">
<delete dir="${dist}"/>
<delete dir="${build}"/>
<delete file="${ant.project.name}.jar"/>
</target>
</project>
|