@@ -34,33 +34,22 @@ Gradle utilities to simplify Bukkit/Spigot plugins writing and debugging.
3434
3535## Installation
3636
37- [ BukkitGradle on plugins.gradle.org ] ( https://plugins.gradle.org/plugin/ru.endlesscode.bukkitgradle )
38- > ** Note: ** Gradle 8.0+ is required
37+ > [ !NOTE ]
38+ > BukkitGradle requires Gradle 8.0+ to run
3939
40- #### With new plugins mechanism
4140``` kotlin
4241plugins {
4342 id(" ru.endlesscode.bukkitgradle" ) version " 0.10.1"
4443}
4544```
4645
47- #### With buildscript and apply
48- ``` groovy
49- buildscript {
50- repositories {
51- mavenCentral()
52- }
53- dependencies {
54- classpath("gradle.plugin.ru.endlesscode:bukkit-gradle:0.10.1")
55- }
56- }
46+ [ BukkitGradle on plugins.gradle.org] ( https://plugins.gradle.org/plugin/ru.endlesscode.bukkitgradle )
5747
58- apply(plugin: "ru.endlesscode.bukkitgradle")
59- ```
48+ <details >
6049
61- #### Snapshots
50+ < summary >Using snapshots</ summary >
6251
63- 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 ` :
6453``` kotlin
6554// settings.gradle
6655
@@ -81,88 +70,86 @@ plugins {
8170}
8271```
8372
84- ### First steps
85- 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+
8680``` kotlin
8781plugins {
8882 id(" ru.endlesscode.bukkitgradle" ) version " 0.10.1"
8983}
90-
91- // Project information
84+
9285group = " com.example.myplugin"
93- description = " My first Bukkit plugin with Gradle"
86+ description = " My first Bukkit plugin built by Gradle"
9487version = " 0.1"
9588
96- // Let's add needed API to project
89+ bukkit {
90+ apiVersion = " 1.16.5"
91+ }
92+
93+ // Add the necessary API to the project
9794dependencies {
9895 compileOnly(bukkitApi())
99- // see section 'Dependencies' for more info
96+ // See the 'Dependencies' section for more info
10097}
10198```
102- > ** Note:** ` compileOnly ` - it's like ` provided ` scope in Maven.
103- It means that this dependency will not be included to your final jar.
10499
105- It's enough!
106- 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+
107103``` yaml
104+ api-version : ' 1.16'
108105name : MyPlugin
109- description : My first Bukkit plugin with Gradle
106+ version : ' 0.1 '
110107main : com.example.myplugin.MyPlugin
111- version : 0.1
112- api-version : 1.16
108+ description : My first Bukkit plugin built by Gradle
113109` ` `
114- > **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).
115115
116116# # Configuration
117- 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+
118120` ` ` kotlin
119- // Override default configurations
120121bukkit {
121- // 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
122123 apiVersion = "1.15.2"
123124
124- // Attributes for plugin.yml
125+ // Configure plugin.yml content
125126 plugin {
126- name.set( "MyPlugin")
127- description.set( "My amazing plugin, that doing nothing")
128- main.set( "com.example.plugin.MyPlugin")
129- version.set( "1.0")
130- url.set("http://www.example.com") // Attribute website
131- 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" )
132133 }
133134}
134135` ` `
135136
136- Will be generated `plugin.yml` file :
137- ` ` ` yaml
138- name: MyPlugin
139- description: My amazing plugin, that doing nothing
140- main: com.example.plugin.MyPlugin
141- version: 1.0
142- api-version: 1.15
143- website: http://www.example.com
144- authors: [OsipXD, Contributors]
145- ` ` `
146-
147- If you want to add unsupported by BukkitGradle attributes, like a `depend`, `commands` etc.
148- Create `plugin.yml` file and put custom attributes there.
149-
150137# # Repositories and Dependencies
151- BukkitGradle provides short extension-functions to add common repositories and dependencies.
152- There are list of its.
153138
154- Usage example :
139+ BukkitGradle provides shortcuts to add common repositories and dependencies :
140+
155141` ` ` kotlin
156142repositories {
157- spigot() // Adds spigot repo
143+ spigot()
158144}
159145
160146dependencies {
161- compileOnly(paperApi()) // Adds paper-api dependency
147+ compileOnly(paperApi())
162148}
163149` ` `
164150
165- # ### Repositories:
151+ # ### Repositories
152+
166153 Name | Url
167154----------------|-------------------------------------------------------------------
168155 spigot | https://hub.spigotmc.org/nexus/content/repositories/snapshots/
@@ -175,7 +162,8 @@ dependencies {
175162 aikar | https://repo.aikar.co/content/groups/aikar/
176163 codemc | https://repo.codemc.org/repository/maven-public/
177164
178- # ### Dependencies:
165+ # ### Dependencies
166+
179167Some dependencies also add a repository needed for them.
180168
181169 Name | Signature | Adds repository
@@ -187,7 +175,7 @@ Some dependencies also add a repository needed for them.
187175
188176 **Note:** `$apiVersion` - is `${version}-R0.1-SNAPSHOT` (where `$version` is `bukkit.version`)
189177
190- If you need more extension-functions, [create issue][issue].
178+ If you need more extension-functions, [file an issue][issue].
191179
192180# # Running Dev server
193181
0 commit comments