Skip to content

Commit 7d71ca4

Browse files
committed
hardfork - initial process
1 parent 0af16c7 commit 7d71ca4

File tree

142 files changed

+258
-1147
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

142 files changed

+258
-1147
lines changed

.gitignore

Lines changed: 12 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ core.*
33
hs_err_pid*
44

55
# Intellij
6-
.idea/
6+
.idea/*
77
*.iml
88
*.ipr
99
*.iws
@@ -18,16 +18,11 @@ out/
1818
nbproject/
1919
nbactions.xml
2020

21-
# vscode
22-
.vscode/
23-
2421
# Gradle
2522
!gradle-wrapper.jar
2623
.gradle/
2724
build/
2825
*/build/
29-
run/
30-
javadoc/
3126

3227
# we use maven!
3328
build.xml
@@ -38,6 +33,7 @@ target/
3833
dependency-reduced-pom.xml
3934

4035
# various other potential build files
36+
build/
4137
bin/
4238
dist/
4339
manifest.mf
@@ -52,13 +48,13 @@ manifest.mf
5248
# Linux temp files
5349
*~
5450

55-
# Paperweight
56-
build-data/
57-
*-API
58-
*-MojangAPI
59-
*-Server
60-
paper-api-generator
61-
compare.txt
62-
*.patch
63-
!patches/**/*
64-
upstream
51+
# other stuff
52+
/run
53+
54+
/plazma-server/build.gradle.kts
55+
/plazma-server/src/minecraft
56+
/paper-server
57+
/plazma-api/build.gradle.kts
58+
/paper-api
59+
*.jar
60+
test-plugin.settings.gradle.kts

build.gradle.kts

Lines changed: 53 additions & 134 deletions
Original file line numberDiff line numberDiff line change
@@ -3,159 +3,78 @@ import org.gradle.api.tasks.testing.logging.TestLogEvent
33

44
plugins {
55
java
6-
`kotlin-dsl`
7-
`maven-publish`
8-
`always-up-to-date`
9-
alias(libs.plugins.shadow) apply false
10-
alias(libs.plugins.paperweight)
6+
id("io.papermc.paperweight.patcher") version "2.0.0-beta.14"
117
}
128

13-
val jdkVersion = property("jdkVersion").toString().toInt()
14-
kotlin.jvmToolchain(jdkVersion)
15-
16-
repositories {
17-
mavenCentral()
18-
maven("https://repo.papermc.io/repository/maven-public/") { name = "papermc"
19-
content { onlyForConfigurations(configurations.paperclip.name) }
20-
}
21-
maven("https://repo.codemc.io/repository/maven-public/") { name = "codemc" }
22-
maven("https://jitpack.io") { name = "jitpack" }
23-
}
24-
25-
dependencies {
26-
remapper(libs.remapper)
27-
paperclip(libs.paperclip)
28-
decompiler(libs.decompiler)
29-
}
30-
31-
val brandName: String by project
32-
val providerRepo: String by project
339
paperweight {
34-
serverProject = project(":${brandName.lowercase()}-server")
10+
upstreams.paper {
11+
ref = providers.gradleProperty("paperCommit")
3512

36-
remapRepo = "https://repo.papermc.io/repository/maven-public/"
37-
decompileRepo = "https://repo.papermc.io/repository/maven-public/"
38-
39-
usePaperUpstream(providers.gradleProperty("paperCommit")) {
40-
withPaperPatcher {
41-
apiPatchDir.set(projectDir.resolve("patches/api"))
42-
apiOutputDir.set(projectDir.resolve("$brandName-API"))
43-
44-
serverPatchDir.set(projectDir.resolve("patches/server"))
45-
serverOutputDir.set(projectDir.resolve("$brandName-Server"))
13+
patchFile {
14+
path = "paper-server/build.gradle.kts"
15+
outputFile = file("plazma-server/build.gradle.kts")
16+
patchFile = file("plazma-server/build.gradle.kts.patch")
4617
}
47-
48-
patchTasks.register("generatedApi") {
49-
isBareDirectory = true
50-
upstreamDirPath = "paper-api-generator/generated"
51-
patchDir = projectDir.resolve("patches/generated-api")
52-
outputDir = projectDir.resolve("paper-api-generator/generated")
18+
patchFile {
19+
path = "paper-api/build.gradle.kts"
20+
outputFile = file("plazma-api/build.gradle.kts")
21+
patchFile = file("plazma-api/build.gradle.kts.patch")
5322
}
54-
}
55-
}
56-
57-
tasks {
58-
applyPatches {
59-
dependsOn("applyGeneratedApiPatches")
60-
}
61-
62-
rebuildPatches {
63-
dependsOn("rebuildGeneratedApiPatches")
64-
}
65-
66-
generateDevelopmentBundle {
67-
apiCoordinates.set("${project.group}:${brandName.lowercase()}-api")
68-
libraryRepositories.addAll(
69-
"https://repo1.maven.org/maven2/",
70-
"https://papermc.io/repo/repository/maven-public/",
71-
"https://repo.codemc.io/repository/maven-public/",
72-
"https://jitpack.io",
73-
)
74-
}
75-
}
76-
77-
publishing.publications.create<MavenPublication>("devBundle") {
78-
artifact(tasks.generateDevelopmentBundle) { artifactId = "dev-bundle" }
79-
}
80-
81-
val mavenUsername: String? by project
82-
val mavenPassword: String? by project
83-
allprojects {
84-
apply(plugin = "java")
85-
apply(plugin = "maven-publish")
86-
87-
java.toolchain.languageVersion.set(JavaLanguageVersion.of(jdkVersion))
88-
89-
publishing.repositories.maven("https://maven.pkg.github.com/$providerRepo") {
90-
name = "github"
91-
92-
credentials {
93-
username = mavenUsername ?: System.getenv("GRADLE_PROPERTY_MAVEN_USERNAME") ?: System.getenv("MAVEN_USERNAME")
94-
password = mavenPassword ?: System.getenv("GRADLE_PROPERTY_MAVEN_PASSWORD") ?: System.getenv("MAVEN_PASSWORD")
95-
}
96-
}
97-
98-
publishing.repositories.maven("https://repo.codemc.io/repository/maven-snapshots/") {
99-
name = "codemc"
100-
101-
credentials {
102-
username = mavenUsername ?: System.getenv("GRADLE_PROPERTY_MAVEN_USERNAME") ?: System.getenv("MAVEN_USERNAME")
103-
password = mavenPassword ?: System.getenv("GRADLE_PROPERTY_MAVEN_PASSWORD") ?: System.getenv("MAVEN_PASSWORD")
23+
patchDir("paperApi") {
24+
upstreamPath = "paper-api"
25+
excludes = setOf("build.gradle.kts")
26+
patchesDir = file("plazma-api/paper-patches")
27+
outputDir = file("paper-api")
10428
}
10529
}
10630
}
10731

10832
subprojects {
33+
apply(plugin = "java-library")
34+
apply(plugin = "maven-publish")
35+
10936
repositories {
37+
mavenLocal()
11038
mavenCentral()
111-
maven("https://repo.papermc.io/repository/maven-public/") { name = "papermc" }
112-
maven("https://repo.codemc.io/repository/maven-public/") { name = "codeme" }
113-
maven("https://jitpack.io") { name = "jitpack" }
39+
maven("https://repo.papermc.io/repository/maven-public/")
40+
maven("https://jitpack.io")
11441
}
11542

116-
tasks {
117-
withType<JavaCompile>().configureEach {
118-
options.encoding = Charsets.UTF_8.name()
119-
options.release = jdkVersion
120-
}
121-
122-
withType<Javadoc> {
123-
options.encoding = Charsets.UTF_8.name()
124-
}
125-
126-
withType<ProcessResources> {
127-
filteringCharset = Charsets.UTF_8.name()
43+
extensions.configure<JavaPluginExtension> {
44+
toolchain {
45+
languageVersion = JavaLanguageVersion.of(21)
12846
}
47+
}
12948

130-
withType<Test> {
131-
testLogging {
132-
showStackTraces = true
133-
exceptionFormat = TestExceptionFormat.FULL
134-
events(TestLogEvent.STANDARD_OUT)
49+
extensions.configure<PublishingExtension> {
50+
repositories {
51+
maven("https://repo.purpurmc.org/snapshots") {
52+
name = "purpur"
53+
credentials(PasswordCredentials::class)
13554
}
13655
}
13756
}
138-
}
139-
140-
val paperRepoVal = property("paperRepo").toString()
141-
val paperBranch = property("paperBranch").toString()
142-
val purpurRepoVal = property("purpurRepo").toString()
143-
val purpurBranch = property("purpurBranch").toString()
144-
val pufferfishRepoVal = property("pufferfishRepo").toString()
145-
val pufferfishBranch = property("pufferfishBranch").toString()
146-
val isUsePufferfish = property("usePufferfish").toString().toBoolean()
147-
alwaysUpToDate {
148-
149-
paperRepo.set(paperRepoVal)
150-
paperRef.set(paperBranch)
151-
paperCommitName.set("paperCommit")
152-
153-
purpurRepo.set(purpurRepoVal)
154-
purpurRef.set(purpurBranch)
155-
purpurCommitName.set("purpurCommit")
156-
157-
pufferfishRepo.set(pufferfishRepoVal)
158-
pufferfishRef.set(pufferfishBranch)
159-
usePufferfish.set(isUsePufferfish)
16057

58+
tasks.withType<JavaCompile> {
59+
options.encoding = Charsets.UTF_8.name()
60+
options.release = 21
61+
options.isFork = true
62+
}
63+
tasks.withType<Javadoc> {
64+
options.encoding = Charsets.UTF_8.name()
65+
}
66+
tasks.withType<ProcessResources> {
67+
filteringCharset = Charsets.UTF_8.name()
68+
}
69+
tasks.withType<Test> {
70+
testLogging {
71+
showStackTraces = true
72+
exceptionFormat = TestExceptionFormat.FULL
73+
events(TestLogEvent.STANDARD_OUT)
74+
}
75+
}
76+
tasks.withType<AbstractArchiveTask>().configureEach {
77+
isPreserveFileTimestamps = false
78+
isReproducibleFileOrder = true
79+
}
16180
}

buildSrc/build.gradle.kts

Lines changed: 0 additions & 31 deletions
This file was deleted.

buildSrc/src/main/kotlin/org/plazmamc/alwaysuptodate/AlwaysUpToDate.kt

Lines changed: 0 additions & 79 deletions
This file was deleted.

buildSrc/src/main/kotlin/org/plazmamc/alwaysuptodate/AlwaysUpToDateException.kt

Lines changed: 0 additions & 6 deletions
This file was deleted.

0 commit comments

Comments
 (0)