source: gs3-extensions/atea-nlp-tools/trunk/src/koreromaori-proxy/build.xml@ 35240

Last change on this file since 35240 was 35240, checked in by davidb, 3 years ago

Add setup file and ANT configuration tasks to allow including the API key and other properties

File size: 3.3 KB
Line 
1<project name="gs3-koreromaori-ext" default="usage" basedir=".">
2 <loadproperties prefix="gs3." srcFile="${basedir}/../../../build.properties" />
3 <property name="src.home" value="${basedir}/src/main/java" />
4 <property name="build.home" value="${basedir}/build" />
5 <property name="web.dir" value="${basedir}/src/main/webapp" />
6
7 <condition property="tomcat.dir" value="${gs3.tomcat.installed.path}" else="${basedir}/../../../packages/tomcat">
8 <and>
9 <isset property="gs3.tomcat.installed.path" />
10 <not>
11 <equals arg1="${gs3.tomcat.installed.path}" arg2="" />
12 </not>
13 </and>
14 </condition>
15
16 <property name="tomcat.webapps.dir" value="${tomcat.dir}/webapps" />
17
18 <path id="compile.classpath">
19 <fileset dir="lib/java">
20 <include name="*.jar" />
21 </fileset>
22 </path>
23
24 <!-- Targets -->
25 <target name="file-checks" description="Ensures that required external files exist.">
26 <fail message="config.properties was not found. Please run ${basedir}/setup.sh">
27 <condition>
28 <not>
29 <available file="${basedir}/config.properties"></available>
30 </not>
31 </condition>
32 </fail>
33 </target>
34
35 <target name="usage" description="Print a help message">
36 <echo message=" Execute 'ant -projecthelp' for a list of targets." />
37 <echo message=" Execute 'ant -help' for Ant help." />
38 </target>
39
40 <target name="compile" description="Compile any java classes.">
41 <property name="build.classes" value="${build.home}/classes" />
42
43 <!-- Reset the build directory -->
44 <delete dir="${build.home}" />
45 <mkdir dir="${build.home}" />
46 <mkdir dir="${build.classes}" />
47
48 <!-- Compile all java files -->
49 <javac srcdir="${src.home}" destdir="${build.classes}" debug="true">
50 <classpath>
51 <path refid="compile.classpath" />
52 </classpath>
53 </javac>
54 </target>
55
56 <target name="package" depends="file-checks,compile" description="Packages the Korero Maori interface into a war file.">
57 <echo message="Creating ${guild.home}/gs3-koreromaori.war" />
58
59 <!-- <copy file="${basedir}/config.properties" todir="${build.classes}" />
60 <echo message="Copied configuration file" /> -->
61 <copy file="${basedir}/log4j2.xml" todir="${build.classes}" />
62
63 <war destfile="${build.home}/gs3-koreromaori.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 tomcat server should already have its own server-api jar -->
69 </lib>
70
71 <classes dir="${build.classes}" />
72 </war>
73 </target>
74
75 <target name="install" depends="package" description="Installs the Korero Maori Interface package.">
76 <echo message="Copying war package to ${tomcat.webapps.dir}" />
77 <copy file="${build.home}/gs3-koreromaori.war" todir="${tomcat.webapps.dir}" />
78 <echo message="Done! Tomcat may take a few seconds to recognise the changes." />
79 </target>
80</project>
Note: See TracBrowser for help on using the repository browser.