/
build.xml
139 lines (120 loc) · 4.57 KB
/
build.xml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
<project name="sigmanlp" default="all" basedir=".">
<property environment="env"/>
<property name="compiler.debug" value="on"/>
<property name="app.name" value="sigmanlp"/>
<property name="build.home" value="build"/>
<property name="sigmakee.home" value="${env.SIGMA_SRC}" />
<property name="tomcat.home" value="${env.CATALINA_HOME}"/>
<property name="deploy.home" value="${tomcat.home}/webapps/${app.name}"/>
<property name="build.classes" value="${basedir}/build/classes"/>
<property name="build.lib" value="${basedir}/build/lib"/>
<property name="deploy.classes" value="${deploy.home}/WEB-INF/classes"/>
<property name="deploy.lib" value="${deploy.home}/WEB-INF/lib"/>
<property name="dist.home" value="${tomcat.home}/webapps"/>
<property name="dist.war" value="sigmanlp.war"/>
<path id="output.classpath">
<pathelement location="${output}"/>
<fileset dir="${build.lib}">
<include name="*.jar"/>
</fileset>
</path>
<path id="compile.classpath">
<fileset dir="${basedir}/lib">
<include name="*.jar"/>
</fileset>
<fileset dir="${sigmakee.home}/lib">
<include name="*.jar"/>
</fileset>
</path>
<path id="sourcepath">
<dirset dir="${basedir}">
<include name="src/main/java"/>
<include name="src/test"/>
</dirset>
</path>
<target name="init">
<echo message="SIGMA_HOME is set to = ${env.SIGMA_HOME}"/>
<echo message="sigmakee is set to = ${env.SIGMA_SRC}"/>
<echo>sigmakee home: ${sigmakee.home}</echo>
<ant antfile="../sigmakee/build.xml" inheritAll="false" target="all" />
<copy todir="${basedir}/lib" file="${sigmakee.home}/build/sigmakee.jar" />
<ant antfile="../SigmaUtils/build.xml" inheritAll="false" target="all" />
<copy todir="${basedir}/lib" file="../SigmaUtils/sigmaUtils.jar" />
</target>
<target name="compile" depends="init" description="Compile sigmanlp">
<mkdir dir="${build.classes}"/>
<javac destdir="${build.classes}" debug="on" optimize="on" deprecation="on" classpathref="compile.classpath" fork="true">
<src refid="sourcepath"/>
</javac>
<copy todir="${build.classes}">
<fileset dir="${basedir}/src/main/java">
<include name="*.class"/>
</fileset>
<fileset dir="${basedir}/src/test">
<include name="*.class"/>
</fileset>
</copy>
<copy todir="${build.lib}">
<fileset dir="${basedir}/lib" />
<fileset dir="${sigmakee.home}/lib" />
</copy>
</target>
<target name="clean" description="cleanup module">
<delete dir="${build.classes}"/>
<delete dir="${build.lib}"/>
</target>
<target name="web_deploy" depends="compile" description="deploy code to sigma.war">
<!-- Make the root. -->
<mkdir dir="${deploy.home}"/>
<!-- Delete the old code -->
<delete includeemptydirs="true" failonerror="false">
<fileset dir="${deploy.home}"/>
<fileset dir="${tomcat.home}/work/Catalina/localhost/${app.name}"/>
</delete>
<!-- Copy all the *.jsp, *.xsl, *.html, pixmaps, etc. -->
<copy todir="${deploy.home}">
<fileset dir="web/jsp"/>
</copy>
<copy todir="${deploy.home}">
<fileset file="web/simple.css"/>
</copy>
<copy todir="${deploy.home}/brat">
<fileset dir="web/brat"/>
</copy>
<copy todir="${deploy.home}/js">
<fileset dir="web/js"/>
</copy>
<copy todir="${deploy.home}/pixmaps">
<fileset dir="web/pixmaps"/>
</copy>
<mkdir dir="${deploy.lib}"/>
<copy todir="${deploy.lib}">
<fileset file="${build.lib}/*.jar" />
</copy>
<!-- Create WEB-INF/classes/ and copy all the loose classes to it. -->
<mkdir dir="${deploy.classes}"/>
<copy todir="${deploy.classes}">
<fileset dir="${build.classes}"/>
</copy>
</target>
<target name="dist" depends="web_deploy" description="Create the *.war file and place in ${build.home}.">
<war warfile="${dist.home}/${dist.war}" webxml="web.xml">
<fileset dir="web/jsp"/>
<fileset dir="web/brat"/>
<fileset dir="web/js"/>
<fileset file="web/simple.css"/>
<zipfileset dir="web/pixmaps" prefix="pixmaps"/>
<lib dir="${deploy.lib}"/>
<classes dir="${deploy.classes}"/>
</war>
<jar destfile="${build.home}/sigmanlp.jar">
<fileset dir="${deploy.classes}"/>
</jar>
</target>
<target name="all" depends="clean, init, compile, dist" description="build all">
<tstamp>
<format property="TODAY_US" pattern="yyyy-MM-dd HH:mm:ss:sss zzz" locale="en,US"/>
</tstamp>
<echo>the system date/time is ${TODAY_US}</echo>
</target>
</project>