forked from Zarius/Bukkit-OtherBlocks
-
Notifications
You must be signed in to change notification settings - Fork 3
/
build.xml
217 lines (190 loc) · 9.66 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
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<project name="OtherDrops" basedir="." default="build">
<property name="lib" location="lib" />
<property name="src" location="src" />
<property name="rsrc" location="rsrc" />
<!--
Include Ant-Contrib tasks
See: http://ant-contrib.sourceforge.net/tasks/tasks/
-->
<taskdef resource="net/sf/antcontrib/antlib.xml">
<classpath>
<pathelement location="${lib}/ant-contrib-1.0b3.jar" />
</classpath>
</taskdef>
<!--/
Auto-increment revision number and build date.
-->
<propertyfile file="version.properties">
<entry key="build.revision.number" type="int" operation="+" value="1" pattern="00" />
<entry key="build.date" type="date" value="now" />
</propertyfile>
<property file="version.properties" />
<!--
Copy the template to live file and replace build date and version number fields.
-->
<copy file="rsrc/plugin.yml.template" tofile="rsrc/plugin.yml" overwrite="true" />
<replace file="rsrc/plugin.yml" value="value not found in version.properties" propertyFile="version.properties">
<replacefilter token="@build.date-refer to version.properties for details@" property="build.date" />
<replacefilter token="@build.date@" property="build.date" />
<replacefilter token="@build.major@" property="build.major.number" />
<replacefilter token="@build.minor@" property="build.minor.number" />
<replacefilter token="@build.revision@" property="build.revision.number" />
</replace>
<!--
Read in the version number from the .yml file.
Ensures the zip has the same version as the actual plugin.yml.
-->
<loadfile srcFile="${rsrc}/plugin.yml" property="otherdrops.version">
<filterchain>
<linecontainsregexp>
<regexp pattern="^version:\s*.*$" />
</linecontainsregexp>
<tokenfilter>
<replaceregex pattern="^version:\s*(.*)$" replace="\1" />
</tokenfilter>
<striplinebreaks />
</filterchain>
</loadfile>
<!--
Find latest Bukkit jar in lib directory
You may manually override this property by setting lib.bukkit.version
on the command line using the -D switch, e.g.:
$ ant -Dlib.bukkit.version="0.0.1-r746" build
-->
<last id="lib.bukkit.jar">
<sort>
<fileset dir="${lib}" includes="bukkit-*.jar" />
</sort>
</last>
<property name="lib.bukkit.jar" refid="lib.bukkit.jar" />
<propertyregex property="lib.bukkit.version" input="${lib.bukkit.jar}" regexp="([\d\.-R]+-r\d+)\.jar$" select="\1" />
<property name="output-jar" value="${ant.project.name}.jar" />
<property name="events-dir" value="${ant.project.name}/events" />
<property name="debuglevel" value="source,lines" />
<!-- These custom settings work if you set them to run before any other build targets -->
<target name="celtic">
<property name="dependencies" value="../lib" />
<property name="lib.bukkit" location="${dependencies}/bukkit.jar" />
<property name="export-dir" value="../../plugins/" />
<property name="economy-dir" value="${dependencies}/economy" />
<property name="iConomy" value="iConomy" />
</target>
<target name="zarius">
<property name="dependencies" value="dependencies" />
<property name="lib.bukkit" location="lib/bukkit.jar" />
<property name="export-dir" value="/home/zarius/Games/Minecraft/Servers/Ifami/Testing/plugins/" />
</target>
<!-- Default setting (if custom setting above not set) -->
<target name="default">
<property name="lib.bukkit" location="${lib}/bukkit.jar" />
<property name="dependencies" value="dependencies" />
<property name="economy-dir" value="${dependencies}/EconomyRegister" />
<property name="iConomy" value="iCo" />
</target>
<target name="init" depends="default">
<echo message="Building ${ant.project.name} ${otherdrops.version} against Bukkit ${lib.bukkit.version}..." />
<mkdir dir="bin" />
<!--<copy file="${src}/plugin.yml" todir="bin" />-->
<property name="bigbrother-location" value="${dependencies}/BigBrother.jar" />
<property name="logblock-location" value="${dependencies}/LogBlock.jar" />
<property name="coreprotect-location" value="${dependencies}/CoreProtect.jar" />
<property name="mobarena-location" value="${dependencies}/MobArena.jar" />
<property name="moneydrop-location" value="${dependencies}/MoneyDrop.jar" />
<property name="heroes-location" value="${dependencies}/Heroes.jar" />
<property name="worldguard-location" value="${dependencies}/WorldGuard.jar" />
<property name="worldedit-location" value="${dependencies}/WorldEdit.jar" />
<property name="hawkeye-location" value="${dependencies}/HawkEye.jar" />
<property name="vault-location" value="${dependencies}/Vault.jar" />
<property name="regenblock-location" value="${dependencies}/RegenBlock.jar" />
<property name="prism-location" value="${dependencies}/Prism.jar" />
<property name="rpgitems-location" value="${dependencies}/rpgitems.jar" />
<property name="mcmmo-location" value="${dependencies}/mcMMO.jar" />
<path id="classpath">
<pathelement location="bin" />
<pathelement location="${lib.bukkit}" />
<pathelement location="${logblock-location}" />
<pathelement location="${coreprotect-location}" />
<pathelement location="${bigbrother-location}" />
<pathelement location="${mobarena-location}" />
<pathelement location="${moneydrop-location}" />
<pathelement location="${heroes-location}" />
<pathelement location="${worldguard-location}" />
<pathelement location="${worldedit-location}" />
<pathelement location="${hawkeye-location}" />
<pathelement location="${vault-location}" />
<pathelement location="${regenblock-location}" />
<pathelement location="${prism-location}" />
<pathelement location="${rpgitems-location}" />
<pathelement location="${mcmmo-location}" />
</path>
</target>
<target name="clean">
<delete dir="bin" />
<delete dir="${ant.project.name}/events" includes="**/*" />
<delete file="${output-jar}" />
<delete dir="builds" />
</target>
<target name="build" depends="init">
<echo message="${ant.project.name}: ${ant.file}" />
<javac debug="true" debuglevel="${debuglevel}" destdir="bin" includeAntRuntime="no">
<src path="${src}" />
<classpath refid="classpath" />
</javac>
</target>
<target name="jar" depends="build">
<!-- The event jars -->
<jar destfile="${events-dir}/Weather.jar">
<fileset dir="bin">
<include name="**/odspecials/LightningEvent.*" />
<include name="**/odspecials/StormEvent.*" />
<include name="**/odspecials/ThunderEvent.*" />
<include name="**/odspecials/WeatherEvents.*" />
</fileset>
<fileset dir="${rsrc}/Weather/" includes="event.info" />
</jar>
<jar destfile="${events-dir}/Trees.jar">
<fileset dir="bin">
<include name="**/odspecials/TreeEvent.*" />
<include name="**/odspecials/TreeEvents.*" />
</fileset>
<fileset dir="${rsrc}/Trees/" includes="event.info" />
</jar>
<jar destfile="${events-dir}/Explosions.jar">
<fileset dir="bin">
<include name="**/odspecials/ExplosionEvents.*" />
<include name="**/odspecials/ExplodeEvent.*" />
</fileset>
<fileset dir="${rsrc}/Explosions/" includes="event.info" />
</jar>
<jar destfile="${events-dir}/Sheep.jar">
<fileset dir="bin">
<include name="**/odspecials/SheepEvents.*" />
<include name="**/odspecials/ShearEvent.*" />
<include name="**/odspecials/DyeEvent.*" />
</fileset>
<fileset dir="${rsrc}/Sheep/" includes="event.info" />
</jar>
<jar destfile="${output-jar}">
<fileset dir="bin/" excludes="**/odspecials/*.class" />
<fileset dir="rsrc/" includes="plugin.yml" />
<fileset dir="OtherDrops/" />
</jar>
</target>
<target name="dist" depends="clean,build,jar">
<!-- Dist no longer needed? The jar is now our distribution.
<property name="zipfile" value="builds/${ant.project.name}_${otherdrops.version}.zip" />
<zip destfile="${zipfile}" basedir="." includes="${output-jar} ${ant.project.name}/" />
-->
</target>
<!-- "export-dir" parameter needs to be defined in a custom settings build target -->
<target name="test" depends="jar" if="export-dir">
<copy file="${output-jar}" todir="${export-dir}" />
<!-- Yes, still need to copy the events files in case they have been updated. -->
<copy todir="${export-dir}/OtherDrops/events">
<fileset dir="${events-dir}" />
</copy>
<property name="build.number" value="${build.major.number}.${build.minor.number}.${build.revision.number}" />
<echo>Current build number:${build.number}</echo>
</target>
</project>