-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbuild.xml
100 lines (82 loc) · 3.49 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
<project default="jar">
<property name="build" location="bin" />
<property name="build.result" location="${build}/test-result" />
<property name="dist" location="." />
<property name="lib" location="lib" />
<property name="src" location="src" />
<property name="src.shellparser" location="${lib}/CommandHandler/lib/ShellParser/src" />
<property name="src.commandhandler" location="${lib}/CommandHandler/src" />
<path id="project.classpath">
<pathelement path="${classpath}" />
<pathelement location="${lib}/bukkit-0.0.1-SNAPSHOT.jar" />
<pathelement location="${lib}/Permissions.jar" />
<pathelement location="${lib}/junit.jar" />
</path>
<target name="init">
<tstamp />
<mkdir dir="${build}" />
<mkdir dir="${build.result}" />
<mkdir dir="${lib}" />
<get src="http://ci.bukkit.org/job/dev-Bukkit/lastSuccessfulBuild/artifact/target/bukkit-0.0.1-SNAPSHOT.jar" dest="${lib}" skipexisting="true" />
<get src="http://www.theyeticave.net/downloads/permissions/3.1.6/Permissions.jar" dest="${lib}" skipexisting="true" />
<get src="http://cloud.github.com/downloads/KentBeck/junit/junit-4.8.2.jar" dest="${lib}/junit.jar" skipexisting="true" />
</target>
<target name="compile" depends="init">
<javac destdir="${build}" includeAntRuntime="false" debug="on" debuglevel="lines,vars,source">
<src path="${src}" />
<src path="${src.shellparser}" />
<src path="${src.commandhandler}" />
<classpath refid="project.classpath" />
<compilerarg value="-Werror" />
</javac>
<copy file="${src}/plugin.yml" tofile="${build}/plugin.yml" />
</target>
<target name="test" depends="compile">
<junit printsummary="yes" haltonfailure="no">
<formatter type="xml" />
<classpath>
<path refid="project.classpath" />
<pathelement path="${build}" />
</classpath>
<batchtest todir="${build.result}">
<fileset dir="${src}">
<include name="**/test/**/*.java" />
</fileset>
<fileset dir="${src.shellparser}">
<include name="**/test/**/*.java" />
</fileset>
<fileset dir="${src.commandhandler}">
<include name="**/test/**/*.java" />
</fileset>
</batchtest>
</junit>
</target>
<target name="gitinfo">
<exec executable="git" outputproperty="git.revision">
<arg value="rev-parse"/>
<arg value="HEAD"/>
</exec>
</target>
<target name="tag" depends="gitinfo">
<replace file="${build}/plugin.yml" token="@BUILD@" value="${git.revision}" />
</target>
<target name="retag" depends="gitinfo">
<delete file="${build}/plugin.yml" />
<antcall target="compile" />
<antcall target="tag" />
</target>
<target name="jar" depends="compile,retag">
<jar jarfile="${dist}/OpenItem.jar" basedir="${build}" includes="**/*.class plugin.yml">
<manifest>
<attribute name="Main-Class" value="OpenItem" />
</manifest>
</jar>
</target>
<target name="clean">
<delete dir="${build}" />
<delete>
<fileset dir="${lib}" includes="*.jar" />
</delete>
<delete file="${dist}/OpenItem.jar" />
</target>
</project>