forked from pgrosu/gatk-tools-java
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbuild.xml
executable file
·183 lines (166 loc) · 7.17 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
<?xml version="1.0"?>
<project name="gatk-tools-java" basedir="." default="all">
<property name="src" value="src/main/java"/>
<property name="lib" value="lib"/>
<property name="dist" value="dist"/>
<property name="classes" value="classes"/>
<property name="jar_tmp" value=".jar_tmp"/>
<property name="javac.target" value="1.6"/>
<property name="javac.debug" value="true"/>
<!-- Get GIT hash, if available, otherwise leave it blank. -->
<exec executable="git" outputproperty="repository.revision" failifexecutionfails="true" errorproperty="">
<arg value="log"/>
<arg value="-1"/>
<arg value="--pretty=format:%H_%at"/>
</exec>
<property name="repository.revision" value=""/>
<property name="gatk-tools-java-version" value="1.0"/>
<property name="gatk-tools-java-version-file" value="gatk-tools-java.version.properties"/>
<!-- VERSION PROPERTY -->
<target name="write-version-property">
<propertyfile
file="${gatk-tools-java-version-file}"
comment="gatk-tools-java version">
<entry key="gatk-tools-java-version" value="${gatk-tools-java-version}"/>
</propertyfile>
</target>
<!-- INIT -->
<target name="init" depends="write-version-property">
<path id="classpath">
<fileset dir="${lib}">
<include name="guava-18.0.jar"/>
</fileset>
<fileset dir="${lib}">
<include name="*.jar"/>
<exclude name="guava-18.0.jar"/>
</fileset>
</path>
</target>
<!-- CLEAN -->
<target name="clean">
<delete dir="${classes}"/>
<delete dir="${dist}"/>
<delete dir="javadoc"/>
<delete dir="${jar_tmp}"/>
<delete file="${gatk-tools-java-version-file}"/>
</target>
<!-- COMPILE -->
<target name="compile" depends="init"
description="Compile files without cleaning">
<compile-src includes="**/*.*"/>
</target>
<target name="gatk-tools-java-jar" depends="compile"
description="Builds gatk-tools-java-${gatk-tools-java-version}.jar for inclusion in other projects">
<mkdir dir="${dist}"/>
<delete dir="${jar_tmp}"/>
<mkdir dir="${jar_tmp}"/>
<copy todir="${jar_tmp}">
<fileset dir="${classes}" includes="**/*"/>
</copy>
<unzip dest="${jar_tmp}">
<fileset dir="${lib}">
<include name="*.jar"/>
</fileset>
</unzip>
<jar destfile="${dist}/gatk-tools-java-${gatk-tools-java-version}.jar" compress="no">
<fileset dir="${jar_tmp}" includes="**/*.*"/>
<manifest>
<attribute name="Implementation-Title" value="@gatk-tools-java"/>
<attribute name="Implementation-Version" value="${gatk-tools-java-version}(${repository.revision})"/>
</manifest>
</jar>
<copy todir="${dist}">
<fileset dir="lib" includes="*.jar"/>
</copy>
</target>
<target name="gatk-tools-java-picard-jar" depends="compile"
description="Builds gatk-tools-java-picard-${gatk-tools-java-version}.jar for inclusion in Picard. Removes unneccessary deps.">
<mkdir dir="${dist}"/>
<delete dir="${jar_tmp}"/>
<mkdir dir="${jar_tmp}"/>
<copy todir="${jar_tmp}">
<fileset dir="${classes}" includes="**/*"/>
</copy>
<unzip dest="${jar_tmp}">
<fileset dir="${lib}">
<include name="*.jar"/>
<exclude name="htsjdk*.jar" />
</fileset>
</unzip>
<delete includeEmptyDirs="true">
<fileset dir="${jar_tmp}">
<include name="**/maven/**/*" />
<include name="**/com/beust/**/*" />
<include name="**/commons-logging/**/*" />
<include name="**/org/apache/commons/logging/**/*" />
</fileset>
</delete>
<jar destfile="${dist}/gatk-tools-java-picard-${gatk-tools-java-version}.jar" compress="no">
<fileset dir="${jar_tmp}" includes="**/*.*"/>
<manifest>
<attribute name="Implementation-Title" value="@gatk-tools-java"/>
<attribute name="Implementation-Version" value="${gatk-tools-java-version}(${repository.revision})"/>
</manifest>
</jar>
<copy todir="${dist}">
<fileset dir="lib" includes="*.jar"/>
</copy>
</target>
<!-- ALL -->
<target name="all" depends="compile, gatk-tools-java-jar" description="Default build target">
</target>
<!-- ************************************************************************************** -->
<!-- ************************************************************************************** -->
<!-- Beginning of taskdefs that are used elsewhere in the build file -->
<!-- ************************************************************************************** -->
<!-- ************************************************************************************** -->
<!-- Compile source files specified by includes, from source root. Can specifically
include or exclude-->
<macrodef name="compile-src">
<attribute name="includes" default=""/>
<attribute name="excludes" default=""/>
<attribute name="destdir" default="${classes}"/>
<attribute name="compile.classpath" default="classpath"/>
<attribute name="compiler.args" default=""/>
<sequential>
<mkdir dir="${classes}"/>
<!-- unset the sourcepath attribute in order to compile only files explicitly specified and disable javac's default searching mechanism -->
<javac destdir="@{destdir}"
optimize="${javac.opt}"
debug="${javac.debug}"
sourcepath=""
srcdir="${src}"
includes="@{includes}"
excludes="@{excludes}"
source="${javac.target}"
target="${javac.target}"
includeantruntime="false">
<classpath refid="@{compile.classpath}"/>
<compilerarg line="@{compiler.args}" />
</javac>
</sequential>
</macrodef>
<macrodef name="compile-tests">
<attribute name="includes" default=""/>
<attribute name="excludes" default=""/>
<attribute name="compiler.args" default=""/>
<sequential>
<mkdir dir="${classes.test}"/>
<javac destdir="${classes.test}"
optimize="${javac.opt}"
debug="${javac.debug}"
srcdir="${src.test.java}"
includes="@{includes}"
excludes="@{excludes}"
source="${javac.target}"
target="${javac.target}"
includeantruntime="false">
<classpath>
<path refid="classpath"/>
<pathelement location="${classes}"/>
</classpath>
<compilerarg line="@{compiler.args}"/>
</javac>
</sequential>
</macrodef>
</project>