Folia/build.gradle.kts

112 lines
3.1 KiB
Plaintext
Raw Normal View History

2021-06-12 20:09:34 +08:00
plugins {
java
2021-08-25 12:06:30 +08:00
`maven-publish`
2022-01-28 04:24:04 +08:00
id("com.github.johnrengelman.shadow") version "7.1.2" apply false
2022-04-22 11:21:55 +08:00
id("io.papermc.paperweight.patcher") version "1.3.6"
2021-06-12 20:09:34 +08:00
}
2022-04-22 11:21:55 +08:00
val paperMavenPublicUrl = "https://papermc.io/repo/repository/maven-public/"
2021-06-13 12:44:00 +08:00
repositories {
mavenCentral()
2022-04-22 11:21:55 +08:00
maven(paperMavenPublicUrl) {
content { onlyForConfigurations(configurations.paperclip.name) }
2021-06-13 12:44:00 +08:00
}
}
dependencies {
2022-04-22 11:21:55 +08:00
remapper("net.fabricmc:tiny-remapper:0.8.2:fat")
decompiler("net.minecraftforge:forgeflower:1.5.498.29")
2021-12-02 16:00:38 +08:00
paperclip("io.papermc:paperclip:3.0.2")
2021-06-13 12:44:00 +08:00
}
2021-08-25 12:06:30 +08:00
allprojects {
2021-06-12 20:09:34 +08:00
apply(plugin = "java")
2021-08-25 12:06:30 +08:00
apply(plugin = "maven-publish")
2021-06-12 20:09:34 +08:00
java {
toolchain {
2021-12-02 16:00:38 +08:00
languageVersion.set(JavaLanguageVersion.of(17))
2021-06-12 20:09:34 +08:00
}
}
2021-08-25 12:06:30 +08:00
}
2021-06-12 20:09:34 +08:00
2021-08-25 12:06:30 +08:00
subprojects {
tasks.withType<JavaCompile> {
options.encoding = Charsets.UTF_8.name()
2021-12-02 16:00:38 +08:00
options.release.set(17)
2021-06-12 20:20:45 +08:00
}
2021-08-25 12:06:30 +08:00
tasks.withType<Javadoc> {
options.encoding = Charsets.UTF_8.name()
}
tasks.withType<ProcessResources> {
filteringCharset = Charsets.UTF_8.name()
}
2021-06-12 20:20:45 +08:00
repositories {
mavenCentral()
2022-04-22 11:21:55 +08:00
maven(paperMavenPublicUrl)
2021-06-12 20:20:45 +08:00
}
}
2021-06-12 20:09:34 +08:00
paperweight {
serverProject.set(project(":forktest-server"))
2021-06-13 02:04:04 +08:00
2022-04-22 11:21:55 +08:00
remapRepo.set(paperMavenPublicUrl)
decompileRepo.set(paperMavenPublicUrl)
2021-08-25 12:06:30 +08:00
2021-06-12 20:09:34 +08:00
usePaperUpstream(providers.gradleProperty("paperRef")) {
withPaperPatcher {
apiPatchDir.set(layout.projectDirectory.dir("patches/api"))
apiOutputDir.set(layout.projectDirectory.dir("forktest-api"))
2021-06-12 20:09:34 +08:00
serverPatchDir.set(layout.projectDirectory.dir("patches/server"))
serverOutputDir.set(layout.projectDirectory.dir("forktest-server"))
2021-06-12 20:09:34 +08:00
}
}
}
2021-08-25 12:06:30 +08:00
//
// Everything below here is optional if you don't care about publishing API or dev bundles to your repository
//
tasks.generateDevelopmentBundle {
apiCoordinates.set("com.example.paperfork:forktest-api")
mojangApiCoordinates.set("io.papermc.paper:paper-mojangapi")
libraryRepositories.set(
listOf(
"https://repo.maven.apache.org/maven2/",
2022-04-22 11:21:55 +08:00
paperMavenPublicUrl,
// "https://my.repo/", // This should be a repo hosting your API (in this example, 'com.example.paperfork:forktest-api')
2021-08-25 12:06:30 +08:00
)
)
}
allprojects {
// Publishing API:
// ./gradlew :ForkTest-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"
}
}
}
}