-
Notifications
You must be signed in to change notification settings - Fork 11
/
build.gradle.kts
116 lines (99 loc) · 2.97 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
import org.gradle.api.tasks.testing.logging.TestExceptionFormat
import org.gradle.api.tasks.testing.logging.TestLogEvent
import io.papermc.paperweight.util.Git
import io.papermc.paperweight.patcher.tasks.PaperweightPatcherPrepareForDownstream
plugins {
java
`maven-publish`
id("io.papermc.paperweight.patcher") version "1.5.5"
}
val javaVersion = 17
allprojects {
apply(plugin = "java")
apply(plugin = "maven-publish")
java {
toolchain {
languageVersion.set(JavaLanguageVersion.of(javaVersion))
}
}
}
subprojects {
tasks.withType<JavaCompile> {
options.encoding = Charsets.UTF_8.name()
options.release.set(javaVersion)
}
tasks.withType<Javadoc> {
options.encoding = Charsets.UTF_8.name()
if (JavaVersion.current().isJava9Compatible) {
(options as StandardJavadocDocletOptions).addBooleanOption("html5", true)
}
exclude("**/*.xml")
}
tasks.withType<ProcessResources> {
filteringCharset = Charsets.UTF_8.name()
}
tasks.withType<Test> {
testLogging {
showStackTraces = true
exceptionFormat = TestExceptionFormat.FULL
events(TestLogEvent.STANDARD_OUT)
}
}
repositories {
mavenLocal()
maven("https://repo.glowstone.net/repository/maven-public/")
maven("https://repo.glowstone.net/repository/snapshots/")
maven("https://repo.glowstone.net/repository/internal/")
}
}
dependencies {
}
val paperDir = layout.projectDirectory.dir("work/Paper")
val initSubmodules by tasks.registering {
outputs.upToDateWhen { false }
doLast {
Git(layout.projectDirectory)("submodule", "update", "--init").executeOut()
}
}
val paperMavenPublicUrl = "https://repo.papermc.io/repository/maven-public/"
paperweight {
mcDevSourceDir.set(layout.buildDirectory.dir("ignore"))
remapRepo.set(paperMavenPublicUrl)
decompileRepo.set(paperMavenPublicUrl)
upstreams {
register("paper") {
upstreamDataTask {
dependsOn(initSubmodules)
projectDir.set(paperDir)
}
patchTasks {
register("api") {
upstreamDir.set(paperDir.dir("Paper-API"))
patchDir.set(layout.projectDirectory.dir("Paper-API-Patches"))
outputDir.set(layout.projectDirectory.dir("glowkit"))
importMcDev.set(false)
}
}
}
}
}
allprojects {
publishing {
repositories {
maven("https://repo.glowstone.net/content/repositories/snapshots/") {
name = "glowstone"
credentials(PasswordCredentials::class)
}
}
}
}
tasks.register("printMinecraftVersion") {
doLast {
println(providers.gradleProperty("mcVersion").get().trim())
}
}
tasks.register("printGlowkitVersion") {
doLast {
println(project.version)
}
}