| 1 | <?xml version="1.0"?> |
| 2 | |
| 3 | <project name="bsvc" default="war"> |
| 4 | |
| 5 | <target name="build-env"> |
| 6 | <mkdir dir="build" /> |
| 7 | <mkdir dir="build/bin" /> |
| 8 | <fail message="You need to add the files jsvc.jar and bsh.jar to the lib directory manually."> |
| 9 | <condition> |
| 10 | <not><and><available file="lib/jsvc.jar" /><available file="lib/bsh.jar" /></and></not> |
| 11 | </condition> |
| 12 | </fail> |
| 13 | </target> |
| 14 | |
| 15 | <target name="bin" depends="build-env"> |
| 16 | <javac srcdir="src" destdir="build/bin" debug="on"> |
| 17 | <classpath> |
| 18 | <pathelement location="lib/jsvc.jar" /> |
| 19 | <pathelement location="lib/bsh.jar" /> |
| 20 | </classpath> |
| 21 | <!-- <compilerarg value="-Xlint:unchecked" /> --> |
| 22 | </javac> |
| 23 | </target> |
| 24 | |
| 25 | <target name="bin-jar" depends="bin"> |
| 26 | <copy todir="build/bin" file="etc/jsvc.properties" /> |
| 27 | <copy todir="build/bin/dolda/bsvc/static"> |
| 28 | <fileset dir="static"> |
| 29 | <!-- <include name="static/**" /> --> |
| 30 | </fileset> |
| 31 | </copy> |
| 32 | <jar destfile="build/bsvc.jar" basedir="build/bin" /> |
| 33 | </target> |
| 34 | |
| 35 | <target name="war" depends="bin-jar"> |
| 36 | <taskdef name="jsvc-war" classname="dolda.jsvc.j2ee.Archive$AntTask" classpath="lib/jsvc.jar" /> |
| 37 | <jsvc-war destfile="build/bsvc.war"> |
| 38 | <jars dir="."> |
| 39 | <include name="build/bsvc.jar" /> |
| 40 | <include name="lib/*.jar" /> |
| 41 | </jars> |
| 42 | </jsvc-war> |
| 43 | </target> |
| 44 | |
| 45 | <target name="clean"> |
| 46 | <delete dir="build" /> |
| 47 | </target> |
| 48 | </project> |