Folia/build.gradle.kts
Spottedleaf b772012778 Make the StructureCheck class MT-Safe
This is so that it may be accessed concurrently
from many regions.

Additionally, make sure it does not leak memory by limiting
the number of entries it will cache.
2023-02-23 23:35:30 -08:00

118 lines
3.2 KiB
Plaintext

import io.papermc.paperweight.patcher.tasks.SimpleRebuildGitPatches
plugins {
java
`maven-publish`
id("com.github.johnrengelman.shadow") version "7.1.2" apply false
id("io.papermc.paperweight.patcher") version "1.4.0"
}
val paperMavenPublicUrl = "https://repo.papermc.io/repository/maven-public/"
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.605.1")
paperclip("io.papermc:paperclip:3.0.2")
}
allprojects {
apply(plugin = "java")
apply(plugin = "maven-publish")
java {
toolchain {
languageVersion.set(JavaLanguageVersion.of(17))
}
}
}
subprojects {
tasks.withType<JavaCompile> {
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()
}
repositories {
mavenCentral()
maven(paperMavenPublicUrl)
}
}
paperweight {
serverProject.set(project(":Folia-Server"))
remapRepo.set(paperMavenPublicUrl)
decompileRepo.set(paperMavenPublicUrl)
usePaperUpstream(providers.gradleProperty("paperRef")) {
withPaperPatcher {
apiPatchDir.set(layout.projectDirectory.dir("patches/api"))
apiOutputDir.set(layout.projectDirectory.dir("Folia-API"))
serverPatchDir.set(layout.projectDirectory.dir("patches/server"))
serverOutputDir.set(layout.projectDirectory.dir("Folia-Server"))
}
}
}
//
// Everything below here is optional if you don't care about publishing API or dev bundles to your repository
//
tasks.generateDevelopmentBundle {
apiCoordinates.set("dev.folia:folia-api")
mojangApiCoordinates.set("io.papermc.paper:paper-mojangapi")
libraryRepositories.set(
listOf(
"https://repo.maven.apache.org/maven2/",
paperMavenPublicUrl,
// "https://my.repo/", // This should be a repo hosting your API (in this example, 'dev.folia:folia-api')
)
)
}
allprojects {
// Publishing API:
// ./gradlew :folia-API:publish[ToMavenLocal]
publishing {
repositories {
maven {
name = "myRepoSnapshots"
url = uri("https://my.repo/")
// See Gradle docs for how to provide credentials to PasswordCredentials
// https://docs.gradle.org/current/samples/sample_publishing_credentials.html
credentials(PasswordCredentials::class)
}
}
}
}
publishing {
// Publishing dev bundle:
// ./gradlew publishDevBundlePublicationTo(MavenLocal|MyRepoSnapshotsRepository) -PpublishDevBundle
if (project.hasProperty("publishDevBundle")) {
publications.create<MavenPublication>("devBundle") {
artifact(tasks.generateDevelopmentBundle) {
artifactId = "dev-bundle"
}
}
}
}
tasks.withType<SimpleRebuildGitPatches> {
filterPatches.set(false)
}