-
Notifications
You must be signed in to change notification settings - Fork 95
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
chore(*): Setup initial hard fork structure
- Update paperweight to v2 for hard fork support - Update paperRef to latest hard fork commit - Add new impl module and configure paperweight - Patch build scripts - Update gitignore
- Loading branch information
1 parent
a9788b3
commit 8a12aac
Showing
8 changed files
with
216 additions
and
43 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,18 +1,17 @@ | ||
*.iml | ||
*.ipr | ||
*.iws | ||
.idea/ | ||
.classpath | ||
.project | ||
.settings/ | ||
slimeworldmanager-test/ | ||
.DS_Store/ | ||
release.properties | ||
libs/ | ||
.gradle/ | ||
.vscode/ | ||
|
||
**/.gradle/ | ||
.DS_Store | ||
build/ | ||
slimeworldmanager-api | ||
slimeworldmanager-server | ||
run | ||
*.hprof | ||
paper-api-generator | ||
**/run/ | ||
|
||
**/*.iml | ||
|
||
impl/aspaper-server/build.gradle.kts | ||
impl/aspaper-server/src/minecraft/ | ||
impl/paper-server/ | ||
impl/aspaper-api/build.gradle.kts | ||
impl/paper-api/ | ||
impl/paper-api-generator/ | ||
/impl/aspaper-server/.gradle/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,19 +0,0 @@ | ||
plugins { | ||
id("asp.paperweight-conventions") | ||
id("com.gradleup.shadow") version "8.3.5" apply false | ||
java | ||
} | ||
|
||
allprojects { | ||
repositories { | ||
mavenLocal() | ||
mavenCentral() | ||
|
||
maven("https://repo.papermc.io/repository/maven-public/") | ||
maven("https://repo.codemc.io/repository/nms/") | ||
maven("https://repo.rapture.pw/repository/maven-releases/") | ||
maven("https://repo.glaremasters.me/repository/concuncan/") | ||
maven("https://s01.oss.sonatype.org/content/repositories/snapshots/") | ||
maven("https://oss.sonatype.org/content/repositories/snapshots/") | ||
} | ||
} | ||
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,53 @@ | ||
--- a/paper-api/build.gradle.kts | ||
+++ b/paper-api/build.gradle.kts | ||
@@ -95,7 +_,7 @@ | ||
} | ||
|
||
// Paper start | ||
-val generatedApiPath: java.nio.file.Path = rootProject.projectDir.toPath().resolve("paper-api-generator/generated") | ||
+val generatedApiPath: java.nio.file.Path = rootProject.projectDir.toPath().resolve("impl/paper-api-generator/generated") | ||
idea { | ||
module { | ||
generatedSourceDirs.add(generatedApiPath.toFile()) | ||
@@ -105,6 +_,18 @@ | ||
main { | ||
java { | ||
srcDir(generatedApiPath) | ||
+ srcDir(file("../paper-api/src/main/java")) | ||
+ } | ||
+ resources { | ||
+ srcDir(file("../paper-api/src/main/resources")) | ||
+ } | ||
+ } | ||
+ test { | ||
+ java { | ||
+ srcDir(file("../paper-api/src/test/java")) | ||
+ } | ||
+ resources { | ||
+ srcDir(file("../paper-api/src/test/resources")) | ||
} | ||
} | ||
} | ||
@@ -169,7 +_,7 @@ | ||
|
||
tasks.withType<Javadoc> { | ||
val options = options as StandardJavadocDocletOptions | ||
- options.overview = "src/main/javadoc/overview.html" | ||
+ options.overview = "../paper-api/src/main/javadoc/overview.html" | ||
options.use() | ||
options.isDocFilesSubDirs = true | ||
options.links( | ||
@@ -207,11 +_,11 @@ | ||
} | ||
|
||
// workaround for https://github.com/gradle/gradle/issues/4046 | ||
- inputs.dir("src/main/javadoc").withPropertyName("javadoc-sourceset") | ||
+ inputs.dir("../paper-api/src/main/javadoc").withPropertyName("javadoc-sourceset") | ||
val fsOps = services.fileSystemOperations | ||
doLast { | ||
fsOps.copy { | ||
- from("src/main/javadoc") { | ||
+ from("../paper-api/src/main/javadoc") { | ||
include("**/doc-files/**") | ||
} | ||
into("build/docs/javadoc") |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,57 @@ | ||
--- a/paper-server/build.gradle.kts | ||
+++ b/paper-server/build.gradle.kts | ||
@@ -17,11 +_,20 @@ | ||
|
||
paperweight { | ||
minecraftVersion = providers.gradleProperty("mcVersion") | ||
- // macheOldPath = file("F:\\Projects\\PaperTooling\\mache\\versions\\1.21.4\\src\\main\\java") | ||
- // gitFilePatches = true | ||
+ | ||
+ val fork = forks.register("aspaper") { | ||
+ upstream.patchDir("paperServer") { | ||
+ upstreamPath = "paper-server" | ||
+ excludes = setOf("src/minecraft", "patches", "build.gradle.kts") | ||
+ patchesDir = rootDirectory.dir("aspaper-server/paper-patches") | ||
+ outputDir = rootDirectory.dir("paper-server") | ||
+ } | ||
+ } | ||
+ | ||
+ activeFork = fork | ||
|
||
paper { | ||
- reobfMappingsPatch = layout.projectDirectory.file("../build-data/reobf-mappings-patch.tiny") | ||
+ paperServerDir = upstreamsDirectory().map { it.dir("paper/paper-server") } | ||
} | ||
|
||
spigot { | ||
@@ -104,7 +_,20 @@ | ||
} | ||
} | ||
|
||
-val log4jPlugins = sourceSets.create("log4jPlugins") | ||
+sourceSets { | ||
+ main { | ||
+ java { srcDir("../paper-server/src/main/java") } | ||
+ resources { srcDir("../paper-server/src/main/resources") } | ||
+ } | ||
+ test { | ||
+ java { srcDir("../paper-server/src/test/java") } | ||
+ resources { srcDir("../paper-server/src/test/resources") } | ||
+ } | ||
+} | ||
+ | ||
+val log4jPlugins = sourceSets.create("log4jPlugins") { | ||
+ java { srcDir("../paper-server/src/log4jPlugins/java") } | ||
+} | ||
configurations.named(log4jPlugins.compileClasspathConfigurationName) { | ||
extendsFrom(configurations.compileClasspath.get()) | ||
} | ||
@@ -123,7 +_,7 @@ | ||
// Paper end - configure mockito agent that is needed in newer java versions | ||
|
||
dependencies { | ||
- implementation(project(":paper-api")) | ||
+ implementation(project(":impl:aspaper-api")) | ||
implementation("ca.spottedleaf:concurrentutil:0.0.2") // Paper - Add ConcurrentUtil dependency | ||
// Paper start | ||
implementation("org.jline:jline-terminal-ffm:3.27.1") // use ffm on java 22+ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,80 @@ | ||
import org.gradle.api.tasks.testing.logging.TestExceptionFormat | ||
import org.gradle.api.tasks.testing.logging.TestLogEvent | ||
|
||
plugins { | ||
java | ||
id("io.papermc.paperweight.patcher") | ||
} | ||
|
||
paperweight { | ||
upstreams.paper { | ||
ref = providers.gradleProperty("paperRef") | ||
|
||
// Setup file patches for build scripts | ||
patchFile { | ||
path = "paper-api/build.gradle.kts" | ||
outputFile = file("aspaper-api/build.gradle.kts") | ||
patchFile = file("aspaper-api/build.gradle.kts.patch") | ||
} | ||
patchFile { | ||
path = "paper-server/build.gradle.kts" | ||
outputFile = file("aspaper-server/build.gradle.kts") | ||
patchFile = file("aspaper-server/build.gradle.kts.patch") | ||
} | ||
|
||
patchDir("paperApi") { | ||
upstreamPath = "paper-api" | ||
excludes = setOf("build.gradle.kts") | ||
patchesDir = file("aspaper-api/paper-patches") | ||
outputDir = file("paper-api") | ||
} | ||
patchDir("paperApiGenerator") { | ||
upstreamPath = "paper-api-generator" | ||
patchesDir = file("aspaper-api-generator/paper-patches") | ||
outputDir = file("paper-api-generator") | ||
} | ||
} | ||
} | ||
|
||
subprojects { | ||
apply(plugin = "java-library") | ||
apply(plugin = "maven-publish") | ||
|
||
extensions.configure<JavaPluginExtension> { | ||
toolchain { | ||
languageVersion = JavaLanguageVersion.of(JAVA_VERSION) | ||
} | ||
} | ||
|
||
repositories { | ||
mavenCentral() | ||
maven(PAPER_MAVEN_PUBLIC_URL) | ||
} | ||
|
||
dependencies { | ||
// "testRuntimeOnly"("org.junit.platform:junit-platform-launcher") | ||
} | ||
|
||
tasks.withType<AbstractArchiveTask>().configureEach { | ||
isPreserveFileTimestamps = false | ||
isReproducibleFileOrder = true | ||
} | ||
tasks.withType<JavaCompile> { | ||
options.encoding = Charsets.UTF_8.name() | ||
options.release = JAVA_VERSION | ||
options.isFork = true | ||
} | ||
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) | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters