-
Notifications
You must be signed in to change notification settings - Fork 2
/
build.xml
111 lines (97 loc) · 4.37 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
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns:xdb="http://exist-db.org/ant" default="compile" name="ediarum_oxygen">
<!-- Properties from file -->
<property file="${basedir}/build.properties" />
<!-- Classpath -->
<path id="external-libs-classpath">
<fileset dir="./lib">
<include name="**/*.jar" />
</fileset>
</path>
<property name="jar.version" value="${jar.build.major}.${jar.build.minor}.${jar.build.patch}" />
<property name="jar.version-with-build" value="${jar.build.major}.${jar.build.minor}.${jar.build.patch}-${jar.build.number}" />
<tstamp>
<format property="tstamp.timestamp" pattern="yyyy-MM-dd'T'HH:mm:ss"/>
</tstamp>
<target name="show-version" description="show the current version number">
<echo>Current version: ${jar.version}</echo>
</target>
<target name="show-build" description="show the current version number with build">
<echo>Current version: ${jar.version-with-build}</echo>
</target>
<target name="increase-patch" description="increase the patch number">
<echo message="increase patch number..."/>
<propertyfile file="build.properties">
<entry key="jar.build.patch" type="int" operation="+" value="1" pattern="0" />
</propertyfile>
<echo>Current version: ${jar.version}</echo>
</target>
<target name="increase-minor" description="increase the minor number">
<echo message="increase minor number..."/>
<propertyfile file="build.properties">
<entry key="jar.build.minor" type="int" operation="+" value="1" pattern="0" />
<entry key="jar.build.patch" type="int" operation="=" value="0" pattern="0" />
</propertyfile>
<echo>Current version: ${jar.version}</echo>
</target>
<target name="increase-major" description="increase the major number">
<echo message="increase major number..."/>
<propertyfile file="build.properties">
<entry key="jar.build.major" type="int" operation="+" value="1" pattern="0" />
<entry key="jar.build.minor" type="int" operation="=" value="0" pattern="0" />
<entry key="jar.build.patch" type="int" operation="=" value="0" pattern="0" />
</propertyfile>
</target>
<!-- Targt: INCREASE BUILD NUMBER -->
<target name="increase-build-number">
<echo message="increase build number..."/>
<propertyfile file="build.properties">
<entry key="jar.build.number" type="int" operation="+" value="1" pattern="0" />
</propertyfile>
</target>
<!-- Target: INIT: set directories-->
<target name="init">
<echo message="setting properties..." />
<property name="dir.src" value="${basedir}/src" />
<property name="dir.build" value="${basedir}/build" />
<property name="dir.dist" value="${basedir}/dist" />
<property name="dir.lib" value="${basedir}/lib" />
</target>
<!-- Target: PREPARE: empty dirctories -->
<target name="prepare">
<echo message="delete directories..." />
<delete dir="${dir.build}" />
<!-- <delete dir="${dir.dist}" /> -->
<echo message="create directories..." />
<mkdir dir="${dir.build}" />
<!-- <mkdir dir="${dir.dist}" /> -->
</target>
<!-- Target: COMPILE -->
<target name="compile" depends="increase-build-number, init, prepare" description="compile project classes">
<echo message="compiling..." />
<javac srcdir="${dir.src}" destdir="${dir.build}">
<classpath refid="external-libs-classpath" />
<include name="org\bbaw\telota\ediarum\**\*.java" />
<include name="org\bbaw\telota\ediarum\*.java" />
<!-- ohne Tests -->
<exclude name="org\bbaw\telota\**\test\*.java" />
</javac>
<jar destfile="${dir.dist}/ediarum-${jar.version}.jar" basedir="${dir.build}">
<!-- <fileset dir="${dir.build}" /> -->
<zipgroupfileset dir="lib" includes="lib-pdr-dates-plugin-1.2.2-10.jar" />
<!-- <fileset dir="${dir.src}"> -->
<!-- <exclude name="org\bbaw\telota\**\test\" /> -->
<!-- </fileset> -->
<manifest>
<attribute name="Built-By" value="${user.name}" />
<attribute name="Build-Jdk" value="${java.version} (${java.vendor})" />
<attribute name="Build-Time" value="${tstamp.timestamp}" />
<attribute name="Implementation-Vendor" value="BBAW" />
<attribute name="Implementation-Title" value="${jar.name}" />
<attribute name="Implementation-Version" value="${jar.version-with-build}" />
</manifest>
</jar>
<echo message="generate copy of current jar..."/>
<copy file="${dir.dist}/ediarum-${jar.version}.jar" tofile="${dir.dist}/ediarum.jar"/>
</target>
</project>