This repository has been archived by the owner on Sep 2, 2024. It is now read-only.
generated from Project-Cepi/ExampleExtension
-
Notifications
You must be signed in to change notification settings - Fork 1
/
build.gradle.kts
105 lines (83 loc) · 3.03 KB
/
build.gradle.kts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
import org.jetbrains.kotlin.gradle.tasks.KotlinCompile
import com.github.jengelman.gradle.plugins.shadow.tasks.ShadowJar
plugins {
// Apply the Kotlin JVM plugin to add support for Kotlin.
id("org.jetbrains.kotlin.jvm") version "1.8.22"
// Kotlinx serialization for any data format
kotlin("plugin.serialization") version "1.8.22"
// Shade the plugin
id("com.github.johnrengelman.shadow") version "7.1.2"
// Allow publishing
`maven-publish`
// Apply the application plugin to add support for building a jar
java
// Dokka documentation w/ kotlin
id("org.jetbrains.dokka") version "1.9.20"
}
repositories {
// Use mavenCentral
mavenCentral()
maven(url = "https://jitpack.io")
maven(url = "https://repo.spongepowered.org/maven")
maven(url = "https://repo.minestom.com/repository/maven-public/")
maven(url = "https://repo.velocitypowered.com/snapshots/")
}
dependencies {
// Align versions of all Kotlin components
compileOnly(platform("org.jetbrains.kotlin:kotlin-bom"))
// Use the Kotlin JDK 8 standard library.
compileOnly(kotlin("stdlib"))
// Use the Kotlin reflect library.
compileOnly(kotlin("reflect"))
// Compile Minestom into project
compileOnly("com.github.Minestom:Minestom:9152c40753")
// Add KStom
compileOnly("com.github.Project-Cepi:KStom:5daaf786cf")
// Add Scripting Engine
implementation(kotlin("scripting-jsr223"))
implementation(kotlin("compiler-embeddable"))
implementation(kotlin("scripting-jvm-host"))
implementation(kotlin("scripting-jvm"))
implementation(kotlin("scripting-common"))
implementation(kotlin("script-runtime"))
implementation(kotlin("script-util"))
implementation(kotlin("script-runtime"))
implementation(kotlin("scripting-compiler-embeddable"))
// Use the kotlin test library
testImplementation("io.kotest:kotest-assertions-core:5.9.1")
testImplementation("io.kotest:kotest-runner-junit5:5.9.1")
// import kotlinx serialization
compileOnly("org.jetbrains.kotlinx:kotlinx-serialization-json:1.7.2")
}
configurations {
testImplementation {
extendsFrom(configurations.compileOnly.get())
}
}
// Take gradle.properties and apply it to resources.
tasks {
processResources {
// Apply properties to extension.json
filesMatching("extension.json") {
expand(project.properties)
}
}
// Set name, minimize, and merge service files
named<ShadowJar>("shadowJar") {
archiveBaseName.set(project.name)
mergeServiceFiles()
minimize()
}
test { useJUnitPlatform() }
// Make build depend on shadowJar as shading dependencies will most likely be required.
build { dependsOn(shadowJar) }
}
java {
sourceCompatibility = JavaVersion.VERSION_17
targetCompatibility = JavaVersion.VERSION_17
}
val compileKotlin: KotlinCompile by tasks
compileKotlin.kotlinOptions.jvmTarget = JavaVersion.VERSION_16.toString()
compileKotlin.kotlinOptions {
freeCompilerArgs = listOf("-Xinline-classes")
}