-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathbuild.xml
196 lines (162 loc) · 6.84 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
196
<project xmlns:ivy="antlib:org.apache.ivy.ant" name="genome-de-novo" default="first-build" basedir=".">
<property name="VERSION" value="1.6.1"/>
<tstamp>
<format property="TODAY" pattern="dd-MMM-yyyy" locale="en"/>
</tstamp>
<tstamp>
<format property="TODAY_TS" pattern="dd-MMM-yyyy HH:mm" locale="en"/>
</tstamp>
<property name="lib.dir" value="lib"/>
<property name="ant.build.javac.source" value="1.7"/>
<property name="ant.build.javac.target" value="1.7"/>
<condition property="dist.version.suffix" value="-b${build.number}" else="">
<isset property="build.number"/>
</condition>
<!-- Determine build version -->
<exec executable="git" outputproperty="revision">
<arg value="rev-parse"/>
<arg value="--short"/>
<arg value="HEAD"/>
</exec>
<exec executable="git" outputproperty="changes">
<arg value="status"/>
<arg value="-s"/>
<arg value="-uno"/>
</exec>
<condition property="dist.version"
value="${VERSION} (revision ${revision}, ${TODAY})"
else ="${VERSION} (revision ${revision}+ changes, ${TODAY_TS})" >
<equals arg1="${changes}" arg2=""/>
</condition>
<echo message="${dist.version}" file="VERSION"/>
<echo message="Version: ${dist.version}"/>
<property name="dist.base.name" value="dist/itmo-assembler${dist.version.suffix}"/>
<property name="dist.jar.name" value="${dist.base.name}.jar"/>
<property name="dist.sh.name" value="${dist.base.name}.sh"/>
<property name="dist.bat.name" value="${dist.base.name}.bat"/>
<property name="dist.src.name" value="${dist.base.name}-src.jar"/>
<path id="class.path">
<fileset dir="lib/dev">
<include name="**/*.jar" />
</fileset>
</path>
<target name="first-build" depends="ivy.bootstrap,resolve,compile"/>
<target name="compile">
<mkdir dir="bin"/>
<mkdir dir="bin/java"/>
<javac srcdir="src/java" destdir="bin/java" debug="on">
<classpath refid="class.path"/>
<compilerarg value="-Xlint"/>
<compilerarg line="-encoding utf-8"/>
</javac>
<exec executable="sh" failonerror="true">
<arg value="./find_tools.sh"/>
</exec>
</target>
<target name="clean">
<delete failonerror="false" includeemptydirs="true">
<fileset dir="bin/java"/>
<fileset dir="bin/hadoop"/>
<fileset dir="bin/dependencies"/>
<fileset dir="bin/java-test"/>
</delete>
</target>
<target name="resolve" description="--> retrieve dependencies with ivy">
<taskdef resource="org/apache/ivy/ant/antlib.xml" uri="antlib:org.apache.ivy.ant" classpath="${ivy.home}/${ivy.jar.name}"/>
<ivy:retrieve sync="true" pattern="${lib.dir}/[conf]/[artifact]-[revision](-[classifier]).[ext]" symlink="true"/>
</target>
<target name="clean-libs" description="--> clean libs">
<echo message="Deleting lib dir" />
<delete dir="${lib.dir}" />
</target>
<target name="report">
<mkdir dir="report" />
<ivy:resolve type="${ivy.resolve.types}"/>
<ivy:report todir="report" />
</target>
<property name="ivy.jar.version" value="2.5.0"/>
<property name="ivy.jar.name" value="ivy-${ivy.jar.version}.jar"/>
<property name="ivy.home" value="${user.home}/.ivy2"/>
<available property="ivy.installed" file="${ivy.home}/${ivy.jar.name}"/>
<target name="ivy.install" unless="ivy.installed">
<mkdir dir="${ivy.home}"/>
<get src="https://repo1.maven.org/maven2/org/apache/ivy/ivy/${ivy.jar.version}/${ivy.jar.name}" dest="${ivy.home}/${ivy.jar.name}"/>
</target>
<target name="ivy.bootstrap" depends="ivy.install" unless="ivy.bootstrapped">
<taskdef resource="org/apache/ivy/ant/antlib.xml" uri="antlib:org.apache.ivy.ant" classpath="${ivy.home}/${ivy.jar.name}"/>
<property name="ivy.bootstrapped" value="true"/> <!-- Avoid re-bootstrapping because it causes classloader issues. -->
</target>
<target name="compile-tests" depends="compile">
<mkdir dir="bin"/>
<mkdir dir="bin/java-test"/>
<javac srcdir="test/java" destdir="bin/java-test" debug="on">
<classpath>
<path refid="class.path"/>
<pathelement path="bin/java"/>
</classpath>
<compilerarg value="-Xlint"/>
</javac>
</target>
<target name="test" depends="compile-tests">
<mkdir dir="test-report" />
<junit printsummary="yes" haltonfailure="no">
<classpath>
<pathelement path="bin/java-test/"/>
<pathelement path="bin/java/"/>
<path refid="class.path"/>
</classpath>
<formatter type="xml"/>
<batchtest fork="yes" todir="./test-report">
<fileset dir="./test/java">
<include name="**/*Test.java"/>
</fileset>
</batchtest>
</junit>
</target>
<target name="package-prepare" depends="clean,resolve,compile">
<mkdir dir="bin/dependencies"/>
<unjar dest="bin/dependencies">
<fileset dir="lib/standalone" includes="**/*.jar"/>
</unjar>
<delete dir="bin/dependencies/it/unimi/dsi/fastutil/chars"/>
<delete dir="bin/dependencies/it/unimi/dsi/fastutil/doubles"/>
<delete dir="bin/dependencies/it/unimi/dsi/fastutil/floats"/>
<delete dir="bin/dependencies/it/unimi/dsi/fastutil/shorts"/>
</target>
<target name="hadoop" depends="package">
</target>
<target name="package-build">
<mkdir dir="dist"/>
<jar destfile="${dist.jar.name}" duplicate="preserve">
<fileset dir="bin/java"/>
<fileset file="log4j.properties"/>
<fileset dir="bin/dependencies"/>
<fileset dir="stuff" includes="images/*"/>
<fileset file="COPYING"/>
<fileset file="VERSION"/>
<fileset file="TOOLS"/>
<fileset file="config.properties"/> <!-- for hadoop -->
<manifest>
<attribute name="Main-Class"
value="ru.ifmo.genetics.Runner"/>
</manifest>
</jar>
<concat destfile="${dist.sh.name}" binary="true">
<filelist files="src/stub.sh,${dist.jar.name}"/>
</concat>
<chmod file="${dist.sh.name}" perm="a+x"/>
<concat destfile="${dist.bat.name}" binary="true">
<filelist files="src/stub.bat,${dist.jar.name}"/>
</concat>
<jar destfile="${dist.src.name}">
<fileset dir="src/java" includes="**/*.java"/>
<fileset file="log4j.properties"/>
<fileset file="COPYING"/>
<fileset file="VERSION"/>
<fileset file="TOOLS"/>
<fileset file="config.properties"/> <!-- for hadoop -->
</jar>
</target>
<target name="package" depends="package-prepare,package-build">
</target>
</project>