mirror of
https://github.com/PurpurMC/Purpur.git
synced 2025-02-11 12:50:28 +08:00
124 lines
3.0 KiB
Plaintext
124 lines
3.0 KiB
Plaintext
import org.gradle.api.tasks.testing.logging.TestExceptionFormat
|
|
import org.gradle.api.tasks.testing.logging.TestLogEvent
|
|
|
|
plugins {
|
|
java
|
|
`maven-publish`
|
|
id("com.github.johnrengelman.shadow") version "8.1.1" apply false
|
|
id("io.papermc.paperweight.patcher") version "1.5.5"
|
|
}
|
|
|
|
allprojects {
|
|
apply(plugin = "java")
|
|
apply(plugin = "maven-publish")
|
|
|
|
java {
|
|
toolchain {
|
|
languageVersion.set(JavaLanguageVersion.of(17))
|
|
}
|
|
}
|
|
}
|
|
|
|
val paperMavenPublicUrl = "https://repo.papermc.io/repository/maven-public/"
|
|
|
|
subprojects {
|
|
tasks.withType<JavaCompile>().configureEach {
|
|
options.encoding = Charsets.UTF_8.name()
|
|
options.release.set(17)
|
|
}
|
|
tasks.withType<Javadoc> {
|
|
options.encoding = Charsets.UTF_8.name()
|
|
}
|
|
tasks.withType<ProcessResources> {
|
|
filteringCharset = Charsets.UTF_8.name()
|
|
}
|
|
tasks.withType<Test> {
|
|
testLogging {
|
|
showStackTraces = true
|
|
exceptionFormat = TestExceptionFormat.FULL
|
|
events(TestLogEvent.STANDARD_OUT)
|
|
}
|
|
}
|
|
|
|
repositories {
|
|
mavenCentral()
|
|
maven(paperMavenPublicUrl)
|
|
maven("https://jitpack.io")
|
|
}
|
|
}
|
|
|
|
repositories {
|
|
mavenCentral()
|
|
maven(paperMavenPublicUrl) {
|
|
content {
|
|
onlyForConfigurations(configurations.paperclip.name)
|
|
}
|
|
}
|
|
}
|
|
|
|
dependencies {
|
|
remapper("net.fabricmc:tiny-remapper:0.8.6:fat")
|
|
decompiler("net.minecraftforge:forgeflower:2.0.627.2")
|
|
paperclip("io.papermc:paperclip:3.0.3")
|
|
}
|
|
|
|
paperweight {
|
|
serverProject.set(project(":purpur-server"))
|
|
|
|
remapRepo.set(paperMavenPublicUrl)
|
|
decompileRepo.set(paperMavenPublicUrl)
|
|
|
|
usePaperUpstream(providers.gradleProperty("paperCommit")) {
|
|
withPaperPatcher {
|
|
apiPatchDir.set(layout.projectDirectory.dir("patches/api"))
|
|
apiOutputDir.set(layout.projectDirectory.dir("Purpur-API"))
|
|
|
|
serverPatchDir.set(layout.projectDirectory.dir("patches/server"))
|
|
serverOutputDir.set(layout.projectDirectory.dir("Purpur-Server"))
|
|
}
|
|
}
|
|
}
|
|
|
|
tasks.generateDevelopmentBundle {
|
|
apiCoordinates.set("org.purpurmc.purpur:purpur-api")
|
|
mojangApiCoordinates.set("io.papermc.paper:paper-mojangapi")
|
|
libraryRepositories.set(
|
|
listOf(
|
|
"https://repo.maven.apache.org/maven2/",
|
|
paperMavenPublicUrl,
|
|
"https://repo.purpurmc.org/snapshots",
|
|
)
|
|
)
|
|
}
|
|
|
|
allprojects {
|
|
publishing {
|
|
repositories {
|
|
maven("https://repo.purpurmc.org/snapshots") {
|
|
name = "purpur"
|
|
credentials(PasswordCredentials::class)
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
publishing {
|
|
publications.create<MavenPublication>("devBundle") {
|
|
artifact(tasks.generateDevelopmentBundle) {
|
|
artifactId = "dev-bundle"
|
|
}
|
|
}
|
|
}
|
|
|
|
tasks.register("printMinecraftVersion") {
|
|
doLast {
|
|
println(providers.gradleProperty("mcVersion").get().trim())
|
|
}
|
|
}
|
|
|
|
tasks.register("printPurpurVersion") {
|
|
doLast {
|
|
println(project.version)
|
|
}
|
|
}
|