-
Notifications
You must be signed in to change notification settings - Fork 1
/
build.xml
96 lines (87 loc) · 4.08 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
<project name="ngsutilsj" default="jar">
<property name="version" value="0.5.6"/>
<property name="build" value="dev"/>
<property name="lib.dir" value="lib"/>
<property name="blib.dir" value="blib"/>
<property name="build.dir" value="build"/>
<property name="dist.dir" value="dist"/>
<property name="src.dir" value="src"/>
<target name="clean">
<delete dir="${build.dir}"/>
<delete dir="${dist.dir}"/>
</target>
<path id="classpath">
<fileset dir="${lib.dir}" includes="**/*.jar"/>
</path>
<target name="compile">
<mkdir dir="${build.dir}/classes"/>
<!--
<javac srcdir="${src.dir}/java" destdir="${build.dir}/classes" classpathref="classpath" debug="true" debuglevel="lines,vars,source"/>
-->
<javac
srcdir="${src.dir}/java"
destdir="${build.dir}/classes"
encoding="UTF-8"
debug="true"
includeantruntime="false"
classpathref="classpath"
debuglevel="lines,vars,source"
release="8"
>
<!--modulepathref="classpath"-->
<compilerarg value="-Xlint:-options"/>
</javac>
</target>
<target name="jar" depends="compile, git.revision">
<copy file="LICENSE" todir="${build.dir}/classes/"/>
<copy file="INCLUDES" todir="${build.dir}/classes/"/>
<echo file="${build.dir}/classes/io/compgen/ngsutils/ngsutilsj.properties" message="build=${build}${line.separator}"/>
<echo file="${build.dir}/classes/io/compgen/ngsutils/ngsutilsj.properties" message="version=${version}${line.separator}" append="true"/>
<echo file="${build.dir}/classes/io/compgen/ngsutils/ngsutilsj.properties" message="gitcommit=${repository.version}${line.separator}" append="true"/>
<mkdir dir="${dist.dir}"/>
<taskdef name="jarjar" classname="com.tonicsystems.jarjar.JarJarTask"
classpath="${blib.dir}/jarjar-1.4.jar"/>
<jar destfile="${dist.dir}/${ant.project.name}-${version}.jar">
<fileset dir="${build.dir}/classes"/>
<fileset dir="${src.dir}/java" includes="**/*.java"/>
</jar>
<jarjar jarfile="${dist.dir}/ngsutilsj.jar.tmp">
<manifest>
<attribute name="Main-Class" value="io.compgen.ngsutils.NGSUtils"/>
</manifest>
<fileset dir="${build.dir}/classes"/>
<zipfileset src="${lib.dir}/htsjdk-1.126.jar"/>
<zipfileset src="${lib.dir}/snappy-java-1.0.3-rc3.jar"/>
<zipfileset src="${lib.dir}/commons-jexl-2.1.1.jar"/>
<zipfileset src="${lib.dir}/commons-logging-1.1.1.jar"/>
<zipfileset src="${lib.dir}/commons-math3-3.3.jar"/>
<zipfileset src="${lib.dir}/compgen-common-0.4.4.jar"/>
<zipfileset src="${lib.dir}/compgen-cmdline-0.4.5.jar"/>
<zipfileset src="${lib.dir}/commons-compress-1.8.1.jar"/>
<zap pattern="*.java"/>
</jarjar>
<delete file="${dist.dir}/ngsutilsj"/>
<concat destfile="${dist.dir}/ngsutilsj" binary="true">
<fileset file="${src.dir}/scripts/stub.sh" />
<fileset file="${dist.dir}/ngsutilsj.jar.tmp" />
</concat>
<delete file="${dist.dir}/ngsutilsj.jar.tmp"/>
<chmod file="${dist.dir}/ngsutilsj" perm="755"/>
</target>
<!-- See http://stackoverflow.com/questions/2974106/how-to-lookup-the-latest-git-commit-hash-from-an-ant-build-script -->
<available file=".git" type="dir" property="git.present"/>
<target name="git.revision" description="Store git revision in ${repository.version}" if="git.present">
<exec executable="git" outputproperty="git.revision" failifexecutionfails="false" errorproperty="">
<arg value="describe"/>
<arg value="--tags"/>
<arg value="--always"/>
<arg value="HEAD"/>
</exec>
<condition property="repository.version" value="${git.revision}" else="unknown">
<and>
<isset property="git.revision"/>
<length string="${git.revision}" trim="yes" length="0" when="greater"/>
</and>
</condition>
</target>
</project>