@@ -63,10 +63,16 @@ group "com.example"
6363description "My first Bukkit plugin with Gradle"
6464version "0.1"
6565
66+ // Wee need to add some repos
67+ repositories {
68+ spigot()
69+ // see section 'Repositories' for more info
70+ }
71+
6672// Let's add needed API to project
6773dependencies {
6874 compileOnly bukkit()
69- // You also can use craftbukkit(), spigot() and spigotApi()
75+ // see section 'Dependencies' for more info
7076}
7177```
7278` compileOnly ` - it's like provided scope in Maven. It means that this dependncy will not included to your final jar.
@@ -84,7 +90,7 @@ You can configure attributes that will be placed to `plugin.yml`:
8490` ` ` groovy
8591// Override default configurations
8692bukkit {
87- // Version of API (latest by default )
93+ // Version of API (if you will not set this property, will be used latest available )
8894 version = "1.12.2"
8995
9096 // Attributes for plugin.yml
@@ -112,17 +118,44 @@ authors: [OsipXD, Contributors]
112118Also you can add custom (unsupported by BukkitGradle) attributes like a `depend` etc.
113119Just create `plugin.yml` file and put custom attributes into.
114120
121+ # ### Quotes around values
122+ In some cases you may need put meta value in quotes. For this you can use `q` and `qq` functions.
123+
124+ For example we have meta :
125+ ` ` ` groovy
126+ meta {
127+ name = qq "Double Quoted Name"
128+ description = q "Single quoted description"
129+ url = "http://without.quot.es/"
130+ }
131+ ` ` `
132+
133+ And will be generated :
134+ ` ` ` yaml
135+ name: "Double Quoted Name"
136+ description: 'Single quoted description'
137+ website: http://without.quot.es/
138+ ` ` `
139+
140+ **Note:** In Groovy you can use functions in two ways: normal - `q("value")` and without braces - `q "value"`
141+
115142# ## Running Dev server
116- Before running server you should configure BuildTools and dev server location.
143+ Before running server you should configure dev server location.
117144
118- You can define it in `local.properties` file (that was automatically created in project root on refresh) :
145+ You can define it in `local.properties` file (that was automatically created in project directory on refresh) :
119146` ` ` properties
120- # Absolute path to directory that contains BuildTools.jar
121- buildtools.dir=/path/to/buildtools/
122147# Absolute path to dev server
123148server.dir=/path/to/buildtools/
124149` ` `
125- Or you can define it globally (for all projects that uses BukkitGradle) with environment variables `BUKKIT_DEV_SERVER_HOME`
150+
151+ If you use Spigot (see `bukkit.run.core`) you also should specify BuildTools location. For Paper no additional actions
152+ needed.
153+ ` ` ` properties
154+ # Absolute path to directory that contains BuildTools.jar
155+ buildtools.dir=/path/to/buildtools/
156+ ` ` `
157+
158+ **TIP:** you can define it globally (for all projects that uses BukkitGradle) with environment variables `BUKKIT_DEV_SERVER_HOME`
126159and `BUILDTOOLS_HOME`.
127160
128161# #### On IntelliJ IDEA
@@ -132,26 +165,28 @@ server configurations.
132165
133166
134167# #### On other IDEs
135- Run ' :startServer' task.
168+ Run ` :startServer` task.
136169
137170# ### Server run configurations
138171To accept EULA and change settings use `bukkit.run` section :
139172` ` ` groovy
140173bukkit {
141174 // INFO: Here used default values
142175 run {
143- // Accept EULA
144- eula = false
145- // Set online-mode flag
146- onlineMode = false
147- // Debug mode (listen 5005 port, if you use running from IDEA this option will be ignored)
148- debug = true
149- // Set server encoding (flag -Dfile.encoding)
150- encoding = "UTF-8"
151- // JVM arguments
152- javaArgs = "-Xmx1G"
153- // Bukkit arguments
154- bukkitArgs = ""
176+ // Core type. It can be 'spigot' or 'paper'
177+ core = "spigot"
178+ // Accept EULA
179+ eula = false
180+ // Set online-mode flag
181+ onlineMode = false
182+ // Debug mode (listen 5005 port, if you use running from IDEA this option will be ignored)
183+ debug = true
184+ // Set server encoding (flag -Dfile.encoding)
185+ encoding = "UTF-8"
186+ // JVM arguments
187+ javaArgs = "-Xmx1G"
188+ // Bukkit arguments
189+ bukkitArgs = ""
155190 }
156191}
157192` ` `
0 commit comments