-
Notifications
You must be signed in to change notification settings - Fork 2
/
build.xml
195 lines (171 loc) · 9.65 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
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
<?xml version="1.0"?>
<project name="eSciDocCoreSrw" basedir="." default="war" xmlns:artifact="antlib:org.apache.maven.artifact.ant">
<property name="webapp.name" value="srw" />
<property name="project.name" value="eSciDocCoreSrw" />
<property name="nolibs.webapp.name" value="${webapp.name}-nolibs" />
<property name="build.dir" value="build" />
<property name="bin.dir" value="bin" />
<property name="dist.dir" value="dist" />
<property name="src.dir" value="src" />
<property name="lib.dir" value="lib" />
<property name="conf.dir" value="conf" />
<property name="sources.dir" value="sources" />
<property name="docu.dir" value="docu" />
<property name="stylesheets.dir" value="${conf.dir}/stylesheets" />
<property name="images.dir" value="${conf.dir}/escidoc/images" />
<property name="escidoc.conf.dir" value="${conf.dir}/escidoc" />
<property name="escidoc.srw.jarfile.name" value="eSciDocCoreSrw.jar" />
<!-- properties for deployment to Artifactory -->
<property name="artifactory.url" value="https://www.escidoc.org/artifactory/libs-releases-local" />
<!-- build version, user name and password must be given from the command line via -Dbuild.version=... -Dusername=... -Dpassword=... -->
<property name="artifactory.user" value="${username}" />
<property name="artifactory.password" value="${password}" />
<target name="clean" description="Clean all build products.">
<mkdir dir="${build.dir}"/>
<mkdir dir="${dist.dir}"/>
<delete includeEmptyDirs="true">
<fileset dir="${build.dir}">
<include name="**/*"/>
</fileset>
</delete>
<delete includeEmptyDirs="true">
<fileset dir="${dist.dir}">
<include name="**/*"/>
</fileset>
</delete>
</target>
<target name="compile" depends="clean">
<!--MIH: also include packages de.escidoc.* in compilation -->
<!--javac srcdir="src" destdir="build" deprecation="true" debug="on"
includes="gov/**/*.java ORG/oclc/os/SRW/*.java"-->
<javac srcdir="${src.dir}" destdir="${build.dir}" deprecation="true" debug="on"
includes="org/osuosl/**/*.java de/escidoc/**/*.java org/apache/lucene/search/*.java">
<classpath>
<fileset dir="${lib.dir}">
<include name="**/*.jar"/>
</fileset>
</classpath>
</javac>
</target>
<target name="jar" depends="compile">
<copy todir="${build.dir}/META-INF/services">
<fileset dir="${conf.dir}" includes="*.wsdd.Provider"/>
</copy>
<!--MIH: also include packages de.escidoc.* in compilation -->
<jar jarfile="${dist.dir}/${escidoc.srw.jarfile.name}" basedir="${build.dir}" includes="org/osuosl/**/*.class de/escidoc/**/*.class META-INF/services/*"/>
</target>
<target name="checkout">
<cvs cvsRoot=":pserver:anonymous@pubserv.oclc.org:/home/CVS/srw/cvsroot"
command="checkout" dest="${src.dir}" package="all"/>
</target>
<target name="war" depends="jar, sources">
<fail unless="webapp.name" message="You need to specify a webapp.name"/>
<delete file="${dist.dir}/${nolibs.webapp.name}.war"/>
<jar jarfile="${dist.dir}/${nolibs.webapp.name}.war">
<zipfileset dir="${dist.dir}" includes="${escidoc.srw.jarfile.name}" prefix="WEB-INF/lib"/>
<!--MIH: add web.xml from conf/escidoc-directory -->
<zipfileset dir="${conf.dir}" includes="*.wsdd" prefix="WEB-INF"/>
<zipfileset dir="${escidoc.conf.dir}" includes="web.xml" prefix="WEB-INF"/>
<!--MIH: Copy all configuration-files for escidoc to WEB-INF/classes -->
<zipfileset dir="${escidoc.conf.dir}" includes="*.xml" excludes="jboss*,web.xml" prefix="WEB-INF/classes"/>
<zipfileset dir="${stylesheets.dir}" includes="*.xsl"/>
<zipfileset dir="${images.dir}" includes="*"/>
<zipfileset dir="${lib.dir}/srw" includes="SRW.jar" prefix="WEB-INF/lib"/>
<zipfileset dir="${lib.dir}/srw" includes="axis-1.4.jar" prefix="WEB-INF/lib"/>
<zipfileset dir="${lib.dir}/srw" includes="log4j.jar" prefix="WEB-INF/lib"/>
<zipfileset dir="${lib.dir}/escidoc" includes="slf4j-log4j12-1.5.11.jar" prefix="WEB-INF/lib"/>
<zipfileset dir="${lib.dir}/escidoc" includes="slf4j-api-1.5.11.jar" prefix="WEB-INF/lib"/>
<zipfileset dir="${lib.dir}/escidoc" includes="jcl-over-slf4j-1.5.11.jar" prefix="WEB-INF/lib"/>
<zipfileset dir="${lib.dir}/escidoc" includes="wss4j-1.5.6.jar" prefix="WEB-INF/lib"/>
<zipfileset dir="${lib.dir}/escidoc" includes="common.jar" prefix="WEB-INF/lib"/>
</jar>
<delete file="${dist.dir}/${webapp.name}.war"/>
<jar jarfile="${dist.dir}/${webapp.name}.war">
<zipfileset dir="${dist.dir}" includes="${escidoc.srw.jarfile.name}" prefix="WEB-INF/lib"/>
<!--MIH: add web.xml from conf/escidoc-directory -->
<zipfileset dir="${conf.dir}" includes="*.wsdd" prefix="WEB-INF"/>
<zipfileset dir="${escidoc.conf.dir}" includes="*.xml" excludes="jboss*,log4j.xml" prefix="WEB-INF"/>
<!--MIH: Copy all configuration-files for escidoc to WEB-INF/classes -->
<zipfileset dir="${escidoc.conf.dir}" includes="*.xml" excludes="web.xml" prefix="WEB-INF/classes"/>
<zipfileset dir="${stylesheets.dir}" includes="*.xsl"/>
<zipfileset dir="${images.dir}" includes="*"/>
<zipfileset dir="${lib.dir}/srw" includes="SRW.jar" prefix="WEB-INF/lib"/>
</jar>
<antcall target="addJarsFromLib"/>
</target>
<target name="addJarsFromLib">
<jar jarfile="${dist.dir}/${webapp.name}.war" update="true" duplicate="preserve">
<zipfileset dir="${lib.dir}/escidoc" includes="*.jar" prefix="WEB-INF/lib"/>
<zipfileset dir="${lib.dir}/escidoc/stax" includes="*.jar" prefix="WEB-INF/lib"/>
<zipfileset dir="${lib.dir}/lucene" includes="*.jar" prefix="WEB-INF/lib"/>
<zipfileset dir="${lib.dir}/srw" includes="*.jar" excludes="SRW.jar,servlet-api.jar" prefix="WEB-INF/lib"/>
</jar>
</target>
<!--
<target name="deploy" depends="war">
<fail unless="serverPath" message="You need to specify a serverPath in the build.properties file"/>
<copy todir="${serverPath}/webapps">
<fileset dir="${dist.dir}" includes="*.war"/>
</copy>
</target>
-->
<target name="javadoc" description="Javadoc for my API.">
<mkdir dir="apidoc"/>
<javadoc packagenames="org.osuosl.* de.escidoc.core.*" destdir="apidoc">
<sourcepath>
<pathelement location="${src.dir}"/>
</sourcepath>
</javadoc>
</target>
<target name="sources" description="Pack sources for download.">
<delete dir="${sources.dir}"/>
<mkdir dir="${sources.dir}"/>
<mkdir dir="${sources.dir}/${project.name}"/>
<copy todir="${sources.dir}/${project.name}">
<fileset dir=".">
<exclude name="${build.dir}/*/**"/>
<exclude name="${bin.dir}/*/**"/>
<exclude name="${dist.dir}/*/**"/>
<exclude name="${sources.dir}/**"/>
<exclude name="${build.dir}/*/**"/>
<exclude name="${docu.dir}/**"/>
<exclude name="${src.dir}/srwsafe/**"/>
<exclude name="**/.svn"/>
<exclude name=".classpath"/>
<exclude name=".project"/>
</fileset>
</copy>
<zip zipfile="${dist.dir}/${webapp.name}-sources.zip"
basedir="${sources.dir}/${project.name}" includes="**"/>
<delete dir="${sources.dir}"/>
</target>
<!-- example usage: ant -Dbuild.version=1.4.4 -Dusername=hans -Dpassword=wurst deploy -->
<target name="deploy" depends="war" description="Deploy war file to local repository and Artifactory">
<!-- deploy war -->
<artifact:pom id="memorypom" groupId="org.escidoc" artifactId="srw_full" version="${build.version}" name="SRW server for eSciDoc" packaging="war" />
<artifact:writepom pomRefId="memorypom" file="${dist.dir}/srw_full-${build.version}.pom" />
<artifact:pom id="filepom" file="${dist.dir}/srw_full-${build.version}.pom" />
<artifact:install file="${dist.dir}/${webapp.name}.war">
<pom refid="filepom" />
</artifact:install>
<artifact:deploy file="${dist.dir}/${webapp.name}.war">
<remoteRepository url="${artifactory.url}">
<authentication username="${artifactory.user}" password="${artifactory.password}" />
</remoteRepository>
<pom refid="filepom" />
</artifact:deploy>
<!-- deploy sources -->
<artifact:pom id="memorypom" groupId="org.escidoc" artifactId="srw_src" version="${build.version}" name="SRW server for eSciDoc (sources)" packaging="zip" />
<artifact:writepom pomRefId="memorypom" file="${dist.dir}/srw_src-${build.version}.pom" />
<artifact:pom id="filepom" file="${dist.dir}/srw_src-${build.version}.pom" />
<artifact:install file="${dist.dir}/${webapp.name}-sources.zip">
<pom refid="filepom" />
</artifact:install>
<artifact:deploy file="${dist.dir}/${webapp.name}-sources.zip">
<remoteRepository url="${artifactory.url}">
<authentication username="${artifactory.user}" password="${artifactory.password}" />
</remoteRepository>
<pom refid="filepom" />
</artifact:deploy>
</target>
</project>