Add an example for a build.gradle.kts file
This commit is contained in:
@@ -1,5 +1,7 @@
|
||||
The following code snippets can be used in your `build.gradle.kts` file.
|
||||
|
||||
An example of a final configuration file [is also available](gradle_example.md).
|
||||
|
||||
## Gradle configuration
|
||||
|
||||
### Java version
|
||||
|
32
guide/docs/setup/gradle_example.md
Normal file
32
guide/docs/setup/gradle_example.md
Normal file
@@ -0,0 +1,32 @@
|
||||
An example for a `build.gradle.kts` file of a project using KSpigot would be:
|
||||
|
||||
```kotlin
|
||||
import org.jetbrains.kotlin.gradle.tasks.KotlinCompile
|
||||
|
||||
plugins {
|
||||
kotlin("jvm") version "1.5.10"
|
||||
}
|
||||
|
||||
group = "net.axay"
|
||||
version = "1.0-SNAPSHOT"
|
||||
|
||||
repositories {
|
||||
mavenCentral()
|
||||
maven("https://hub.spigotmc.org/nexus/content/repositories/snapshots")
|
||||
}
|
||||
|
||||
dependencies {
|
||||
compileOnly("org.spigotmc:spigot-api:1.17-R0.1-SNAPSHOT")
|
||||
implementation("net.axay:kspigot:1.17.1")
|
||||
}
|
||||
|
||||
tasks {
|
||||
compileJava {
|
||||
options.release.set(16)
|
||||
options.encoding = "UTF-8"
|
||||
}
|
||||
compileKotlin {
|
||||
kotlinOptions.jvmTarget = "16"
|
||||
}
|
||||
}
|
||||
```
|
@@ -33,6 +33,7 @@ nav:
|
||||
- Requirements: setup/beginners.md
|
||||
- Starting a new project: setup/project.md
|
||||
- Setup using Gradle: setup/gradle.md
|
||||
- Build script example: setup/gradle_example.md
|
||||
- Entrypoint to your plugin: setup/entrypoint.md
|
||||
- Extensions:
|
||||
- Event listener: extensions/listener.md
|
||||
|
Reference in New Issue
Block a user