@@ -6,11 +6,15 @@ Gradle utilities for easier writing Bukkit plugins.
6
6
<!-- DON'T EDIT THIS SECTION, INSTEAD RE-RUN doctoc TO UPDATE -->
7
7
8
8
9
- - [ Apply plugin ] ( #apply-plugin )
9
+ - [ Installation ] ( #installation )
10
10
- [ First steps] ( #first-steps )
11
- - [ Configuring plugin] ( #configuring-plugin )
12
- - [ Repositories and Dependencies] ( #repositories-and-dependencies )
13
- - [ Running Dev server] ( #running-dev-server )
11
+ - [ Configuration] ( #configuration )
12
+ - [ Repositories and Dependencies] ( #repositories-and-dependencies )
13
+ - [ Running Dev server] ( #running-dev-server )
14
+ - [ Dev server configuration] ( #dev-server-configuration )
15
+ - [ Migration Guide] ( #migration-guide )
16
+ - [ Update to 0.9] ( #update-to-09 )
17
+ - [ License] ( #license )
14
18
15
19
<!-- END doctoc generated TOC please keep comment here to allow auto update -->
16
20
@@ -29,14 +33,14 @@ Gradle utilities for easier writing Bukkit plugins.
29
33
#### TODO:
30
34
- Add smart dependency system
31
35
32
- ## Apply plugin
36
+ ## Installation
33
37
[ BukkitGradle on plugins.gradle.org] ( https://plugins.gradle.org/plugin/ru.endlesscode.bukkitgradle )
34
38
> ** Note:** Gradle 6.6+ required
35
39
36
40
#### With new plugins mechanism
37
- ``` groovy
41
+ ``` kotlin
38
42
plugins {
39
- id "ru.endlesscode.bukkitgradle" version "0.9"
43
+ id( " ru.endlesscode.bukkitgradle" ) version " 0.9"
40
44
}
41
45
```
42
46
@@ -47,16 +51,16 @@ buildscript {
47
51
jcenter()
48
52
}
49
53
dependencies {
50
- classpath "gradle.plugin.ru.endlesscode:bukkit-gradle:0.9"
54
+ classpath( "gradle.plugin.ru.endlesscode:bukkit-gradle:0.9")
51
55
}
52
56
}
53
57
54
- apply plugin: "ru.endlesscode.bukkitgradle"
58
+ apply( plugin: "ru.endlesscode.bukkitgradle")
55
59
```
56
60
57
61
### First steps
58
62
Simple ` build.gradle ` file that use BukkitGradle:
59
- ``` groovy
63
+ ``` kotlin
60
64
plugins {
61
65
id(" ru.endlesscode.bukkitgradle" ) version " 0.9"
62
66
}
@@ -86,9 +90,9 @@ api-version: 1.16
86
90
` ` `
87
91
> **Note:** Main class built by following pattern: ` <groupId>.<name>`
88
92
89
- # ## Configuring plugin
93
+ # # Configuration
90
94
You can configure attributes that will be placed to `plugin.yml` :
91
- ` ` ` groovy
95
+ ` ` ` kotlin
92
96
// Override default configurations
93
97
bukkit {
94
98
// Version of API (if you will not set this property, will be used latest version at moment of BukkitGradle release)
@@ -120,7 +124,7 @@ authors: [OsipXD, Contributors]
120
124
If you want to add unsupported by BukkitGradle attributes, like a `depend`, `commands` etc.
121
125
Create `plugin.yml` file and put custom attributes there.
122
126
123
- # ## Repositories and Dependencies
127
+ # # Repositories and Dependencies
124
128
BukkitGradle provides short extension-functions to add common repositories and dependencies.
125
129
There are list of its.
126
130
@@ -135,7 +139,7 @@ dependencies {
135
139
}
136
140
` ` `
137
141
138
- # #### Repositories:
142
+ # ### Repositories:
139
143
Name | Url
140
144
----------------|-------------------------------------------------------------------
141
145
spigot | https://hub.spigotmc.org/nexus/content/repositories/snapshots/
@@ -147,7 +151,7 @@ dependencies {
147
151
placeholderapi | https://repo.extendedclip.com/content/repositories/placeholderapi/
148
152
aikar | https://repo.aikar.co/content/groups/aikar/
149
153
150
- # #### Dependencies:
154
+ # ### Dependencies:
151
155
Some dependencies also applies repo needed for them.
152
156
153
157
Name | Signature | Applies repo
@@ -159,9 +163,9 @@ Some dependencies also applies repo needed for them.
159
163
160
164
**Note:** `$apiVersion` - is `${version}-R0.1-SNAPSHOT` (where `$version` is `bukkit.version`)
161
165
162
- If you need more extension-functions, [create issue](https://github.com/EndlessCodeGroup/BukkitGradle/issues/new) .
166
+ If you need more extension-functions, [create issue][issue] .
163
167
164
- # ## Running Dev server
168
+ # # Running Dev server
165
169
Before running server you should configure dev server location.
166
170
167
171
You can define it in `local.properties` file (that was automatically created in project directory on refresh) :
@@ -182,17 +186,17 @@ If there no BuildTools.jar it will be automatically downloaded.
182
186
> Specify environment variables `BUKKIT_DEV_SERVER_HOME`
183
187
and `BUKKIT_BUILDTOOLS_HOME`.
184
188
185
- # #### On IntelliJ IDEA
189
+ # ### On IntelliJ IDEA
186
190
Run `:buildIdeaRun` task.
187
191
Run Configuration will be added to your IDE.
188
192
It will be automatically refreshed when you change server configurations.
189
193
190
194

191
195
192
- # #### On other IDEs
196
+ # ### On other IDEs
193
197
Run `:runServer` task.
194
198
195
- # ### Dev server configuration
199
+ # ## Dev server configuration
196
200
To accept EULA and change settings use `bukkit.server` section :
197
201
` ` ` groovy
198
202
bukkit {
@@ -218,3 +222,72 @@ bukkit {
218
222
}
219
223
` ` `
220
224
EULA and online-mode settings in `build.gradle` always rewrites settings in `eula.txt` and `server.properties`
225
+
226
+ # # Migration Guide
227
+
228
+ # ## Update to 0.9
229
+
230
+ 1. Update gradle to 6.6 or newer :
231
+ ` ` ` shell
232
+ $ ./gradlew wrapper --gradle-version 6.7.1
233
+ ` ` `
234
+ 1. Use syntax `.set` in `bukkit.meta` instead of `=` :
235
+ ` ` ` diff
236
+ bukkit {
237
+ meta {
238
+ - desctiption = "My plugin's description"
239
+ + description.set("My plugin's description")
240
+ }
241
+ }
242
+ ` ` `
243
+ 1. Use `bukkit.apiVersion` instead of `bukkit.version` :
244
+ ` ` ` diff
245
+ bukkit {
246
+ - version = "1.16.4"
247
+ + apiVersion = "1.16.4"
248
+ }
249
+ ` ` `
250
+ 1. Use `build.server` block instead of `build.run` :
251
+ ` ` ` diff
252
+ bukkit {
253
+ - run {
254
+ + server {
255
+ core = "paper"
256
+ }
257
+ }
258
+ ` ` `
259
+ 1. Update arguments assignment syntax :
260
+ ` ` ` diff
261
+ bukkit {
262
+ server {
263
+ - jvmArgs = "-Xmx2G -Xms512M"
264
+ + jvmArgs = ["-Xmx2G", "-Xms512M"]
265
+ + //or jvmArgs("-Xms512M") if you don't want to override defaults
266
+ }
267
+ }
268
+ ` ` `
269
+ 1. Replace removed APIs :
270
+ ` ` ` diff
271
+ repositories {
272
+ - destroystokyo()
273
+ + papermc()
274
+
275
+ - vault()
276
+ + jitpack()
277
+ }
278
+
279
+ dependencies {
280
+ - compileOnly(craftbikkit())
281
+ + compileOnly(spigot())
282
+ }
283
+ ` ` `
284
+ 1. Remove `q` and `qq` functions calls in `meta { ... }`
285
+ 1. Check generated plugin.yml contents after build.
286
+
287
+ If there are any problems, [create an issue][issue].
288
+
289
+ # # License
290
+
291
+ [MIT](LICENSE) (c) 2020 EndlessCode Group
292
+
293
+ [issue] : https://github.com/EndlessCodeGroup/BukkitGradle/issues/new
0 commit comments