-
Notifications
You must be signed in to change notification settings - Fork 3
/
build.xml
76 lines (64 loc) · 2.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
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<project name="PropertyGroup" default="dist" basedir=".">
<property name="pluginname" value="PropertyGroup"/>
<property name="src" value="src"/>
<property name="bin" value="bin"/>
<property name="dist" value="dist"/>
<property name="api" value="api"/>
<!-- Libraries -->
<fileset dir="${api}" id="api">
<include name="*.jar"/>
</fileset>
<!-- Jenkins integration -->
<property environment="env"/>
<condition property="BUILD_NUMBER" value="${env.BUILD_NUMBER}" else="MANUAL">
<isset property="env.BUILD_NUMBER"/>
</condition>
<condition property="GIT_COMMIT_FULL" value="${env.GIT_COMMIT}" else="MANUAL">
<isset property="env.GIT_COMMIT"/>
</condition>
<condition property="label" value="${label}" else="Compiling ${pluginname}">
<isset property="label"/>
</condition>
<target name="init">
<delete dir="${bin}"/>
<mkdir dir="${bin}"/>
</target>
<target name="compile" depends="init">
<!-- Load the version -->
<loadfile srcfile="VERSION" property="VERSION"/>
<!-- Replace ${VERSION} with the version number in plugin.yml -->
<replace file="plugin.yml" value="${VERSION} (b${BUILD_NUMBER})">
<replacefilter token="@VERSION@"/>
</replace>
<echo>${label}</echo>
<javac source="1.6" target="1.6" srcdir="${src}" destdir="${bin}"
debug="true" debuglevel="lines,vars,source" deprecation="true"
includeantruntime="true" verbose="true">
<compilerarg value="-Xlint:-options"/>
<classpath>
<fileset refid="api"/>
</classpath>
</javac>
</target>
<target name="dist" depends="compile">
<mkdir dir="${dist}"/>
<jar jarfile="${dist}/${pluginname}.jar">
<fileset dir="${bin}"/>
<fileset file="plugin.yml"/>
<fileset file="config.yml"/>
<manifest>
<attribute name="Implementation-Title" value="PropertyGroup"/>
<attribute name="Implementation-Vendor" value="FireBall1725"/>
<attribute name="Implementation-Version" value="b${BUILD_NUMBER}"/>
</manifest>
</jar>
</target>
<target name="deploy" depends="dist">
<copy file="${dist}/${pluginname}.jar" todir="${plugins}"/>
<delete dir="${bin}"/>
</target>
<target name="clean" depends="deploy">
<delete dir="${bin}"/>
</target>
</project>