-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbuild.xml
125 lines (107 loc) · 5.18 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
<project name="BohnetsTagger" basedir="." default="war" xmlns:ivy="antlib:org.apache.ivy.ant">
<!--
BohnetsTagger
Build file for the project BohnetsTagger
Part of DK-CLARIN
Author: Bart Jongejan
-->
<property environment="env"/>
<!-- Define Ivy stuff -->
<property name="ivy.install.version" value="2.2.0" />
<property name="ivy.jar.dir" value="${basedir}/lib" />
<property name="ivy.jar.file" value="${ivy.jar.dir}/ivy.jar" />
<property name="central.repo" value="https://repo1.maven.org/maven2" />
<property name="jboss.repo" value="https://repository.jboss.org/maven2" />
<!-- Define folder names -->
<property name="lib.dir" value="lib"/>
<!--property name="globallib.dir" value="C:\Program Files\JBoss.org\JBoss Web 2.1\lib"/--><!--property name="globallib.dir" value="WEB-INF\lib"/-->
<property name="src.dir" value="src"/>
<property name="class.dir" value="classes"/>
<property name="javadoc.dir" value="javadoc"/>
<property name="jar.dir" value="jar"/>
<property name="war.dir" value="war"/>
<property name="web.dir" value="web-source"/>
<property name="conf.dir" value="conf"/>
<!-- Set Classpath equal to what is needed -->
<path id="classpath">
<fileset dir="${lib.dir}" includes="**/*.jar"/>
</path>
<!-- Delete everything autogenerated -->
<target name="clean" description="Clean the project">
<delete dir="${class.dir}"/>
<delete dir="${war.dir}" />
<delete dir="${jar.dir}"/>
<delete dir="${javadoc.dir}" />
</target>
<!-- Delete everything autogenerated, including downloaded libs and ivy.xml -->
<target name="clean-all" depends="clean" description="Delete everything autogenerated, including downloaded libs">
<delete file="ivy.xml" />
<delete dir="${lib.dir}" />
<delete dir="${ivy.jar.dir}" />
</target>
<target name="download-ivy" if="ivy">
<mkdir dir="${ivy.jar.dir}" />
<!-- download Ivy from web site so that it can be used even without any special installation -->
<echo message="installing ivy..." />
<get src="${central.repo}/org/apache/ivy/ivy/${ivy.install.version}/ivy-${ivy.install.version}.jar" dest="${ivy.jar.file}" usetimestamp="true" />
</target>
<!-- Install Ivy. Only run on first compile -->
<target name="install-ivy" depends="download-ivy" description="--> install ivy">
<path id="ivy.lib.path">
<fileset dir="${ivy.jar.dir}" includes="*.jar" />
</path>
<taskdef resource="org/apache/ivy/ant/antlib.xml" uri="antlib:org.apache.ivy.ant" classpathref="ivy.lib.path" />
<ivy:settings file="${conf.dir}/ivy.settings.xml" />
</target>
<target name="resolve" depends="install-ivy" description="--> retrieve dependencies with ivy" if="ivy">
<ivy:retrieve />
</target>
<!-- if -Dprod=true is used, copy the production conf file to conf dir -->
<target name="is-prod" if="prod">
<copy overwrite="true" file="properties_prod.xml" tofile="${conf.dir}/properties.xml"/>
<copy overwrite="true" file="ivy_tomcat.xml" tofile="ivy.xml"/>
<copy overwrite="true" file="anna-3.6.jar" tofile="${lib.dir}/anna-3.6.jar"/>
<!--<copy overwrite="true" file="${env.CATALINA_HOME}/${lib.dir}/servlet-api.jar" tofile="${ivy.jar.dir}/servlet-api.jar"/>-->
<delete file="${ivy.jar.dir}/slf4j-log4j12-1.5.8.jar"/>
<delete file="${ivy.jar.dir}/slf4j-api-1.5.8.jar"/>
</target>
<!-- Set the appropriate environment -->
<target name="envir" depends="is-prod"/>
<!--Compile the module, clean first -->
<target name="compile" depends="clean, resolve, envir" description="Compiles the whole bundle">
<mkdir dir="${class.dir}"/>
<javac srcdir="${src.dir}" destdir="${class.dir}" classpathref="classpath" encoding="utf-8" debuglevel="lines,vars,source" debug="true" >
<compilerarg value="-Xlint:unchecked"/>
<!--compilerarg value="-Xlint"/-->
</javac>
</target>
<!--Make jar files -->
<target name="jar" depends="compile" description="Jar the project">
<mkdir dir="${jar.dir}"/>
<jar destfile="${jar.dir}/${ant.project.name}.jar" basedir="${class.dir}">
<manifest>
<!-- don't write anything in MANIFEST.MF -->
</manifest>
</jar>
</target>
<!-- Pack as war file -->
<target name="war" depends="envir, jar" description="Pack to servlet war">
<mkdir dir="${war.dir}"/>
<war destfile="${war.dir}/${ant.project.name}.war" webxml="web.xml">
<fileset dir="${web.dir}"/>
<lib dir="${jar.dir}"/>
<lib dir="${lib.dir}">
<exclude name="**/servlet.jar"/>
<exclude name="**/servlet-api.jar"/>
</lib>
<classes dir="${conf.dir}"/>
</war>
</target>
<!-- Create javadocs -->
<target name="javadoc" description="Create Javadocs">
<mkdir dir="${javadoc.dir}" />
<javadoc destdir="${javadoc.dir}">
<fileset dir="${src.dir}/" includes="**/*.java" />
</javadoc>
</target>
</project>