switch fully away from submodule

This commit is contained in:
Ben Kerllenevich
2021-06-13 10:26:34 -04:00
parent 0554f1f067
commit 998d3ae83d
4 changed files with 7 additions and 96 deletions

4
.gitmodules vendored
View File

@@ -1,4 +0,0 @@
[submodule "Paper"]
path = Paper
url = https://github.com/PaperMC/Paper
branch = dev/1.17

1
Paper

Submodule Paper deleted from 19da14ee00

View File

@@ -1,5 +1,3 @@
import io.papermc.paperweight.util.Git
plugins {
java
id("com.github.johnrengelman.shadow") version "7.0.0" apply false
@@ -52,69 +50,10 @@ subprojects {
}
}
/*
val paperDir = layout.projectDirectory.dir("Paper")
val paperBranch = "dev/1.17"
val initSubmodules by tasks.registering {
group = "paperweight"
outputs.upToDateWhen { false }
doLast {
paperDir.asFile.mkdirs()
Git(layout.projectDirectory)("submodule", "update", "--init", "--recursive").executeOut()
}
}
val upstreamUpdate by tasks.registering {
group = "paperweight"
outputs.upToDateWhen { false }
finalizedBy(cleanUpstreamCaches)
doLast {
Git(paperDir)("fetch").executeOut()
Git(paperDir)("clean", "-fd").executeOut()
Git(paperDir)("reset", "--hard", "origin/$paperBranch").executeOut()
Git(layout.projectDirectory)("add", "--force", paperDir.asFile.name).executeOut()
Git(layout.projectDirectory)("submodule", "update", "--init", "--recursive").executeOut()
}
}
val cleanUpstreamCaches by tasks.registering(GradleBuild::class) {
dir = paperDir.asFile
tasks = listOf("cleanCache")
}
val upstreamCommit by tasks.registering {
group = "paperweight"
outputs.upToDateWhen { false }
doLast {
val old = Git(layout.projectDirectory)("ls-tree", "HEAD", paperDir.asFile.name).readText()
?.substringAfter("commit ")?.substringBefore("\t")
val changes = Git(paperDir)("log", "--oneline", "$old...HEAD").readText()
changes ?: run {
println("No changes to commit?")
return@doLast
}
val commitMessage = """
|Updated Upstream (Paper)
|
|Upstream has released updates that appear to apply and compile correctly.
|
|Paper Changes:
|$changes
""".trimMargin()
Git(layout.projectDirectory)("commit", "-m", commitMessage).executeOut()
}
}
*/
paperweight {
serverProject.set(project(":Purpur-Server"))
usePaperUpstream(providers.gradleProperty("paperRef")) {
usePaperUpstream(providers.gradleProperty("paperCommit")) {
withPaperPatcher {
apiPatchDir.set(layout.projectDirectory.dir("patches/api"))
apiOutputDir.set(layout.projectDirectory.dir("Purpur-API"))
@@ -123,29 +62,4 @@ paperweight {
serverOutputDir.set(layout.projectDirectory.dir("Purpur-Server"))
}
}
/*
upstreams {
register("paper") {
upstreamDataTask {
dependsOn(initSubmodules)
projectDir.set(paperDir)
workDir.set(layout.projectDirectory)
}
patchTasks {
register("api") {
sourceDir.set(paperDir.dir("Paper-API"))
patchDir.set(layout.projectDirectory.dir("patches/api"))
outputDir.set(layout.projectDirectory.dir("Purpur-API"))
}
register("server") {
sourceDir.set(paperDir.dir("Paper-Server"))
patchDir.set(layout.projectDirectory.dir("patches/server"))
outputDir.set(layout.projectDirectory.dir("Purpur-Server"))
}
}
}
}
*/
}

View File

@@ -1,4 +1,6 @@
group = "net.pl3x.purpur"
version = 1.17-R0.1-SNAPSHOT
packageVersion = 1_17_R1
paperRef = dev/1.17
group=net.pl3x.purpur
version=1.17-R0.1-SNAPSHOT
packageVersion=1_17_R1
paperCommit=0ea382b41d440644c103961fd9373574b6e12772
org.gradle.jvmargs=-Xmx3G