forked from ModDamage/ModDamage
-
Notifications
You must be signed in to change notification settings - Fork 0
/
build-jenkins.xml
54 lines (47 loc) · 1.88 KB
/
build-jenkins.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
<project name="Jenkins-BukkitPlugin" default="clean">
<!-- START PREDEFINED -->
<property environment="env"/>
<property name="sourceFolder" location="src"/>
<property name="buildFolder" location="bin"/>
<property name="dependencyFolder" location="resource"/>
<!-- END PREDEFINED -->
<target name="init">
<tstamp/>
<mkdir dir="${buildFolder}"/>
</target>
<target name="compile" depends="init" description="Compile class files">
<echo message="Compiling source into ${buildFolder}..."/>
<path id="project.classpath">
<fileset dir="${dependencyFolder}">
<include name="*.jar"/>
</fileset>
<fileset dir="includes">
<include name="*.jar"/>
</fileset>
</path>
<javac srcdir="${sourceFolder}" destdir="${buildFolder}" classpathref="project.classpath" source="1.6" target="1.6" debug="on" includeantruntime="false" />
</target>
<!-- Append Jenkins build number. -->
<target name="addJenkinsBuild" depends="compile">
<replaceregexp file="plugin.yml" match="^version: ([^ ]*)( DEV)$" replace="version: \1 build ${env.BUILD_NUMBER}" byline="true"/>
</target>
<!-- Slap the JAR together. -->
<target name="jar" depends="addJenkinsBuild" description="Pack JAR file">
<jar destfile="${env.JOB_NAME}.jar" update="no">
<fileset dir="${buildFolder}" includes="**/*.class"/>
<fileset dir="." includes="plugin.yml"/>
<zipgroupfileset dir="includes" includes="*.jar" />
<manifest>
<attribute name="Job" value="${env.JOB_NAME}"/>
<attribute name="Built-By" value="ModDamage Jenkins"/>
<!-- <attribute name="Version" value="${version}"/> -->
<attribute name="Build" value="${env.BUILD_NUMBER}"/>
</manifest>
</jar>
</target>
<!-- Made the JAR, so get rid of the excess .class files. -->
<target name="clean" depends="jar">
<echo message="Deleting .class files..."/>
<delete dir="${buildFolder}"/>
</target>
</project>