-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.gradle.kts
85 lines (71 loc) · 2.11 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
import org.jetbrains.kotlin.gradle.tasks.KotlinCompile
group = "me.iris"
version = "2.2.2"
plugins {
kotlin("jvm") version "1.9.24"
id("com.github.johnrengelman.shadow") version "8.1.1"
id("io.papermc.paperweight.userdev") version "1.7.1"
}
repositories {
mavenCentral()
maven("https://repo.papermc.io/repository/maven-public/") {
name = "papermc-repo"
}
maven("https://oss.sonatype.org/content/groups/public/") {
name = "sonatype"
}
maven("https://maven.noxcrew.com/public") {
name = "Noxcrew Public Maven Repository"
}
maven(url = uri("https://repo.codemc.org/repository/maven-public/"))
}
dependencies {
paperweight.paperDevBundle("1.21.3-R0.1-SNAPSHOT")
compileOnly("dev.jorel:commandapi-bukkit-core:9.6.1")
implementation("fr.skytasul:glowingentities:1.4.1")
implementation("com.noxcrew.noxesium:api:2.4.1")
implementation("com.noxcrew.noxesium:paper:2.4.1")
implementation("dev.jorel:commandapi-bukkit-kotlin:9.6.1")
implementation("org.jetbrains.kotlin:kotlin-stdlib")
}
val targetJavaVersion = 21
kotlin {
jvmToolchain(targetJavaVersion)
}
tasks.build {
dependsOn("shadowJar")
}
tasks.processResources {
val props = mapOf("version" to version)
inputs.properties(props)
filteringCharset = "UTF-8"
filesMatching("plugin.yml") {
expand(props)
}
}
tasks {
withType<KotlinCompile> {
kotlinOptions {
jvmTarget = 21.toString()
freeCompilerArgs += listOf("-Xexplicit-api=strict")
}
}
}
java {
withJavadocJar()
withSourcesJar()
}
tasks.withType<Jar> {
// Otherwise you'll get a "No main manifest attribute" error
manifest {
attributes["Main-Class"] = "me.iris.noxesiumapi.NoxesiumAPI"
}
// To avoid the duplicate handling strategy error
duplicatesStrategy = DuplicatesStrategy.EXCLUDE
// To add all of the dependencies
from(sourceSets.main.get().output)
dependsOn(configurations.runtimeClasspath)
from({
configurations.runtimeClasspath.get().filter { it.name.endsWith("jar") }.map { zipTree(it) }
})
}