Obsidian/build.gradle.kts

126 lines
3.5 KiB
Text
Raw Normal View History

plugins {
java
2021-08-17 15:11:04 -07:00
`maven-publish`
2021-10-11 14:31:53 -07:00
id("com.github.johnrengelman.shadow") version "7.1.0" apply false
2021-11-03 20:50:46 -07:00
id("io.papermc.paperweight.core") version "1.1.14"
}
allprojects {
apply(plugin = "java")
2021-08-17 15:11:04 -07:00
apply(plugin = "maven-publish")
java {
toolchain {
languageVersion.set(JavaLanguageVersion.of(16))
}
}
}
subprojects {
tasks.withType<JavaCompile> {
options.encoding = Charsets.UTF_8.name()
options.release.set(16)
}
tasks.withType<Javadoc> {
options.encoding = Charsets.UTF_8.name()
}
tasks.withType<ProcessResources> {
filteringCharset = Charsets.UTF_8.name()
}
if (name == "Paper-MojangAPI") {
return@subprojects
}
repositories {
mavenCentral()
maven("https://papermc.io/repo/repository/maven-public/")
}
}
repositories {
2021-06-12 20:18:50 -07:00
mavenCentral()
2021-06-14 21:17:16 -07:00
maven("https://papermc.io/repo/repository/maven-public/") {
content { onlyForConfigurations("paperclip") }
}
}
dependencies {
2021-07-06 23:52:40 -07:00
paramMappings("org.quiltmc:yarn:1.17.1+build.1:mergedv2")
2021-10-02 18:42:30 -07:00
remapper("net.fabricmc:tiny-remapper:0.6.0:fat")
2021-06-14 21:17:16 -07:00
decompiler("net.minecraftforge:forgeflower:1.5.498.12")
paperclip("io.papermc:paperclip:2.0.1")
}
paperweight {
2021-06-14 21:17:16 -07:00
minecraftVersion.set(providers.gradleProperty("mcVersion"))
serverProject.set(project(":Paper-Server"))
paper {
spigotApiPatchDir.set(layout.projectDirectory.dir("patches/api"))
spigotServerPatchDir.set(layout.projectDirectory.dir("patches/server"))
2021-06-11 05:02:28 -07:00
2021-08-17 15:11:04 -07:00
paramMappingsRepo.set("https://maven.quiltmc.org/repository/release/")
2021-10-02 18:42:30 -07:00
remapRepo.set("https://maven.fabricmc.net/")
2021-08-17 15:11:04 -07:00
decompileRepo.set("https://files.minecraftforge.net/maven/")
mappingsPatch.set(layout.projectDirectory.file("build-data/mappings-patch.tiny"))
reobfMappingsPatch.set(layout.projectDirectory.file("build-data/reobf-mappings-patch.tiny"))
additionalSpigotMemberMappings.set(layout.projectDirectory.file("build-data/additional-spigot-member-mappings.csrg"))
craftBukkitPatchPatchesDir.set(layout.projectDirectory.dir("build-data/craftbukkit-patch-patches"))
2021-06-26 20:11:45 -07:00
reobfPackagesToFix.addAll(
"co.aikar.timings",
"com.destroystokyo.paper",
"com.mojang",
"io.papermc.paper",
"net.kyori.adventure.bossbar",
"net.minecraft",
"org.bukkit.craftbukkit",
"org.spigotmc"
)
}
}
2021-08-17 15:11:04 -07:00
tasks.generateDevelopmentBundle {
apiCoordinates.set("io.papermc.paper:paper-api")
mojangApiCoordinates.set("io.papermc.paper:paper-mojangapi")
libraryRepositories.set(
listOf(
"https://repo.maven.apache.org/maven2/",
2021-08-17 15:11:04 -07:00
"https://libraries.minecraft.net/",
"https://papermc.io/repo/repository/maven-public/",
"https://maven.quiltmc.org/repository/release/",
2021-08-17 15:11:04 -07:00
)
)
}
publishing {
if (project.hasProperty("publishDevBundle")) {
publications.create<MavenPublication>("devBundle") {
artifact(tasks.generateDevelopmentBundle) {
artifactId = "dev-bundle"
}
}
}
}
allprojects {
publishing {
repositories {
maven {
name = "paperSnapshots"
url = uri("https://papermc.io/repo/repository/maven-snapshots/")
credentials(PasswordCredentials::class)
}
}
}
}
tasks.register("printMinecraftVersion") {
doLast {
println(providers.gradleProperty("mcVersion").get().trim())
}
}