Skip to content

Commit 70875cc

Browse files
committed
docs: Add migration guide
1 parent 39b4693 commit 70875cc

File tree

3 files changed

+96
-25
lines changed

3 files changed

+96
-25
lines changed

Diff for: CHANGELOG.md

+2-4
Original file line numberDiff line numberDiff line change
@@ -20,9 +20,6 @@ bukkit {
2020
}
2121
```
2222

23-
### run -> server
24-
`bukkit.run` renamed to `bukkit.server`. The old name is deprecated
25-
2623
### Improved Bukkit version management
2724

2825
Field `bukkit.version` is deprecated now, you should use `bukkit.apiVersion` instead.
@@ -73,10 +70,11 @@ now it is friendly to Kotlin DSL.
7370
- Removed repository extension `RepositoryHandler.vault()`, use `RepositoryHandler.jitpack()` instead and read [VaultAPI README][vault]
7471

7572
### Changed
73+
- `bukkit.run` renamed to `bukkit.server`. The old name is deprecated
7674
- Add `nogui` argument by default to `bukkitArgs`
7775
- Type of properties `server.jvmArgs` and `server.bukkitArgs` changed from `String` to `List<String>`.
7876
It makes it easier to add arguments without overriding defaults
79-
- Default main class pattern changed from `<groupId>.<lowercased name>.<name>` to `<groupId>.<name>`
77+
- Default main class pattern changed from `<groupId>.<lowercased name>.<name>` to `<groupId>.<name>`
8078

8179
### Housekeeping
8280
- Default bukkit version now is 1.16.4

Diff for: LICENSE

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
MIT License
22

3-
Copyright (c) 2017 EndlessCode Group
3+
Copyright (c) 2020 EndlessCode Group
44

55
Permission is hereby granted, free of charge, to any person obtaining a copy
66
of this software and associated documentation files (the "Software"), to deal

Diff for: README.md

+93-20
Original file line numberDiff line numberDiff line change
@@ -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
3842
plugins {
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
5862
Simple `build.gradle` file that use BukkitGradle:
59-
```groovy
63+
```kotlin
6064
plugins {
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
9094
You can configure attributes that will be placed to `plugin.yml`:
91-
```groovy
95+
```kotlin
9296
// Override default configurations
9397
bukkit {
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]
120124
If you want to add unsupported by BukkitGradle attributes, like a `depend`, `commands` etc.
121125
Create `plugin.yml` file and put custom attributes there.
122126

123-
### Repositories and Dependencies
127+
## Repositories and Dependencies
124128
BukkitGradle provides short extension-functions to add common repositories and dependencies.
125129
There 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:
151155
Some 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
165169
Before running server you should configure dev server location.
166170

167171
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.
182186
> Specify environment variables `BUKKIT_DEV_SERVER_HOME`
183187
and `BUKKIT_BUILDTOOLS_HOME`.
184188

185-
##### On IntelliJ IDEA
189+
#### On IntelliJ IDEA
186190
Run `:buildIdeaRun` task.
187191
Run Configuration will be added to your IDE.
188192
It will be automatically refreshed when you change server configurations.
189193

190194
![Run Configuration](http://image.prntscr.com/image/1a12a03b8ac54fccb7d5b70a335fa996.png)
191195

192-
##### On other IDEs
196+
#### On other IDEs
193197
Run `:runServer` task.
194198

195-
#### Dev server configuration
199+
### Dev server configuration
196200
To accept EULA and change settings use `bukkit.server` section:
197201
```groovy
198202
bukkit {
@@ -218,3 +222,72 @@ bukkit {
218222
}
219223
```
220224
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

Comments
 (0)