-
Notifications
You must be signed in to change notification settings - Fork 17
/
build.xml
108 lines (86 loc) · 4 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
101
102
103
104
105
106
107
108
<?xml version="1.0" ?>
<project name="LWC" default="all">
<!-- Name of the jar to create -->
<property name="jar.core" value="LWC.jar"/>
<property name="jar.economy" value="LWC-Economy.jar"/>
<property name="lib" value="lib"/>
<property name="src" value="src"/>
<property name="bin" value="bin"/>
<property name="modules" value="modules"/>
<property name="core" value="${modules}/core/src/"/>
<property name="economy" value="${modules}/economy/src/"/>
<property name="build" value="build"/>
<!-- Location of the plugins folder development server -->
<property name="dev" value="../../minecraft/plugins"/>
<!-- Libraries used by LWC & modules -->
<fileset dir="${lib}" id="libs">
<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" value="${env.GIT_COMMIT}" else="MANUAL">
<isset property="env.GIT_COMMIT"/>
</condition>
<target name="all" depends="clean,compile,build,lwc,economy" description="Main target"/>
<target name="clean">
<!-- Delete the previous folders -->
<delete dir="${bin}/core/"/>
<delete dir="${bin}/economy/"/>
<!-- create some folders -->
<mkdir dir="${bin}/core/"/>
<mkdir dir="${bin}/economy/"/>
</target>
<target name="compile" description="Compilation">
<echo>${label}</echo>
<javac srcdir="${src}/main/java/;${core};" destdir="${bin}/core/"
debug="true" debuglevel="lines,vars,source" deprecation="true" includeantruntime="true">
<classpath>
<fileset refid="libs"/>
</classpath>
</javac>
<echo>Compiling LWC-Economy</echo>
<javac srcdir="${economy}/main/java/" destdir="${bin}/economy/" deprecation="true" debug="true"
debuglevel="lines,vars,source" includeantruntime="true">
<classpath>
<fileset refid="libs"/>
<dirset dir="${bin}/core/"/>
</classpath>
</javac>
</target>
<target name="build" description="Build the distribution files">
<delete dir="${build}"/>
<mkdir dir="${build}"/>
<copy tofile="${build}/VERSION" file="VERSION" overwrite="yes"/>
</target>
<target name="lwc" description="Build LWC.jar">
<echo>Building LWC.jar</echo>
<jar jarfile="${build}/${jar.core}">
<fileset dir="${src}" includes="lang/*"/>
<fileset dir="${src}/resources/" includes="plugin.yml"/>
<fileset dir="${bin}/core/"/>
<manifest>
<attribute name="Implementation-Title" value="LWC"/>
<attribute name="Implementation-Vendor" value="Hidendra"/>
<!-- <attribute name="Implementation-Version" value="git-LWC-${GIT_COMMIT}-b${BUILD_NUMBER}jnks" /> -->
<attribute name="Implementation-Version" value="${BUILD_NUMBER}"/>
</manifest>
</jar>
</target>
<target name="economy" description="Build LWC-economy.jar">
<echo>Building LWC-Economy.jar</echo>
<jar jarfile="${build}/${jar.economy}">
<fileset dir="${economy}/resources/" includes="plugin.yml"/>
<fileset dir="${bin}/economy/"/>
<manifest>
<attribute name="Class-Path" value="LWC.jar"/>
<attribute name="Implementation-Title" value="LWC"/>
<attribute name="Implementation-Vendor" value="Hidendra"/>
<!-- <attribute name="Implementation-Version" value="git-LWC-${GIT_COMMIT}-b${BUILD_NUMBER}jnks" /> -->
<attribute name="Implementation-Version" value="${BUILD_NUMBER}"/>
</manifest>
</jar>
</target>
</project>