This repository has been archived by the owner on Apr 3, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 1
/
build.xml
74 lines (62 loc) · 2.26 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 default="jar" name="Phpbbpm">
<property name="base.dir" value="." />
<property name="basedir" value="." />
<property name="src.dir" value="src" />
<property name="lib.dir" value="lib" />
<property name="build.dir" value="build" />
<property name="classes.dir" value="${build.dir}/classes" />
<property name="jar.dir" value="${base.dir}/dist" />
<property name="main-class" value="fr.amazou.phpbbpm.Phpbbpm" />
<macrodef name="git-revision">
<attribute name="path" />
<attribute name="output" />
<sequential>
<exec executable="git" outputproperty="head" dir="@{path}">
<arg value="rev-parse" />
<arg value="HEAD" />
</exec>
<echo file="GIT_REVISION_LOG" message="Found revision: ${head}" />
<exec executable="git" outputproperty="dirty">
<arg value="diff" />
<arg value="--shortstatt" />
</exec>
<condition property="@{output}" value="${head}" else="${head} (dirty)">
<equals arg1="${dirty}" arg2="" />
</condition>
</sequential>
</macrodef>
<path id="classpath">
<fileset dir="${lib.dir}" includes="**/*.jar" />
</path>
<tstamp>
<format property="DSTAMP" pattern="dd.MM.yyyy" locale="de,DE" />
<format property="TSTAMP" pattern="HH:mm" locale="de,DE" />
</tstamp>
<target name="clean">
<delete dir="${build.dir}" />
</target>
<target name="compile">
<mkdir dir="${classes.dir}" />
<javac encoding="UTF-8" srcdir="${src.dir}" destdir="${classes.dir}" includeantruntime="false" classpathref="classpath" />
<copy todir="${classes.dir}">
<fileset dir="${base.dir}" includes="*.yml,*.properties" />
</copy>
</target>
<target name="jar" depends="compile">
<git-revision path="${base.dir}" output="version" />
<mkdir dir="${jar.dir}" />
<jar destfile="${jar.dir}/${ant.project.name}.jar" basedir="${classes.dir}">
<manifest>
<attribute name="Built-By" value="Calenria" />
<attribute name="Built-Date" value="${DSTAMP} - ${TSTAMP}" />
<attribute name="Main-Class" value="${main-class}" />
<attribute name="Version" value="${version}" />
</manifest>
</jar>
</target>
<target name="run" depends="jar">
<java jar="${jar.dir}/${ant.project.name}.jar" fork="true" />
</target>
<target name="clean-build" depends="clean,jar" />
<target name="main" depends="clean,run" />
</project>