-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathbuild.gradle.kts
94 lines (83 loc) · 2.51 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
/*
* This file was generated by the Gradle 'init' task.
*
* This generated file contains a sample Kotlin library project to get you started.
* For more details take a look at the 'Building Java & JVM projects' chapter in the Gradle
* User Manual available at https://docs.gradle.org/7.4.1/userguide/building_java_projects.html
*/
import org.jetbrains.kotlin.gradle.tasks.KotlinCompile
import org.jetbrains.kotlin.gradle.dsl.JvmTarget
import org.jetbrains.kotlin.gradle.dsl.KotlinVersion
sourceSets {
main {
java {
setSrcDirs(listOf("src"))
}
resources {
setSrcDirs(listOf("."))
include("plugin.yml")
include("config.yml")
include("config-*.yml")
include("README.md")
include("LICENSE.txt")
include("data/*.txt")
}
}
}
tasks {
withType<KotlinCompile> {
compilerOptions {
jvmTarget.set(JvmTarget.JVM_21)
apiVersion.set(KotlinVersion.KOTLIN_2_1)
languageVersion.set(KotlinVersion.KOTLIN_2_1)
}
}
withType<JavaCompile> {
sourceCompatibility = "21"
targetCompatibility = "21"
}
jar {
val dependencies = configurations
.runtimeClasspath
.get()
.filter { !it.name.contains("spigot") }
.map(::zipTree)
from(dependencies)
duplicatesStrategy = DuplicatesStrategy.EXCLUDE
manifest {
attributes(
"Name" to "com/mercerenies/turtletroll/",
"Specification-Title" to "A Turtle's Troll",
"Implementation-Title" to "com.mercerenies.turtletroll",
)
}
}
}
plugins {
// Apply the org.jetbrains.kotlin.jvm Plugin to add support for Kotlin.
id("org.jetbrains.kotlin.jvm") version "2.1.0"
// Apply the java-library plugin for API and implementation separation.
`java-library`
}
repositories {
// Use Maven Central for resolving dependencies.
mavenCentral()
maven("https://repo.papermc.io/repository/maven-public/")
maven("https://repo.dmulloy2.net/repository/public/")
maven("https://nexus.scarsz.me/content/groups/public/")
}
dependencies {
// Align versions of all Kotlin components
implementation(platform("org.jetbrains.kotlin:kotlin-bom"))
// Use the Kotlin JDK 8 standard library.
implementation("org.jetbrains.kotlin:kotlin-stdlib-jdk8")
compileOnly("io.papermc.paper:paper-api:1.21.3-R0.1-SNAPSHOT")
compileOnly("net.kyori:adventure-text-serializer-plain:4.14.0")
compileOnly("com.comphenix.protocol:ProtocolLib:5.3.0")
compileOnly("com.discordsrv:discordsrv:1.26.0")
implementation(
fileTree("lib/") {
include("*.jar")
}
)
}