-
Notifications
You must be signed in to change notification settings - Fork 1
/
build.gradle.kts
120 lines (85 loc) · 2.54 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
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
plugins {
kotlin("jvm") version "2.0.21"
kotlin("plugin.serialization") version "2.0.21"
id("io.papermc.paperweight.userdev") version "1.7.5"
id("xyz.jpenilla.run-paper") version "2.3.1"
`maven-publish`
}
var host = "github.com/TheFruxz/Sparkle"
version = "2024.4-dev"
group = "dev.fruxz"
repositories {
mavenCentral()
maven("https://repo.fruxz.dev/releases") {
name = "fruxz.dev"
}
maven("https://jitpack.io") {
name = "JitPack"
}
maven("https://libraries.minecraft.net") {
name = "Minecraft Libraries"
}
}
val includedDependencies = mutableListOf<String>()
fun Dependency?.deliver() = this?.apply {
val computedVersion = version ?: kotlin.coreLibrariesVersion
includedDependencies += "${group}:${name}:${computedVersion}"
}
dependencies {
// Internal
api("dev.fruxz:ascend:2024.2.2").deliver()
api("dev.fruxz:stacked:2024.1.1").deliver()
api("dev.fruxz:kojang:1.1.2").deliver()
api("dev.fruxz:brigadikt:2024-indev-1").deliver()
// Kotlin
implementation(kotlin("stdlib")).deliver()
implementation(kotlin("reflect")).deliver()
testImplementation(kotlin("test"))
implementation("org.jetbrains.kotlinx:kotlinx-serialization-json:1.7.3")
implementation("org.jetbrains.kotlinx:kotlinx-coroutines-core:1.9.0")
// External
paperweight.paperDevBundle("1.20.4-R0.1-SNAPSHOT")
implementation("com.mojang:brigadier:1.0.18")
implementation("io.ktor:ktor-client-cio:3.0.1").deliver()
implementation("io.ktor:ktor-client-core-jvm:3.0.1").deliver()
implementation("io.ktor:ktor-serialization-kotlinx-json:3.0.1").deliver()
implementation("io.ktor:ktor-client-content-negotiation:3.0.1").deliver()
}
tasks {
processResources {
expand(
"version" to project.version,
"name" to project.name,
"website" to "https://$host",
"delivery" to includedDependencies.joinToString("\n"),
)
}
test {
useJUnitPlatform()
}
runServer {
this.minecraftVersion("1.20.4")
}
}
publishing {
repositories {
mavenLocal()
}
publications.create("Sparkle", MavenPublication::class) {
from(components["kotlin"])
artifactId = "sparkle"
version = version.lowercase()
}
}
configure<SourceSetContainer> { // allowing java files appearing next to kotlin files
named("main") {
java.srcDir("src/main/kotlin")
}
}
java {
withJavadocJar()
withSourcesJar()
}
kotlin {
jvmToolchain(21)
}