1 | <?xml version="1.0" encoding="UTF-8"?>
|
---|
2 |
|
---|
3 | <project name="gs3-koreromaori-ext" default="usage" basedir=".">
|
---|
4 | <property name="package.name" value="gs3-koreromaori" />
|
---|
5 | <property environment="env"/>
|
---|
6 | <property name="gsdl3.src.home" value="${env.GSDL3SRCHOME}"/>
|
---|
7 | <property name="src.home" value="${basedir}/src/main/java" />
|
---|
8 | <property name="build.home" value="${basedir}/build" />
|
---|
9 | <property name="web.dir" value="${basedir}/src/main/webapp" />
|
---|
10 | <property name="tomcat.webapps.dir" value="${gsdl3.src.home}/packages/tomcat/webapps" />
|
---|
11 |
|
---|
12 | <path id="compile.classpath">
|
---|
13 | <fileset dir="lib/java">
|
---|
14 | <include name="*.jar" />
|
---|
15 | </fileset>
|
---|
16 | </path>
|
---|
17 |
|
---|
18 | <!-- Targets -->
|
---|
19 | <target name="usage" description="Print a help message">
|
---|
20 | <echo message=" Execute 'ant -projecthelp' for a list of targets." />
|
---|
21 | <echo message=" Execute 'ant -help' for Ant help." />
|
---|
22 | </target>
|
---|
23 |
|
---|
24 | <target name="gs3-setup" description="Ensures that the gs3-setup script has been sourced.">
|
---|
25 | <fail message="Please run 'gs3-setup' (Windows) or 'source gs3-setup.sh' (Linux/Mac) in the Greenstone3 installation that's associated with this installation before running this step.">
|
---|
26 | <condition>
|
---|
27 | <not>
|
---|
28 | <isset property="env.GSDL3HOME" />
|
---|
29 | </not>
|
---|
30 | </condition>
|
---|
31 | </fail>
|
---|
32 | </target>
|
---|
33 |
|
---|
34 | <target name="file-checks" description="Ensures that required external files exist.">
|
---|
35 | <fail message="config.properties was not found. Please run ${basedir}/setup.sh">
|
---|
36 | <condition>
|
---|
37 | <not>
|
---|
38 | <available file="${basedir}/config.properties"></available>
|
---|
39 | </not>
|
---|
40 | </condition>
|
---|
41 | </fail>
|
---|
42 | </target>
|
---|
43 |
|
---|
44 | <target name="compile" description="Compile any java classes.">
|
---|
45 | <property name="build.classes" value="${build.home}/classes" />
|
---|
46 |
|
---|
47 | <!-- Reset the build directory -->
|
---|
48 | <delete dir="${build.home}" />
|
---|
49 | <mkdir dir="${build.home}" />
|
---|
50 | <mkdir dir="${build.classes}" />
|
---|
51 |
|
---|
52 | <!-- Compile all java files -->
|
---|
53 | <javac srcdir="${src.home}" destdir="${build.classes}" debug="true">
|
---|
54 | <classpath>
|
---|
55 | <path refid="compile.classpath" />
|
---|
56 | </classpath>
|
---|
57 | </javac>
|
---|
58 | </target>
|
---|
59 |
|
---|
60 | <target name="package" depends="file-checks,compile" description="Packages the Korero Maori interface into a war file.">
|
---|
61 | <echo message="Creating ${build.home}/${package.name}.war" />
|
---|
62 |
|
---|
63 | <war destfile="${build.home}/${package.name}.war" webxml="${web.dir}/WEB-INF/web.xml">
|
---|
64 | <fileset dir="${web.dir}/webContent" includes="**" />
|
---|
65 | <fileset file="${basedir}/config.properties" />
|
---|
66 |
|
---|
67 | <lib dir="lib/java">
|
---|
68 | <exclude name="tomcat-servlet-api-8.5.51.jar" /> <!-- The host should already have its own servlet API jar -->
|
---|
69 | </lib>
|
---|
70 | <classes dir="${build.classes}" />
|
---|
71 |
|
---|
72 | <webinf dir="${web.dir}/WEB-INF" />
|
---|
73 | </war>
|
---|
74 | </target>
|
---|
75 |
|
---|
76 | <target name="install" depends="gs3-setup,package" description="Installs the Korero Maori Interface package.">
|
---|
77 | <echo message="Copying war package to ${tomcat.webapps.dir}" />
|
---|
78 | <copy file="${build.home}/${package.name}.war" todir="${tomcat.webapps.dir}" />
|
---|
79 | <echo message="Done! Tomcat may take a few seconds to recognise the changes." />
|
---|
80 | </target>
|
---|
81 | </project>
|
---|