forked from binfalse/CombineArchive
-
Notifications
You must be signed in to change notification settings - Fork 2
/
build.xml
74 lines (65 loc) · 2.65 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
<project name="CombineArchive" default="dist" basedir=".">
<description>
Library to read/create/write/manipulate/... COMBINE archives
</description>
<property name="app.name" value="CombineArchive" />
<property name="app.version" value="1.3.7" />
<property name="src" location="src/main/java" />
<property name="build" location="build" />
<property name="dist" location="dist" />
<property name="lib" location="lib" />
<path id="compile.classpath">
<fileset dir="${lib}">
<include name="*.jar" />
</fileset>
</path>
<target name="init" description="initialize workspace">
<assertDirAvailable dir="${lib}" />
<tstamp />
<mkdir dir="${build}" />
<!--copy todir="${build}">
<fileset dir="${src}" includes="**/*.xml,**/*.properties,**/*.txt,**/*.ico" />
</copy-->
<mkdir dir="${dist}" />
</target>
<target name="compile" depends="init" description="compile the source">
<javac srcdir="${src}" destdir="${build}" includeantruntime="false">
<classpath refid="compile.classpath" />
</javac>
</target>
<target name="dist" depends="compile" description="generate the distribution">
<manifest file="build/MANIFEST.MF">
<attribute name="Main-Class" value="de.unirostock.sems.cbarchive.Main" />
</manifest>
<jar jarfile="${dist}/${app.name}-${app.version}.jar" basedir="${build}" manifest="build/MANIFEST.MF" />
<jar jarfile="${dist}/${app.name}-${app.version}-fat.jar" basedir="${build}" manifest="build/MANIFEST.MF">
<zipgroupfileset dir="lib" includes="*.jar" excludes="" />
</jar>
</target>
<target name="sign" depends="dist" description="sign a dist">
<checksum file="${dist}/${app.name}-${app.version}.jar" forceOverwrite="yes" />
<move file="${dist}/${app.name}-${app.version}.jar.MD5" tofile="${dist}/${app.name}-${app.version}.jar.md5" />
<exec executable="gpg">
<arg value="--output" />
<arg value="${dist}/${app.name}-${app.version}.jar.md5.sig" />
<arg value="-abs" />
<arg value="${dist}/${app.name}-${app.version}.jar.md5" />
</exec>
</target>
<target name="clean" description="clean up">
<delete dir="${build}" />
<delete dir="${dist}" />
</target>
<macrodef name="assertDirAvailable">
<attribute name="dir" />
<sequential>
<fail message="Please create dir @{dir} containing the depenencies:${line.separator}${line.separator} >> BFlog (see http://bin.sems.uni-rostock.de/BFLog/)${line.separator} >> json-simple (see https://code.google.com/p/json-simple/)${line.separator} >> JDOM (http://jdom.org/)">
<condition>
<not>
<available file="@{dir}" type="dir" />
</not>
</condition>
</fail>
</sequential>
</macrodef>
</project>