1 | <?xml version="1.0" encoding="UTF-8" standalone="yes"?>
|
---|
2 | <project basedir="." default="war" name="TheMacronizer">
|
---|
3 |
|
---|
4 | <property environment="env"/>
|
---|
5 |
|
---|
6 | <property name="dist.dir.exp" location="releases" />
|
---|
7 |
|
---|
8 | <property name="dist.filename.exp" value="TheMacronizer.war" />
|
---|
9 | <property name="build.dir.exp" location="web" />
|
---|
10 | <property name="lib.dir.exp" location="web/WEB-INF/lib" />
|
---|
11 | <property name="webinf.dir" location="web/WEB-INF" />
|
---|
12 |
|
---|
13 | <!--
|
---|
14 | If changing these values, make sure you run 'ant clean'
|
---|
15 | -->
|
---|
16 | <property name="javac.source" value="1.8" />
|
---|
17 | <property name="javac.target" value="${javac.source}" />
|
---|
18 | <property name="javac.debug" value="true" />
|
---|
19 |
|
---|
20 |
|
---|
21 | <path id="classpath.exp">
|
---|
22 | <fileset dir="${lib.dir.exp}">
|
---|
23 | <include name="*.jar" />
|
---|
24 | </fileset>
|
---|
25 | </path>
|
---|
26 |
|
---|
27 |
|
---|
28 | <target name="clean">
|
---|
29 | <!-- delete only the class files built by themacronizer -->
|
---|
30 | <delete dir="${build.dir.exp}/WEB-INF/classes"/>
|
---|
31 | </target>
|
---|
32 |
|
---|
33 |
|
---|
34 | <target name="init">
|
---|
35 | <echo message="${ant.project.name}: ${ant.file}"/>
|
---|
36 | <mkdir dir="${build.dir.exp}/WEB-INF/classes"/>
|
---|
37 | <mkdir dir="${build.dir.exp}/WEB-INF/classes/monogram"/>
|
---|
38 | <copy includeemptydirs="false" todir="${build.dir.exp}/WEB-INF/classes/monogram/data">
|
---|
39 | <fileset dir="src/java/monogram/data" />
|
---|
40 | </copy>
|
---|
41 | </target>
|
---|
42 |
|
---|
43 | <target name="build" depends="init">
|
---|
44 | <javac source="${javac.source}" target="${javac.target}" debug="${javac.debug}"
|
---|
45 | encoding="utf-8"
|
---|
46 | destdir="${build.dir.exp}/WEB-INF/classes" includeantruntime="false">
|
---|
47 | <src path="src"/>
|
---|
48 |
|
---|
49 | <classpath>
|
---|
50 | <path refid="classpath.exp"/>
|
---|
51 | <pathelement location="src/jars/servlet-api.jar"/>
|
---|
52 | <pathelement path="src/java"/>
|
---|
53 | <pathelement path="webinf.dir"/>
|
---|
54 | </classpath>
|
---|
55 | </javac>
|
---|
56 |
|
---|
57 | <!-- http://ant.apache.org/manual/Tasks/copy.html
|
---|
58 | By default, files are only copied if the source file is newer than the destination file,
|
---|
59 | or when the destination file does not exist. However, you can explicitly overwrite files
|
---|
60 | with the overwrite attribute.-->
|
---|
61 | <copy file="${build.dir.exp}/log4j.properties.in" tofile="/greenstone/greenstone3/web/WEB-INF/classes/log4j.properties"/>
|
---|
62 |
|
---|
63 | <!-- mkdir Creates a directory. Also non-existent parent directories are created,
|
---|
64 | when necessary. Does nothing if the directory already exist. -->
|
---|
65 | <mkdir dir="${build.dir.exp}/logs"/>
|
---|
66 | </target>
|
---|
67 |
|
---|
68 |
|
---|
69 | <target name="war" depends="build">
|
---|
70 | <jar destfile="${dist.filename.exp}">
|
---|
71 | <fileset dir="${build.dir.exp}" />
|
---|
72 | </jar>
|
---|
73 | </target>
|
---|
74 |
|
---|
75 | </project>
|
---|