Folia/build.gradle.kts

122 lines
3.1 KiB
Plaintext
Raw Normal View History

import io.papermc.paperweight.tasks.RebuildGitPatches
2021-06-12 14:09:34 +02:00
plugins {
java
2021-08-25 06:06:30 +02:00
`maven-publish`
2023-06-09 05:15:55 +02:00
id("com.github.johnrengelman.shadow") version "8.1.1" apply false
id("io.papermc.paperweight.patcher") version "1.5.11"
2021-06-12 14:09:34 +02:00
}
2022-12-13 22:27:38 +01:00
val paperMavenPublicUrl = "https://repo.papermc.io/repository/maven-public/"
2022-04-22 05:21:55 +02:00
2021-06-13 06:44:00 +02:00
repositories {
mavenCentral()
2022-04-22 05:21:55 +02:00
maven(paperMavenPublicUrl) {
content { onlyForConfigurations(configurations.paperclip.name) }
2021-06-13 06:44:00 +02:00
}
}
dependencies {
remapper("net.fabricmc:tiny-remapper:0.8.10:fat")
decompiler("net.minecraftforge:forgeflower:2.0.627.2")
paperclip("io.papermc:paperclip:3.0.3")
2021-06-13 06:44:00 +02:00
}
2021-08-25 06:06:30 +02:00
allprojects {
2021-06-12 14:09:34 +02:00
apply(plugin = "java")
2021-08-25 06:06:30 +02:00
apply(plugin = "maven-publish")
2021-06-12 14:09:34 +02:00
java {
toolchain {
2021-12-02 09:00:38 +01:00
languageVersion.set(JavaLanguageVersion.of(17))
2021-06-12 14:09:34 +02:00
}
}
2021-08-25 06:06:30 +02:00
}
2021-06-12 14:09:34 +02:00
2021-08-25 06:06:30 +02:00
subprojects {
tasks.withType<JavaCompile> {
options.encoding = Charsets.UTF_8.name()
2021-12-02 09:00:38 +01:00
options.release.set(17)
2021-06-12 14:20:45 +02:00
}
2021-08-25 06:06:30 +02:00
tasks.withType<Javadoc> {
options.encoding = Charsets.UTF_8.name()
}
tasks.withType<ProcessResources> {
filteringCharset = Charsets.UTF_8.name()
}
2021-06-12 14:20:45 +02:00
repositories {
mavenCentral()
2022-04-22 05:21:55 +02:00
maven(paperMavenPublicUrl)
2021-06-12 14:20:45 +02:00
}
}
2021-06-12 14:09:34 +02:00
paperweight {
2023-03-23 12:53:58 +01:00
serverProject.set(project(":folia-server"))
2021-06-12 20:04:04 +02:00
2022-04-22 05:21:55 +02:00
remapRepo.set(paperMavenPublicUrl)
decompileRepo.set(paperMavenPublicUrl)
2021-08-25 06:06:30 +02:00
2021-06-12 14:09:34 +02:00
usePaperUpstream(providers.gradleProperty("paperRef")) {
withPaperPatcher {
apiPatchDir.set(layout.projectDirectory.dir("patches/api"))
2023-02-23 17:13:45 +01:00
apiOutputDir.set(layout.projectDirectory.dir("Folia-API"))
2021-06-12 14:09:34 +02:00
serverPatchDir.set(layout.projectDirectory.dir("patches/server"))
2023-02-23 17:13:45 +01:00
serverOutputDir.set(layout.projectDirectory.dir("Folia-Server"))
2021-06-12 14:09:34 +02:00
}
2024-01-10 23:03:31 +01:00
patchTasks.register("generatedApi") {
isBareDirectory = true
upstreamDirPath = "paper-api-generator/generated"
patchDir = layout.projectDirectory.dir("patches/generatedApi")
outputDir = layout.projectDirectory.dir("paper-api-generator/generated")
}
2021-06-12 14:09:34 +02:00
}
}
2021-08-25 06:06:30 +02:00
tasks.generateDevelopmentBundle {
2023-02-23 17:13:45 +01:00
apiCoordinates.set("dev.folia:folia-api")
2021-08-25 06:06:30 +02:00
mojangApiCoordinates.set("io.papermc.paper:paper-mojangapi")
2023-03-29 18:19:05 +02:00
libraryRepositories.addAll(
"https://repo.maven.apache.org/maven2/",
paperMavenPublicUrl,
2021-08-25 06:06:30 +02:00
)
}
allprojects {
publishing {
repositories {
2023-03-29 18:19:05 +02:00
maven("https://repo.papermc.io/repository/maven-snapshots/") {
name = "paperSnapshots"
2021-08-25 06:06:30 +02:00
credentials(PasswordCredentials::class)
}
}
}
}
publishing {
if (project.hasProperty("publishDevBundle")) {
publications.create<MavenPublication>("devBundle") {
artifact(tasks.generateDevelopmentBundle) {
artifactId = "dev-bundle"
}
}
}
}
tasks.withType<RebuildGitPatches> {
filterPatches.set(false)
2023-03-29 18:19:05 +02:00
}
2023-03-29 20:56:33 +02:00
tasks.register("printMinecraftVersion") {
doLast {
println(providers.gradleProperty("mcVersion").get().trim())
}
}
tasks.register("printPaperVersion") {
doLast {
println(project.version)
}
}