-
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbuild.xml
213 lines (179 loc) · 9.81 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
<?xml version="1.0" encoding="UTF-8"?>
<project name="BentoBoxWorldCheckout" default="usage" basedir=".">
<description>Git Tree Checkout Tasks</description>
<property name="git.url" value="https://github.com/BentoBoxWorld"/>
<dirname property="directory.root" file="${ant.file}"/>
<property name="plugin.root" value="${directory.root}/plugin"/>
<property name="addons.root" value="${directory.root}/addons"/>
<target name="usage">
<echo>
Usage:
ant bentobox-plugin
ant bentobox-addons
ant bentobox-complete
ant setup-test-server
</echo>
</target>
<target name="bentobox-complete" description="Checkout BentoBoxWorld plugin and all official addons">
<antcall target="bentobox-plugin"/>
<antcall target="bentobox-addons"/>
</target>
<target name="bentobox-plugin" description="Checkout BentoBoxWorld plugin">
<mkdir dir="${plugin.root}"/>
<property name="bentoboxworld.branch" value="master" />
<git.clone.pull tree.name="bentobox" repository="${git.url}/BentoBox.git" branch="${bentoboxworld.branch}" output.directory="${plugin.root}"/>
</target>
<target name="bentobox-addons" description="Checkout BentoBoxWorld official addons">
<antcall target="checkout-acidisland"/>
<antcall target="checkout-bskyblock"/>
<antcall target="checkout-caveblock"/>
<antcall target="checkout-skygrid"/>
<antcall target="checkout-biomes"/>
<antcall target="checkout-level"/>
<antcall target="checkout-challenges"/>
<antcall target="checkout-islandfly"/>
<antcall target="checkout-welcomewarpsigns"/>
<antcall target="checkout-limits"/>
<antcall target="checkout-invswitcher"/>
<antcall target="checkout-advancements"/>
<antcall target="checkout-magiccobblestonegenerator"/>
<antcall target="checkout-greenhouses"/>
<antcall target="checkout-schem-panel"/>
</target>
<target name="checkout-caveblock" description="Checkout CaveBlock Addon">
<mkdir dir="${addons.root}"/>
<property name="bentoboxworld.branch" value="master" />
<git.clone.pull tree.name="caveblock" repository="${git.url}/CaveBlock.git" branch="${bentoboxworld.branch}" output.directory="${addons.root}"/>
</target>
<target name="checkout-greenhouses" description="Checkout GreenHouses Addon">
<mkdir dir="${addons.root}"/>
<property name="bentoboxworld.branch" value="master" />
<git.clone.pull tree.name="greenhouses" repository="${git.url}/Greenhouses.git" branch="${bentoboxworld.branch}" output.directory="${addons.root}"/>
</target>
<target name="checkout-skygrid" description="Checkout SkyGrid Addon">
<mkdir dir="${addons.root}"/>
<property name="bentoboxworld.branch" value="master" />
<git.clone.pull tree.name="skygrid" repository="${git.url}/SkyGrid.git" branch="${bentoboxworld.branch}" output.directory="${addons.root}"/>
</target>
<target name="checkout-acidisland" description="Checkout AcidIsland Addon">
<mkdir dir="${addons.root}"/>
<property name="bentoboxworld.branch" value="develop" />
<git.clone.pull tree.name="acidisland" repository="${git.url}/AcidIsland.git" branch="${bentoboxworld.branch}" output.directory="${addons.root}"/>
</target>
<target name="checkout-schem-panel" description="Checkout schem-panel Addon">
<mkdir dir="${addons.root}"/>
<property name="bentoboxworld.branch" value="develop" />
<git.clone.pull tree.name="schem-panel" repository="${git.url}/schem-panel.git" branch="${bentoboxworld.branch}" output.directory="${addons.root}"/>
</target>
<target name="checkout-bskyblock" description="Checkout BSkyBlock Addon">
<mkdir dir="${addons.root}"/>
<property name="bentoboxworld.branch" value="develop" />
<git.clone.pull tree.name="bskyblock" repository="${git.url}/BSkyBlock.git" branch="${bentoboxworld.branch}" output.directory="${addons.root}"/>
</target>
<target name="checkout-biomes" description="Checkout Biomes Addon">
<mkdir dir="${addons.root}"/>
<property name="bentoboxworld.branch" value="develop" />
<git.clone.pull tree.name="biomes" repository="${git.url}/addon-biomes.git" branch="${bentoboxworld.branch}" output.directory="${addons.root}"/>
</target>
<target name="checkout-level" description="Checkout Level Addon">
<mkdir dir="${addons.root}"/>
<property name="bentoboxworld.branch" value="develop" />
<git.clone.pull tree.name="level" repository="${git.url}/Level.git" branch="${bentoboxworld.branch}" output.directory="${addons.root}"/>
</target>
<target name="checkout-challenges" description="Checkout Challenges Addon">
<mkdir dir="${addons.root}"/>
<property name="bentoboxworld.branch" value="develop" />
<git.clone.pull tree.name="challenges" repository="${git.url}/addon-challenges.git" branch="${bentoboxworld.branch}" output.directory="${addons.root}"/>
</target>
<target name="checkout-islandfly" description="Checkout IslandFly Addon">
<mkdir dir="${addons.root}"/>
<property name="bentoboxworld.branch" value="develop" />
<git.clone.pull tree.name="islandfly" repository="${git.url}/IslandFly.git" branch="${bentoboxworld.branch}" output.directory="${addons.root}"/>
</target>
<target name="checkout-welcomewarpsigns" description="Checkout WelcomeWarpSings Addon">
<mkdir dir="${addons.root}"/>
<property name="bentoboxworld.branch" value="develop" />
<git.clone.pull tree.name="welcomewarpsigns" repository="${git.url}/addon-welcomewarpsigns.git" branch="${bentoboxworld.branch}" output.directory="${addons.root}"/>
</target>
<target name="checkout-limits" description="Checkout Limits Addon">
<mkdir dir="${addons.root}"/>
<property name="bentoboxworld.branch" value="develop" />
<git.clone.pull tree.name="limits" repository="${git.url}/addon-limits.git" branch="${bentoboxworld.branch}" output.directory="${addons.root}"/>
</target>
<target name="checkout-invswitcher" description="Checkout InvSwitcher Addon">
<mkdir dir="${addons.root}"/>
<property name="bentoboxworld.branch" value="develop" />
<git.clone.pull tree.name="invswitcher" repository="${git.url}/addon-invSwitcher.git" branch="${bentoboxworld.branch}" output.directory="${addons.root}"/>
</target>
<target name="checkout-advancements" description="Checkout Advancements Addon">
<mkdir dir="${addons.root}"/>
<property name="bentoboxworld.branch" value="develop" />
<git.clone.pull tree.name="advancements" repository="${git.url}/Advancements.git" branch="${bentoboxworld.branch}" output.directory="${addons.root}"/>
</target>
<target name="checkout-magiccobblestonegenerator" description="Checkout MagicCobblestoneGenerator Addon">
<mkdir dir="${addons.root}"/>
<property name="bentoboxworld.branch" value="develop" />
<git.clone.pull tree.name="magiccobblestonegenerator" repository="${git.url}/MagicCobblestoneGenerator.git" branch="${bentoboxworld.branch}" output.directory="${addons.root}"/>
</target>
<target name="setup-test-server" description="Download and setup latest Spigot server using BuildTools.">
<property name="build.server" value="${directory.root}/buildserver"/>
<property name="debug.server" value="${directory.root}/server"/>
<mkdir dir="${build.server}"/>
<sequential>
<get src="https://hub.spigotmc.org/jenkins/job/BuildTools/lastSuccessfulBuild/artifact/target/BuildTools.jar" dest="${build.server}/BuildTools.jar" usetimestamp="false"/>
<java jar="${build.server}/BuildTools.jar" fork="true" failonerror="true" dir="${build.server}">
<arg value="--rev"/>
<arg value="latest"/>
</java>
<mkdir dir="${debug.server}"/>
<move todir="${debug.server}">
<fileset dir="${build.server}">
<include name="craftbukkit-*.jar"/>
</fileset>
<mapper type="glob" from="craftbukkit-*.jar" to="craftbukkit.jar"/>
</move>
<move todir="${debug.server}">
<fileset dir="${build.server}">
<include name="spigot-*.jar"/>
</fileset>
<mapper type="glob" from="spigot-*.jar" to="spigot.jar"/>
</move>
</sequential>
</target>
<target name="clear-server-build" description="This command removes BuildServer">
<property name="build.server" value="${directory.root}/buildserver"/>
<delete dir="${build.server}"/>
</target>
<target name="clear-server" description="This command removes BuildServer">
<property name="debug.server" value="${directory.root}/server"/>
<delete dir="${debug.server}"/>
</target>
<macrodef name="git">
<attribute name = "command" />
<attribute name = "dir" default = "" />
<element name = "args" optional = "true" />
<sequential>
<echo message = "git @{command}" />
<exec executable = "git" dir = "@{dir}">
<arg value = "@{command}" />
<args/>
</exec>
</sequential>
</macrodef>
<macrodef name="git.clone.pull">
<attribute name="tree.name"/>
<attribute name="branch"/>
<attribute name="repository" default="${git.url}/@{tree.name}.git"/>
<attribute name="output.directory"/>
<sequential>
<mkdir dir="@{output.directory}/@{tree.name}"/>
<git command="clone">
<args>
<arg value="@{repository}"/>
<arg value="@{output.directory}/@{tree.name}"/>
</args>
</git>
<git command="pull" dir="@{output.directory}/@{tree.name}"/>
</sequential>
</macrodef>
</project>