source: gs3-extensions/mat/trunk/build.xml@ 22001

Last change on this file since 22001 was 22001, checked in by sjm84, 11 years ago

Fixed a recursive library copy

  • Property svn:executable set to *
File size: 4.7 KB
Line 
1<project name="Mat" basedir="." default="main">
2 <property environment="env"/>
3 <property name="gsdl3srchome.dir" value="${env.GSDL3SRCHOME}"/>
4
5 <property name="scripts.dir" value="bin/script"/>
6 <property name="mat.scripts.dir" value="web/script"/>
7 <property name="src.dir" value="src"/>
8 <property name="build.dir" value="build"/>
9 <property name="classes.dir" value="${build.dir}/classes"/>
10 <property name="lib.dir" value="lib"/>
11 <property name="tmp.dir" value="tmp"/>
12 <property name="web.dir" value="${gsdl3srchome.dir}/web/WEB-INF"/>
13 <property name="web.lib.dir" value="${web.dir}/lib"/>
14 <property name="web.classes.dir" value="${web.dir}/classes"/>
15 <property name="jcommon" value="jcommon.jar"/>
16 <property name="jfreechart" value="jfreechart.jar"/>
17 <property name="jni.dir" value="${gsdl3srchome.dir}/lib/jni"/>
18 <property name="tomcat.home" value="${gsdl3srchome.dir}/packages/tomcat"/>
19 <property name="tomcat.lib.dir" value="${tomcat.home}/lib"/>
20 <property name="web.lib.dir" value="${web.dir}/lib"/>
21 <property name="web.class.dir" value="${web.dir}/classes/org/greenstone/mat/servlet"/>
22 <property name="mat.class.dir" value="${classes.dir}/org/greenstone/mat/servlet"/>
23 <property name="mat.classes.dir" value="web/WEB-INF/classes"/>
24
25 <path id="classpath">
26 <fileset dir="${lib.dir}">
27 <include name="**/*.jar"/>
28 </fileset>
29 <dirset dir="${lib.dir}">
30 <include name="**/classes"/>
31 </dirset>
32 </path>
33
34 <target name ="create_log_folder">
35 <mkdir dir="../logs/mat"/>
36 </target>
37
38 <target name="clean">
39 <delete dir="${build.dir}"/>
40 <delete dir="${lib.dir}"/>
41 </target>
42
43 <target name="compile" depends="setup-java-lib,setup-tmp,create_log_folder,move-mat-xml">
44 <mkdir dir="${classes.dir}"/>
45 <javac srcdir="${src.dir}" destdir="${classes.dir}" classpathref="classpath"/>
46
47 <mkdir dir="${web.class.dir}"/>
48 <copy todir="${web.class.dir}">
49 <fileset dir="${mat.class.dir}">
50 <include name="**/*.class"/>
51 </fileset>
52 </copy>
53
54 <copy file="${web.classes.dir}/global.properties" tofile="${mat.classes.dir}/global.properties"/>
55 <copy file="${web.classes.dir}/log4j.properties" tofile="${mat.classes.dir}/log4j.properties"/>
56
57 <mkdir dir="${mat.scripts.dir}"/>
58 <copy todir="${mat.scripts.dir}">
59 <fileset dir="${scripts.dir}"/>
60 </copy>
61
62 <jar destfile="web/WEB-INF/lib/mat.jar">
63 <fileset dir="build/classes">
64 <include name="org/greenstone/mat/**"/>
65 </fileset>
66 <manifest>
67 <attribute name="Class-Path" value="${web.lib.dir}/gsdl3.jar ${jni.dir}/mg.jar ${jni.dir}/mgpp.jar ${web.lib.dir}/log4j-1.2.8.jar ${web.lib.dir}/activation.jar ${web.lib.dir}/mail.jar"/>
68 </manifest>
69 </jar>
70 <jar destfile="guiext.jar">
71 <fileset dir="build/classes">
72 <include name="org/greenstone/admin/**"/>
73 </fileset>
74 </jar>
75 </target>
76
77 <target name="move-mat-xml">
78 <copy file="${basedir}/resources/tomcat/mat.xml" tofile="${tomcat.home}/conf/Catalina/localhost/mat.xml" overwrite="true">
79 <filterset>
80 <filter token="matwebhome" value="${basedir}/web"/>
81 </filterset>
82 </copy>
83 </target>
84
85 <target name="setup-java-lib">
86
87 <mkdir dir="${lib.dir}"/>
88 <copy todir="${lib.dir}">
89 <fileset dir="${web.dir}/lib">
90 <include name="**/*.jar"/>
91 </fileset>
92 </copy>
93
94 <mkdir dir="${lib.dir}/classes"/>
95 <copy todir="${lib.dir}/classes">
96 <fileset dir="${web.dir}/classes"/>
97 </copy>
98
99 <copy todir="${lib.dir}">
100 <fileset dir="${jni.dir}">
101 <include name="**/*.jar"/>
102 </fileset>
103 </copy>
104
105 <copy todir="${lib.dir}">
106 <fileset dir="${tomcat.lib.dir}">
107 <include name="**/servlet-api.jar"/>
108 </fileset>
109 </copy>
110
111 <copy todir="${lib.dir}">
112 <fileset dir="${web.lib.dir}">
113 <include name="xml-apis.jar"/>
114 </fileset>
115 </copy>
116
117 <copy todir="${lib.dir}">
118 <fileset dir="./">
119 <include name="${jcommon}"/>
120 <include name="${jfreechart}"/>
121 </fileset>
122 </copy>
123
124 <mkdir dir="${mat.scripts.dir}"/>
125 <copy todir="${mat.scripts.dir}/script">
126 <fileset dir="resources/script"/>
127 </copy>
128 </target>
129
130 <target name ="clean-tmp">
131 <delete dir="${tmp.dir}"/>
132 <echo> ${tmp.dir} has been removed </echo>
133 </target>
134 <target name ="setup-tmp">
135 <mkdir dir="./tmp"/>
136 <echo> ${tmp.dir} has been created </echo>
137 <echo file="${tmp.dir}/log.txt">This is the log file.</echo>
138 </target>
139 <target name="clean-compile" depends="clean,compile"/>
140
141</project>
Note: See TracBrowser for help on using the repository browser.