@@ -6,11 +6,15 @@ Gradle utilities for easier writing Bukkit plugins.
66<!-- DON'T EDIT THIS SECTION, INSTEAD RE-RUN doctoc TO UPDATE -->
77
88
9- - [ Apply plugin ] ( #apply-plugin )
9+ - [ Installation ] ( #installation )
1010 - [ 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 )
1418
1519<!-- END doctoc generated TOC please keep comment here to allow auto update -->
1620
@@ -29,14 +33,14 @@ Gradle utilities for easier writing Bukkit plugins.
2933#### TODO:
3034- Add smart dependency system
3135
32- ## Apply plugin
36+ ## Installation
3337[ BukkitGradle on plugins.gradle.org] ( https://plugins.gradle.org/plugin/ru.endlesscode.bukkitgradle )
3438> ** Note:** Gradle 6.6+ required
3539
3640#### With new plugins mechanism
37- ``` groovy
41+ ``` kotlin
3842plugins {
39- id "ru.endlesscode.bukkitgradle" version "0.9"
43+ id( " ru.endlesscode.bukkitgradle" ) version " 0.9"
4044}
4145```
4246
@@ -47,16 +51,16 @@ buildscript {
4751 jcenter()
4852 }
4953 dependencies {
50- classpath "gradle.plugin.ru.endlesscode:bukkit-gradle:0.9"
54+ classpath( "gradle.plugin.ru.endlesscode:bukkit-gradle:0.9")
5155 }
5256}
5357
54- apply plugin: "ru.endlesscode.bukkitgradle"
58+ apply( plugin: "ru.endlesscode.bukkitgradle")
5559```
5660
5761### First steps
5862Simple ` build.gradle ` file that use BukkitGradle:
59- ``` groovy
63+ ``` kotlin
6064plugins {
6165 id(" ru.endlesscode.bukkitgradle" ) version " 0.9"
6266}
@@ -86,9 +90,9 @@ api-version: 1.16
8690` ` `
8791> **Note:** Main class built by following pattern: ` <groupId>.<name>`
8892
89- # ## Configuring plugin
93+ # # Configuration
9094You can configure attributes that will be placed to `plugin.yml` :
91- ` ` ` groovy
95+ ` ` ` kotlin
9296// Override default configurations
9397bukkit {
9498 // 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]
120124If you want to add unsupported by BukkitGradle attributes, like a `depend`, `commands` etc.
121125Create `plugin.yml` file and put custom attributes there.
122126
123- # ## Repositories and Dependencies
127+ # # Repositories and Dependencies
124128BukkitGradle provides short extension-functions to add common repositories and dependencies.
125129There are list of its.
126130
@@ -135,7 +139,7 @@ dependencies {
135139}
136140` ` `
137141
138- # #### Repositories:
142+ # ### Repositories:
139143 Name | Url
140144----------------|-------------------------------------------------------------------
141145 spigot | https://hub.spigotmc.org/nexus/content/repositories/snapshots/
@@ -147,7 +151,7 @@ dependencies {
147151 placeholderapi | https://repo.extendedclip.com/content/repositories/placeholderapi/
148152 aikar | https://repo.aikar.co/content/groups/aikar/
149153
150- # #### Dependencies:
154+ # ### Dependencies:
151155Some dependencies also applies repo needed for them.
152156
153157 Name | Signature | Applies repo
@@ -159,9 +163,9 @@ Some dependencies also applies repo needed for them.
159163
160164 **Note:** `$apiVersion` - is `${version}-R0.1-SNAPSHOT` (where `$version` is `bukkit.version`)
161165
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] .
163167
164- # ## Running Dev server
168+ # # Running Dev server
165169Before running server you should configure dev server location.
166170
167171You 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.
182186> Specify environment variables `BUKKIT_DEV_SERVER_HOME`
183187and `BUKKIT_BUILDTOOLS_HOME`.
184188
185- # #### On IntelliJ IDEA
189+ # ### On IntelliJ IDEA
186190Run `:buildIdeaRun` task.
187191Run Configuration will be added to your IDE.
188192It will be automatically refreshed when you change server configurations.
189193
190194
191195
192- # #### On other IDEs
196+ # ### On other IDEs
193197Run `:runServer` task.
194198
195- # ### Dev server configuration
199+ # ## Dev server configuration
196200To accept EULA and change settings use `bukkit.server` section :
197201` ` ` groovy
198202bukkit {
@@ -218,3 +222,72 @@ bukkit {
218222}
219223` ` `
220224EULA 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