@@ -9,7 +9,7 @@ Gradle utilities to simplify Bukkit/Spigot plugins writing and debugging.
9
9
10
10
11
11
- [ Installation] ( #installation )
12
- - [ First steps ] ( #first-steps )
12
+ - [ Quick Start ] ( #quick-start )
13
13
- [ Configuration] ( #configuration )
14
14
- [ Repositories and Dependencies] ( #repositories-and-dependencies )
15
15
- [ Running Dev server] ( #running-dev-server )
@@ -21,7 +21,6 @@ Gradle utilities to simplify Bukkit/Spigot plugins writing and debugging.
21
21
<!-- END doctoc generated TOC please keep comment here to allow auto update -->
22
22
23
23
#### Features:
24
- - Automatically applies plugin: java
25
24
- Sets up compiler encoding to UTF-8
26
25
- Sets archivesBaseName to plugin name
27
26
- Supports APIs: Bukkit, CraftBukkit, Spigot, Paper
@@ -35,33 +34,22 @@ Gradle utilities to simplify Bukkit/Spigot plugins writing and debugging.
35
34
36
35
## Installation
37
36
38
- [ BukkitGradle on plugins.gradle.org ] ( https://plugins.gradle.org/plugin/ru.endlesscode.bukkitgradle )
39
- > ** Note: ** Gradle 8.0+ is required
37
+ > [ !NOTE ]
38
+ > BukkitGradle requires Gradle 8.0+ to run
40
39
41
- #### With new plugins mechanism
42
40
``` kotlin
43
41
plugins {
44
42
id(" ru.endlesscode.bukkitgradle" ) version " 0.10.1"
45
43
}
46
44
```
47
45
48
- #### With buildscript and apply
49
- ``` groovy
50
- buildscript {
51
- repositories {
52
- mavenCentral()
53
- }
54
- dependencies {
55
- classpath("gradle.plugin.ru.endlesscode:bukkit-gradle:0.10.1")
56
- }
57
- }
46
+ [ BukkitGradle on plugins.gradle.org] ( https://plugins.gradle.org/plugin/ru.endlesscode.bukkitgradle )
58
47
59
- apply(plugin: "ru.endlesscode.bukkitgradle")
60
- ```
48
+ <details >
61
49
62
- #### Snapshots
50
+ < summary >Using snapshots</ summary >
63
51
64
- If you want to use snapshots, you can add jitpack repository to ` settings.gradle ` and use version ` develop-SNAPSHOT ` :
52
+ To use snapshots, add jitpack repository to the ` settings.gradle.kts ` and specify version ` develop-SNAPSHOT ` :
65
53
``` kotlin
66
54
// settings.gradle
67
55
@@ -82,88 +70,86 @@ plugins {
82
70
}
83
71
```
84
72
85
- ### First steps
86
- Simple ` build.gradle ` file that use BukkitGradle:
73
+ </details >
74
+
75
+ ### Quick Start
76
+
77
+ Apply the plugin and configure project's ` group ` , ` description ` and ` version ` .
78
+ These values will be used to generate the ` plugin.yml ` file:
79
+
87
80
``` kotlin
88
81
plugins {
89
82
id(" ru.endlesscode.bukkitgradle" ) version " 0.10.1"
90
83
}
91
-
92
- // Project information
84
+
93
85
group = " com.example.myplugin"
94
- description = " My first Bukkit plugin with Gradle"
86
+ description = " My first Bukkit plugin built by Gradle"
95
87
version = " 0.1"
96
88
97
- // Let's add needed API to project
89
+ bukkit {
90
+ apiVersion = " 1.16.5"
91
+ }
92
+
93
+ // Add the necessary API to the project
98
94
dependencies {
99
95
compileOnly(bukkitApi())
100
- // see section 'Dependencies' for more info
96
+ // See the 'Dependencies' section for more info
101
97
}
102
98
```
103
- > ** Note:** ` compileOnly ` - it's like ` provided ` scope in Maven.
104
- It means that this dependency will not be included to your final jar.
105
99
106
- It's enough!
107
- Will be hooked the latest version of Bukkit and automatically generated ` plugin.yml ` with next content:
100
+ That's it!
101
+ During the plugin compilation ` plugin.yml ` will be generated with the following content:
102
+
108
103
``` yaml
104
+ api-version : ' 1.16'
109
105
name : MyPlugin
110
- description : My first Bukkit plugin with Gradle
106
+ version : ' 0.1 '
111
107
main : com.example.myplugin.MyPlugin
112
- version : 0.1
113
- api-version : 1.16
108
+ description : My first Bukkit plugin built by Gradle
114
109
` ` `
115
- > **Note:** Main class built by following pattern: ` <groupId>.<name>`
110
+
111
+ > [!NOTE]
112
+ > By default, main class is built by the following pattern: ` <groupId>.<name>`
113
+
114
+ Next, you might need to [configure](#configuration) `plugin.yml` content or [run dev server](#running-dev-server).
116
115
117
116
# # Configuration
118
- You can configure attributes that will be placed to `plugin.yml` :
117
+
118
+ The `plugin.yml` content can be configured using `bukkit.plugin { ... }` block.
119
+
119
120
` ` ` kotlin
120
- // Override default configurations
121
121
bukkit {
122
- // Version of API (if you will not set this property, will be used latest version at moment of BukkitGradle release)
122
+ // Version of API. By default, 1.16.5 is used
123
123
apiVersion = "1.15.2"
124
124
125
- // Attributes for plugin.yml
125
+ // Configure plugin.yml content
126
126
plugin {
127
- name.set( "MyPlugin")
128
- description.set( "My amazing plugin, that doing nothing")
129
- main.set( "com.example.plugin.MyPlugin")
130
- version.set( "1.0")
131
- url.set("http://www.example.com") // Attribute website
132
- authors.set(["OsipXD ", "Contributors"] )
127
+ name = "MyPlugin"
128
+ description = "My amazing plugin"
129
+ main = "com.example.plugin.MyPlugin"
130
+ version = "1.0"
131
+ authors = listOf("osipxd", "contributors")
132
+ depend = listOf("Vault ", "Mimic" )
133
133
}
134
134
}
135
135
` ` `
136
136
137
- Will be generated `plugin.yml` file :
138
- ` ` ` yaml
139
- name: MyPlugin
140
- description: My amazing plugin, that doing nothing
141
- main: com.example.plugin.MyPlugin
142
- version: 1.0
143
- api-version: 1.15
144
- website: http://www.example.com
145
- authors: [OsipXD, Contributors]
146
- ` ` `
147
-
148
- If you want to add unsupported by BukkitGradle attributes, like a `depend`, `commands` etc.
149
- Create `plugin.yml` file and put custom attributes there.
150
-
151
137
# # Repositories and Dependencies
152
- BukkitGradle provides short extension-functions to add common repositories and dependencies.
153
- There are list of its.
154
138
155
- Usage example :
139
+ BukkitGradle provides shortcuts to add common repositories and dependencies :
140
+
156
141
` ` ` kotlin
157
142
repositories {
158
- spigot() // Adds spigot repo
143
+ spigot()
159
144
}
160
145
161
146
dependencies {
162
- compileOnly(paperApi()) // Adds paper-api dependency
147
+ compileOnly(paperApi())
163
148
}
164
149
` ` `
165
150
166
- # ### Repositories:
151
+ # ### Repositories
152
+
167
153
Name | Url
168
154
----------------|-------------------------------------------------------------------
169
155
spigot | https://hub.spigotmc.org/nexus/content/repositories/snapshots/
@@ -176,7 +162,8 @@ dependencies {
176
162
aikar | https://repo.aikar.co/content/groups/aikar/
177
163
codemc | https://repo.codemc.org/repository/maven-public/
178
164
179
- # ### Dependencies:
165
+ # ### Dependencies
166
+
180
167
Some dependencies also add a repository needed for them.
181
168
182
169
Name | Signature | Adds repository
@@ -188,7 +175,7 @@ Some dependencies also add a repository needed for them.
188
175
189
176
**Note:** `$apiVersion` - is `${version}-R0.1-SNAPSHOT` (where `$version` is `bukkit.version`)
190
177
191
- If you need more extension-functions, [create issue][issue].
178
+ If you need more extension-functions, [file an issue][issue].
192
179
193
180
# # Running Dev server
194
181
@@ -263,29 +250,37 @@ bukkit {
263
250
264
251
# # Migration Guide
265
252
266
- # ## Upgrade from 0.8 .x
253
+ # ## Upgrade from 0.10 .x
267
254
268
- 1. Update gradle to 6.6 or newer :
269
- ` ` ` shell
270
- $ ./gradlew wrapper --gradle-version 6.7.1
271
- ` ` `
272
- 1. Use syntax `.set` in `bukkit.meta` instead of `=` :
255
+ 1. Update Gradle to 8.0 or newer (the latest version is recommended) :
256
+ ` ` ` shell
257
+ ./gradlew wrapper --gradle-version 8.13
258
+ ` ` `
259
+
260
+ 2. Replace deprecated and removed APIs :
273
261
` ` ` diff
274
262
bukkit {
275
- meta {
276
- - desctiption = "My plugin's description"
277
- + description.set("My plugin's description")
263
+ - meta {
264
+ + plugin {
265
+ name = "MyPlugin"
266
+ - url = "https://example.com/"
267
+ + website = "https://example.com/"
278
268
}
279
269
}
280
- ` ` `
270
+ ` ` `
271
+
272
+ 3. If you have `plugin.yml`, move it's content to `bukkit.plugin { ... }` block
273
+
274
+ # ## Upgrade from 0.8.x
275
+
281
276
1. Use `bukkit.apiVersion` instead of `bukkit.version` :
282
277
` ` ` diff
283
278
bukkit {
284
279
- version = "1.16.4"
285
280
+ apiVersion = "1.16.4"
286
281
}
287
282
` ` `
288
- 1 . Use `build.server` block instead of `build.run` :
283
+ 2 . Use `build.server` block instead of `build.run` :
289
284
` ` ` diff
290
285
bukkit {
291
286
- run {
@@ -294,7 +289,7 @@ bukkit {
294
289
}
295
290
}
296
291
` ` `
297
- 1 . Update arguments assignment syntax :
292
+ 3 . Update arguments assignment syntax :
298
293
` ` ` diff
299
294
bukkit {
300
295
server {
@@ -304,7 +299,7 @@ bukkit {
304
299
}
305
300
}
306
301
` ` `
307
- 1 . Replace removed APIs :
302
+ 4 . Replace removed APIs :
308
303
` ` ` diff
309
304
repositories {
310
305
- destroystokyo()
@@ -319,8 +314,8 @@ bukkit {
319
314
+ compileOnly(spigot())
320
315
}
321
316
` ` `
322
- 1 . Remove `q` and `qq` functions calls in `meta { ... }`
323
- 1 . Check generated plugin.yml contents after build.
317
+ 5 . Remove `q` and `qq` functions calls in `meta { ... }`
318
+ 6 . Check generated plugin.yml contents after build.
324
319
325
320
If there are any problems, [create an issue][issue].
326
321
0 commit comments