forked from felipealbrecht/Genoogle
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathbuild.xml
More file actions
232 lines (181 loc) · 8.12 KB
/
build.xml
File metadata and controls
232 lines (181 loc) · 8.12 KB
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
221
222
223
224
225
226
227
228
229
230
231
232
<!-- Genoogle: Similar DNA Sequences Searching Engine and Tools. (http://genoogle.pih.bio.br) -->
<!-- Copyright (C) 2008,2009 Felipe Fernandes Albrecht (felipe.albrecht@gmail.com) -->
<!-- -->
<!-- For further information check the LICENSE file. -->
<project name="genoogle" default="compile" basedir=".">
<description> Build script for Genoogle project</description>
<target name="init" description="Checks environment and setup variables">
<!-- Check the current system classpath for JUnit -->
<available classpath="${java.class.path}" classname="junit.framework.TestCase" property="junit.present" />
<!-- Check for JUnit support in Ant (only in >= 1.3) -->
<available classpath="${java.class.path}" classname="org.apache.tools.ant.taskdefs.optional.junit.JUnitTest" property="junit.support" />
<property name="name" value="Genoogle" />
<property name="version" value="0.80" />
<property name="docs.dir" location="./doc/javadoc" />
<property name="src.dir" location="./src" />
<property name="src_tmp.dir" location="src_tmp/" />
<property name="tests.src.dir" location="./tests" />
<!-- Main build directory -->
<property name="build.dir" location="./ant-build" />
<property name="build.classes.dir" location="${build.dir}/classes" />
<!-- Jar configuration -->
<property name="manifest.dir" location="./manifest" />
<property name="jar.genoogle" location="${build.dir}/genoogle.jar" />
<property name="targz.genoogle" location="genoogle.tar.gz" />
<property name="jar.genoogle-src" location="genoogle-src.jar" />
<property name="jar.genoogle-javadoc" location="genoogle-javadoc.jar" />
<!-- Javac properties -->
<property name="javac.deprecation" value="false" />
<property name="javac.source" value="6" />
<property name="javac.target" value="6" />
<!-- Javadoc properties -->
<property name="build.docs" location="${build.dir}/docs" />
<property name="packages" value="bio.pih.*" />
<!-- Packing info -->
<property name="packing.dir" location="packing/genoogle" />
<!-- Tests properties -->
<property name="reports.tests" value="${build.dir}/tests/report" />
<echo message="JUnit present: ${junit.present}" />
<echo message="JUnit supported by Ant: ${junit.support}" />
<echo message="Keep it up, rock 'n' roll, good music save your soul" />
</target>
<!-- Prepares the biojava source code -->
<target name="prepare" depends="init">
<mkdir dir="${build.dir}" />
<mkdir dir="${build.classes.dir}" />
<mkdir dir="${build.docs}" />
<mkdir dir="${reports.tests}" />
</target>
<!-- Compile the Genoogle Sources -->
<target name="compile" depends="prepare">
<javac includeantruntime="false" encoding="ISO-8859-15" srcdir="${src.dir}" destdir="${build.classes.dir}" depend="${javac.depend}" deprecation="${javac.deprecation}" source="${javac.source}" target="${javac.target}" debug="true" debuglevel="lines,vars,source">
<classpath>
<fileset dir="./lib">
<include name="**/*.jar" />
</fileset>
</classpath>
</javac>
</target>
<!-- Generate the Genoogle jar file -->
<target name="jar" depends="compile">
<jar jarfile="${jar.genoogle}" manifest="${manifest.dir}/genoogle.txt">
<fileset dir="${build.classes.dir}" />
</jar>
</target>
<!-- Compile the Genoogle Sources -->
<target name="tests-compile" depends="jar">
<javac includeantruntime="false" encoding="ISO-8859-15" srcdir="${tests.src.dir}" destdir="${tests.src.dir}" depend="${javac.depend}" deprecation="${javac.deprecation}" source="${javac.source}" target="${javac.target}" debug="true" debuglevel="lines,vars,source">
<classpath>
<fileset dir="./lib">
<include name="**/*.jar" />
</fileset>
<fileset dir="${build.dir}">
<include name="**/*.jar" />
</fileset>
</classpath>
</javac>
</target>
<!-- Generate the Genoogle source jar file -->
<target name="src_jar" depends="init">
<mkdir dir="${src_tmp.dir}"/>
<copy todir="${src_tmp.dir}">
<fileset dir="${src.dir}">
<exclude name="**/.svn"/>
</fileset>
</copy>
<jar jarfile="${jar.genoogle-src}">
<fileset dir="${src_tmp.dir}"/>
</jar>
<delete dir="${src_tmp.dir}"/>
</target>
<!-- Pre processing to generate the jar file-->
<target name="packing_dir" depends="jar">
<mkdir dir="${packing.dir}"/>
<copy file="${jar.genoogle}" tofile="${packing.dir}/genoogle.jar"/>
<copy file="format_db.sh" tofile="${packing.dir}/format_db.sh"/>
<copy file="run_console.sh" tofile="${packing.dir}/run_console.sh"/>
<copy file="run_web.sh" tofile="${packing.dir}/run_web.sh"/>
<copy file="run_standalone_web.sh" tofile="${packing.dir}/run_standalone_web.sh"/>
<copy file="./conf/genoogle_default.xml" tofile="${packing.dir}/conf/genoogle.xml"/>
<copy file="./conf/log4j.properties" tofile="${packing.dir}/conf/log4j.properties"/>
<mkdir dir="${packing.dir}/files/fasta"/>
<copy file="files/fasta/AE000657.fna" tofile="${packing.dir}/files/fasta/AE000657.fna"/>
<copy todir="${packing.dir}/lib">
<fileset dir="./lib"/>
</copy>
<copy todir="${packing.dir}/webapps">
<fileset dir="./webapps">
<exclude name="**/work/"/>
</fileset>
</copy>
</target>
<!-- create the genoogle.tar.gz file -->
<target name="packing" depends="packing_dir">
<tar destfile="genoogle.tar" basedir="./packing"/>
<gzip destfile="${targz.genoogle}" src="genoogle.tar"/>
<delete file="genoogle.tar"/>
<delete dir="./packing"/>
</target>
<!-- Creates the API documentation -->
<target name="javadoc" depends="compile" description="Creates the API documentation">
<javadoc encoding="ISO-8859-1" packagenames="${packages}" sourcepath="${src.dir}" destdir="${build.docs}" author="true" version="true" use="true" source="1.6" windowtitle="${name}-${version} API" doctitle="${name}-${version}" maxmemory="192m">
<classpath>
<fileset dir="./lib">
<include name="**/*.jar" />
</fileset>
</classpath>
<link href="http://java.sun.com/javase/6/docs/api/" offline="false" />
<excludepackage name="bio.pih.tests.*" />
<group title="Indexer" packages="bio.pih.indexer" />
<group title="Scheduler" packages="bio.pih.scheduler" />
<group title="Search" packages="bio.pih.search" />
<group title="Seq" packages="bio.pih.seq:bio.pih.seq.*" />
<group title="util" packages="bio.pih.util" />
</javadoc>
</target>
<!-- Create the jar file with the API documentation -->
<target name="javadoc_jar" depends="javadoc">
<jar jarfile="${jar.genoogle-javadoc}">
<fileset dir="${build.docs}"/>
</jar>
</target>
<!-- Runs tests if the Ant optional JUnit support is available -->
<target name="run-tests" depends="compile, tests-compile">
<property name="test.subtree" value="**" />
<echo message="Running tests: ${test.subtree}" />
<echo message="${build.classes.dir}" />
<echo message="${classpath}" />
<echo message="${java.class.path}" />
<junit fork="true" maxmemory="128m" printsummary="yes" haltonfailure="no">
<formatter type="plain" usefile="true" />
<classpath>
<!-- main classes from build -->
<pathelement path="${build.classes.dir}" />
<!-- classes specified in this file -->
<pathelement path="${classpath}" />
<!-- classes specified in system classpath -->
<pathelement path="${java.class.path}" />
<pathelement path="${tests.src.dir}" />
<fileset dir="./lib">
<include name="**/*.jar" />
</fileset>
</classpath>
<!-- The junit task doesn't support 'if' so we test for JUnit here -->
<batchtest fork="yes" todir="${reports.tests}">
<fileset dir="${tests.src.dir}">
<include name="${test.subtree}/*Test*.class" />
<include name="${test.subtree}/*TestSuite*.class" />
<exclude name="**/Abstract*Test.class" />
</fileset>
</batchtest>
</junit>
</target>
<!-- Create a zip with all genoogle libs -->
<target name="libs_package">
<zip destfile="genoogle-libs.zip"
basedir="./lib"
excludes="**/.svn"
/>
</target>
<target name="all" depends="packing,libs_package,javadoc_jar,src_jar"/>
</project>