mirror of
https://github.com/PurpurMC/Purpur.git
synced 2026-02-17 08:27:43 +01:00
updating submodules breaks things, switch code back to non-submodule for time being
This commit is contained in:
2
Paper
2
Paper
Submodule Paper updated: 76a75fc35a...19da14ee00
@@ -52,19 +52,68 @@ subprojects {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
val paperDir = layout.projectDirectory.dir("Paper")
|
val paperDir = layout.projectDirectory.dir("Paper")
|
||||||
|
val paperBranch = "dev/1.17"
|
||||||
|
|
||||||
val initSubmodules by tasks.registering {
|
val initSubmodules by tasks.registering {
|
||||||
|
group = "paperweight"
|
||||||
|
|
||||||
outputs.upToDateWhen { false }
|
outputs.upToDateWhen { false }
|
||||||
doLast {
|
doLast {
|
||||||
paperDir.asFile.mkdirs()
|
paperDir.asFile.mkdirs()
|
||||||
Git(paperDir)("submodule", "update", "--init", "--recursive").executeOut()
|
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 {
|
paperweight {
|
||||||
serverProject.set(project(":Purpur-Server"))
|
serverProject.set(project(":Purpur-Server"))
|
||||||
|
|
||||||
/* // this is the code for without submodules in case we ever want to use it
|
|
||||||
usePaperUpstream(providers.gradleProperty("paperRef")) {
|
usePaperUpstream(providers.gradleProperty("paperRef")) {
|
||||||
withPaperPatcher {
|
withPaperPatcher {
|
||||||
apiPatchDir.set(layout.projectDirectory.dir("patches/api"))
|
apiPatchDir.set(layout.projectDirectory.dir("patches/api"))
|
||||||
@@ -74,8 +123,8 @@ paperweight {
|
|||||||
serverOutputDir.set(layout.projectDirectory.dir("Purpur-Server"))
|
serverOutputDir.set(layout.projectDirectory.dir("Purpur-Server"))
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
*/
|
|
||||||
|
|
||||||
|
/*
|
||||||
upstreams {
|
upstreams {
|
||||||
register("paper") {
|
register("paper") {
|
||||||
upstreamDataTask {
|
upstreamDataTask {
|
||||||
@@ -98,4 +147,5 @@ paperweight {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
*/
|
||||||
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user