@@ -9,7 +9,7 @@ Gradle utilities to simplify Bukkit/Spigot plugins writing and debugging.
99
1010
1111- [ Installation] ( #installation )
12- - [ First steps ] ( #first-steps )
12+ - [ Quick Start ] ( #quick-start )
1313- [ Configuration] ( #configuration )
1414- [ Repositories and Dependencies] ( #repositories-and-dependencies )
1515- [ Running Dev server] ( #running-dev-server )
@@ -21,7 +21,6 @@ Gradle utilities to simplify Bukkit/Spigot plugins writing and debugging.
2121<!-- END doctoc generated TOC please keep comment here to allow auto update -->
2222
2323#### Features:
24- - Automatically applies plugin: java
2524- Sets up compiler encoding to UTF-8
2625- Sets archivesBaseName to plugin name
2726- Supports APIs: Bukkit, CraftBukkit, Spigot, Paper
@@ -35,33 +34,22 @@ Gradle utilities to simplify Bukkit/Spigot plugins writing and debugging.
3534
3635## Installation
3736
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
4039
41- #### With new plugins mechanism
4240``` kotlin
4341plugins {
4442 id(" ru.endlesscode.bukkitgradle" ) version " 0.10.1"
4543}
4644```
4745
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 )
5847
59- apply(plugin: "ru.endlesscode.bukkitgradle")
60- ```
48+ <details >
6149
62- #### Snapshots
50+ < summary >Using snapshots</ summary >
6351
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 ` :
6553``` kotlin
6654// settings.gradle
6755
@@ -82,88 +70,86 @@ plugins {
8270}
8371```
8472
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+
8780``` kotlin
8881plugins {
8982 id(" ru.endlesscode.bukkitgradle" ) version " 0.10.1"
9083}
91-
92- // Project information
84+
9385group = " com.example.myplugin"
94- description = " My first Bukkit plugin with Gradle"
86+ description = " My first Bukkit plugin built by Gradle"
9587version = " 0.1"
9688
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
9894dependencies {
9995 compileOnly(bukkitApi())
100- // see section 'Dependencies' for more info
96+ // See the 'Dependencies' section for more info
10197}
10298```
103- > ** Note:** ` compileOnly ` - it's like ` provided ` scope in Maven.
104- It means that this dependency will not be included to your final jar.
10599
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+
108103``` yaml
104+ api-version : ' 1.16'
109105name : MyPlugin
110- description : My first Bukkit plugin with Gradle
106+ version : ' 0.1 '
111107main : com.example.myplugin.MyPlugin
112- version : 0.1
113- api-version : 1.16
108+ description : My first Bukkit plugin built by Gradle
114109` ` `
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).
116115
117116# # 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+
119120` ` ` kotlin
120- // Override default configurations
121121bukkit {
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
123123 apiVersion = "1.15.2"
124124
125- // Attributes for plugin.yml
125+ // Configure plugin.yml content
126126 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" )
133133 }
134134}
135135` ` `
136136
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-
151137# # Repositories and Dependencies
152- BukkitGradle provides short extension-functions to add common repositories and dependencies.
153- There are list of its.
154138
155- Usage example :
139+ BukkitGradle provides shortcuts to add common repositories and dependencies :
140+
156141` ` ` kotlin
157142repositories {
158- spigot() // Adds spigot repo
143+ spigot()
159144}
160145
161146dependencies {
162- compileOnly(paperApi()) // Adds paper-api dependency
147+ compileOnly(paperApi())
163148}
164149` ` `
165150
166- # ### Repositories:
151+ # ### Repositories
152+
167153 Name | Url
168154----------------|-------------------------------------------------------------------
169155 spigot | https://hub.spigotmc.org/nexus/content/repositories/snapshots/
@@ -176,7 +162,8 @@ dependencies {
176162 aikar | https://repo.aikar.co/content/groups/aikar/
177163 codemc | https://repo.codemc.org/repository/maven-public/
178164
179- # ### Dependencies:
165+ # ### Dependencies
166+
180167Some dependencies also add a repository needed for them.
181168
182169 Name | Signature | Adds repository
@@ -188,7 +175,7 @@ Some dependencies also add a repository needed for them.
188175
189176 **Note:** `$apiVersion` - is `${version}-R0.1-SNAPSHOT` (where `$version` is `bukkit.version`)
190177
191- If you need more extension-functions, [create issue][issue].
178+ If you need more extension-functions, [file an issue][issue].
192179
193180# # Running Dev server
194181
@@ -263,29 +250,37 @@ bukkit {
263250
264251# # Migration Guide
265252
266- # ## Upgrade from 0.8 .x
253+ # ## Upgrade from 0.10 .x
267254
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 :
273261 ` ` ` diff
274262 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/"
278268 }
279269 }
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+
2812761. Use `bukkit.apiVersion` instead of `bukkit.version` :
282277 ` ` ` diff
283278 bukkit {
284279 - version = "1.16.4"
285280 + apiVersion = "1.16.4"
286281 }
287282 ` ` `
288- 1 . Use `build.server` block instead of `build.run` :
283+ 2 . Use `build.server` block instead of `build.run` :
289284 ` ` ` diff
290285 bukkit {
291286 - run {
@@ -294,7 +289,7 @@ bukkit {
294289 }
295290 }
296291 ` ` `
297- 1 . Update arguments assignment syntax :
292+ 3 . Update arguments assignment syntax :
298293 ` ` ` diff
299294 bukkit {
300295 server {
@@ -304,7 +299,7 @@ bukkit {
304299 }
305300 }
306301 ` ` `
307- 1 . Replace removed APIs :
302+ 4 . Replace removed APIs :
308303 ` ` ` diff
309304 repositories {
310305 - destroystokyo()
@@ -319,8 +314,8 @@ bukkit {
319314 + compileOnly(spigot())
320315 }
321316 ` ` `
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.
324319
325320If there are any problems, [create an issue][issue].
326321
0 commit comments