-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbuild.xml
88 lines (78 loc) · 3.36 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
<?xml version="1.0" encoding="UTF-8"?>
<!--
This program is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License version 2
as published by the Free Software Foundation.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License along
with this program; if not, see <http://www.gnu.org/licenses/>
-->
<project default="all">
<property name="mainJar" value="StrategicClientLib.jar" />
<property name="destDir" value="bin" />
<property name="javadoc" value="doc/javadoc" />
<property name="srcDir" value="src" />
<path id="project.class.path">
<pathelement location="lib/slf4j-api-1.7.5.jar"/>
<pathelement path="lib/logback-core-1.0.13.jar"/>
<pathelement path="lib/logback-classic-1.0.13.jar"/>
</path>
<manifestclasspath property="pm.cp" jarfile="${mainJar}">
<classpath refid="project.class.path" />
</manifestclasspath>
<target name="clean" description="delete everything that might have previously been created" >
<delete dir="${destDir}"/>
<delete file="${mainJar}"></delete>
<delete dir="${javadoc}"/>
</target>
<target name="prepare" depends="clean" description="Prepare for building" >
<tstamp>
<format property="TODAY" pattern="yyyy-MM-dd HH:mm:ss" />
</tstamp>
<mkdir dir="${destDir}"/>
<!-- Gets the Head commit id-->
<exec executable = "git" output="${destDir}/commit-id" failifexecutionfails="no">
<arg value = "rev-parse" />
<arg value = "HEAD" />
</exec>
<!-- checks if changes to Head have been made in the working copy -->
<exec executable = "git" output="${destDir}/commit-id" append="true" failifexecutionfails="no">
<arg value = "diff" />
<arg value = "--shortstat" />
</exec>
</target>
<target name="compile" depends="prepare" description="compile *.java to *.class">
<javac srcdir="${srcDir}" destdir="${destDir}" includeantruntime="false" debug="true" debuglevel="lines,vars,source">
<classpath refid="project.class.path"/>
</javac>
</target>
<target name="jar" depends="compile" description="create the Jar File">
<jar destfile="${mainJar}" update="false">
<fileset dir="${destDir}">
<include name="**/*.class" />
<include name="commit-id" />
</fileset>
<manifest>
<attribute name="Built-By" value="${user.name}"/>
<attribute name="Built-Date" value="${TODAY}"/>
</manifest>
</jar>
</target>
<target name="javadoc" description="create Documentation" >
<javadoc packagenames="de.nomagic.*"
sourcepath="${srcDir}"
destdir="${javadoc}"
Version="yes"
Use="yes"
Author="yes"
serialwarn="yes"
Encoding="UTF-8">
<classpath refid="project.class.path"/>
</javadoc>
</target>
<target name="all" depends="jar">
</target>
</project>