File: build.xml

package info (click to toggle)
libvamsas-client-java 0.2%2Bdfsg-1
  • links: PTS, VCS
  • area: main
  • in suites: experimental
  • size: 4,112 kB
  • sloc: java: 32,555; xml: 415; makefile: 3
file content (220 lines) | stat: -rw-r--r-- 8,256 bytes parent folder | download
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
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
<?xml version="1.0"?>
<!--
   * This file is part of the Vamsas Client version 0.2. 
   * Copyright 2010 by Jim Procter, Iain Milne, Pierre Marguerite, 
   *  Andrew Waterhouse and Dominik Lindner.
   * 
   * Earlier versions have also been incorporated into Jalview version 2.4 
   * since 2008, and TOPALi version 2 since 2007.
   * 
   * The Vamsas Client is free software: you can redistribute it and/or modify
   * it under the terms of the GNU Lesser General Public License as published by
   * the Free Software Foundation, either version 3 of the License, or
   * (at your option) any later version.
   *  
   * The Vamsas Client is distributed in the hope that it will be useful,
   * but WITHOUT ANY WARRANTY; without even the implied warranty of
   * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
   * GNU Lesser General Public License for more details.
   * 
   * You should have received a copy of the GNU Lesser General Public License
   * along with the Vamsas Client.  If not, see <http://www.gnu.org/licenses/>.
-->
<project name="vamsas-client" default="build" basedir=".">

	<target name="init">
		<!--<property name="target1.4" value="true"> -->
		<property name="libDir" value="/usr/share/java" />
		<property name="toolsDir" value="tools" />
		<property name="resourceDir" value="resources" />
		<property name="sourceDir" value="src" />
		<property name="outputDir" value="classes" />
		<property name="packageDir" value="packages" />
		<!-- .jar gets added when the property is used -->
		<property name="vamsasClient.jar" value="vamsas-client" /> 
		<property name="vamsasClientDoc.jar" value="vamsas-client-docs" />
		<property name="vamsasClientSource.jar" value="vamsas-client-src-doc" />
		<property name="vamsasSchemaDocs.jar" value="vamsas-schema-and-doc" />
		<property name="vamsas.schema" value="schemas/vamsas.xsd" />
		<property name="vamsas.doc.schema" value="schemas/vamsasDocument.xsd" />
		<property name="vamsas.schema.package" value="uk.ac.vamsas.objects.core" />
		<property name="vamsas.schema.package.src" value="uk/ac/vamsas/objects/core" />
		<property name="vamsas.schema.sourcegen.properties" value="schemas/castorbuilder.properties" />
		<path id="castor.classpath">
			<fileset dir="tools">
				<include name="*.jar" />
				<include name="**/*.jar" />
			</fileset>
			<fileset dir="lib">
				<include name="*.jar" />
				<include name="**/*.jar" />
			</fileset>
		</path>

		<!--
		Build classpath
		-->
		<path id="build.classpath">
			<fileset dir="${libDir}">
				<include name="castor-xml.jar" />
				<include name="commons-logging.jar" />
				<include name="log4j-1.2.jar" />
				<include name="castor-core.jar" />
			</fileset>
			<!-- 		path refid="axis.classpath"  -->
		</path>
	</target>
	<target name="cleancoresource" depends="init" description="Clean automatically generated packages">
		<delete>
			<fileset dir="${sourceDir}/${vamsas.schema.package.src}">
				<include name="*.java" />
				<include name="descriptors/*.java" />
			</fileset>
		</delete>
	</target>
	<target name="makecoresource" depends="init, cleancoresource" description="Generate Java source files from XSD.">
		<taskdef name="castor-srcgen" classname="org.castor.anttask.CastorCodeGenTask" classpathref="castor.classpath" />
		<!-- Should apply this to every schema file in ${vamsas.schemas} directory -->
		<castor-srcgen file="${vamsas.schema}" todir="${sourceDir}" package="${vamsas.schema.package}" warnings="true" nodesc="false" properties="${vamsas.schema.sourcegen.properties}" />
		<castor-srcgen file="${vamsas.doc.schema}" todir="${sourceDir}" package="${vamsas.schema.package}" warnings="true" nodesc="false" properties="${vamsas.schema.sourcegen.properties}" />
	</target>
	<target name="prepare" depends="init">
		<mkdir dir="${packageDir}" />
		<mkdir dir="${outputDir}" />
		<copy todir="${outputDir}">
			<fileset dir="${resourceDir}" />
			<fileset dir="${basedir}">
				<include name="LICENS*" />
				<include name="COPYING*" />
				<include name="CONTRIB" />
				<include name="README" />
			</fileset>
		</copy>
	</target>
	<target name="clean" depends="init">
		<delete failonerror="false">
			<fileset dir="${outputDir}">
				<include name="*" />
				<include name="*.*" />
				<include name="**/*" />
				<include name="**/*.*" />
			</fileset>
		</delete>
		<delete dir="${axisbuild}" />
		<!--	<ant dir="test" antfile="build.xml" target="clean"
inheritRefs="true"/> -->
	</target>
	<target name="realclean" depends="init, clean">
		<delete dir="${packageDir}" />
	</target>
	<target name="distclean" depends="init, realclean">
		<echo message="REMOVING ALL BACKUP/AUTOSAVES!" />
		<delete>
			<fileset dir=".">
				<include name="#*#" />
				<include name="#*.*#" />
				<include name="**/#*#" />
				<include name="**/#*.*#" />
				<include name="*~" />
				<include name="*.*~" />
				<include name="**/*~" />
				<include name="**/*.*~" />
			</fileset>
		</delete>
	</target>
	<target name="build1.4" depends="init,prepare" if="target1.4">
		<javac classpathref="build.classpath" debug="on" srcdir="${sourceDir}" destdir="${outputDir}" deprecation="on" source="1.4" target="1.4">
			<exclude name="uk/ac/ebi/msd/vamsas/**" />
			<exclude name="uk/ac/vamsas/test/document/SAXTreeViewer.*"/>
		</javac>
	</target>
	<target name="build1.5" depends="init,prepare" unless="target1.4">
		<javac classpathref="build.classpath" debug="on" srcdir="${sourceDir}" destdir="${outputDir}" deprecation="on" source="1.5" target="1.5">
			<exclude name="uk/ac/ebi/msd/vamsas/**" />
		</javac>
	</target>
	<target name="build" depends="build1.4,build1.5">
		<echo message="Finished building" />
	</target>
	<target name="jartarget1.4" if="target1.4" depends="init">
		<property name="vamsasClient.jar.real" value="${vamsasClient.jar}"/>
	</target>
	<target name="jartarget1.5" unless="target1.4" depends="init">
			<property name="vamsasClient.jar.real" value="${vamsasClient.jar}-j1.5"/>
	</target>
	<target name="jar" depends="build, javadoc,jartarget1.4,jartarget1.5">
		<jar destfile="${packageDir}/${vamsasClient.jar.real}.jar">
			<fileset dir="${outputDir}">
				<exclude name="cache*/**" />
				<include name="**/*" />
				<exclude name="*.jar.*" />
				<exclude name="**/*.jar" />
				<exclude name="**/*.jar.*" />
				<exclude name="*.java" />
				<exclude name="**/*.java" />
				<exclude name="uk/*.class" />
				<exclude name="log4j.properties" />
				<exclude name="commons-logging.properties" />
			</fileset>
		</jar>
		<jar destfile="${packageDir}/${vamsasClientDoc.jar}.jar">
			<fileset dir="docs/api">
				<include name="**/*" />
			</fileset>
			<fileset dir="${basedir}">
				<include name="README" />
				<include name="CONTRIB" />
				<include name="LICEN*" />
				<include name="COPYING*" />
			</fileset>
		</jar>
		<jar destfile="${packageDir}/${vamsasSchemaDocs.jar}.jar">
			<fileset dir="${basedir}/schemas">
				<include name="*.xsd" />
			</fileset>
			<fileset dir="${basedir}/docs/schema">
				<include name="**/*" />
			</fileset>
			<fileset dir="${basedir}">
				<include name="COPYING*" />
			</fileset>
		</jar>
		<jar destfile="${packageDir}/${vamsasClientSource.jar}.jar">
			<fileset dir="${basedir}">
				<include name="src/**/*.java" />
				<include name="src/**/*.cdr" />
				<exclude name="*~" />
				<exclude name="**/*.java~" />
				<include name="resources/**" />
				<include name="utils/**" />
				<include name="tools/**" />
				<include name="schemas/**" />
				<include name="test" />
				<include name="docs/**" />
				<include name="tools/**" />
				<include name="lib/**" />
				<include name="README" />
				<include name="CONTRIB" />
				<include name="LICEN*" />
				<include name="COPYING*" />
				<include name="*.eclipse*" />
				<include name="*.launch" />
				<include name="build.xml" />
			</fileset>
		</jar>
	</target>

	<target name="javadoc" depends="init">
		<javadoc destdir="docs/api" classpathref="build.classpath" author="true" version="true" use="true">
			<fileset dir="${sourceDir}" defaultexcludes="yes">
				<exclude name="**/.castor.cdr" />
				<!-- this was for the old ebi packages.
      	<exclude name="uk/**"/>
      	<exclude name="uk/*.java"/> -->
			</fileset>
		</javadoc>
	</target>

</project>