Compare commits

...

11 commits

Author SHA1 Message Date
49e471e0f8 Rename plugin group
Some checks failed
Deploy Snapshot / Deploy Snapshot (push) Has been cancelled
Test / Test (push) Has been cancelled
2024-10-15 03:06:12 -07:00
95585adea7 Add publish instructions 2024-10-15 02:50:13 -07:00
671d4ff2b2 More adjustments for project name changes 2024-10-15 02:34:16 -07:00
ecb210d3ef Change project name to Nugget 2024-10-15 02:31:08 -07:00
Jason Penilla
91fac7484b
1.7.4-SNAPSHOT 2024-09-27 19:29:41 -07:00
Jason Penilla
4e08a00d65
release: Version 1.7.3 2024-09-27 19:27:08 -07:00
okx-code
4b9a233416
Specify myers diff algorithm explicitly (#252)
* Use myers diff algorithm

This is the default Git diff algorithm and by specifying this explicitly we prevent git configs from overriding this setting. As Paper relies on patches generated with Myers, and breaks with other algorithms, it doesn't make sense to allow users to configure this.

* Add diff algorithm in generatePatches

* Also add to isUnfinishedPatch
2024-09-27 19:22:32 -07:00
Jason Penilla
b3467d9f8d
Guard against invalid remapJar configs (#256)
Proactively throw an error when input and output paths match instead of letting tiny-remapper fail.
2024-09-27 19:06:35 -07:00
Jason Penilla
40f78222c0
1.7.3-SNAPSHOT 2024-08-06 13:42:56 -07:00
Jason Penilla
33a8f201da
release: Version 1.7.2 2024-08-06 13:38:23 -07:00
Jason Penilla
a788a9770d
fix(userdev): invalidate caches for preceding steps when a step fails (#250)
* userdev: invalidate caches for preceding steps when a step fails

a common cause for patch apply failing is decompiling with the wrong jdk,
and we don't want to have to manually clean cache to fix it after replacing the jdk

* adjust message
2024-08-06 13:37:40 -07:00
150 changed files with 57 additions and 32 deletions

View file

@ -35,7 +35,7 @@ fun ShadowJar.configureStandard() {
val sourcesJar by tasks.existing(AbstractArchiveTask::class) {
from(
zipTree(project(":paperweight-lib").tasks
zipTree(project(":nugget-lib").tasks
.named("sourcesJar", AbstractArchiveTask::class)
.flatMap { it.archiveFile })
) {
@ -43,15 +43,15 @@ val sourcesJar by tasks.existing(AbstractArchiveTask::class) {
}
}
val prefix = project.name.substringAfter("paperweight-")
val prefix = project.name.substringAfter("nugget-")
gradlePlugin {
website.set("https://github.com/PaperMC/paperweight")
vcsUrl.set("https://github.com/PaperMC/paperweight")
plugins.create("paperweight-$prefix") {
website.set("https://git.zontreck.com/ObsidianMC/nugget")
vcsUrl.set("https://git.zontreck.com/ObsidianMC/nugget")
plugins.create("nugget-$prefix") {
id = "io.papermc.paperweight." + prefix
displayName = "paperweight $prefix"
tags.set(listOf("paper", "minecraft"))
displayName = "nugget $prefix"
tags.set(listOf("obsidian", "minecraft"))
}
}
@ -64,7 +64,7 @@ val shadowJar by tasks.existing(ShadowJar::class) {
return@existing
}
val prefix = "paper.libs"
val prefix = "obsidian.libs"
listOf(
"com.github.salomonbrys.kotson",
"com.google.errorprone.annotations",
@ -91,11 +91,21 @@ val shadowJar by tasks.existing(ShadowJar::class) {
}
}
val MAVEN_PASSWORD = "AriasCreationsMavenPassword"
val MAVEN_USER = "AriasCreationsMavenUser"
publishing {
repositories {
maven("https://repo.papermc.io/repository/maven-snapshots/") {
credentials(PasswordCredentials::class)
name = "paper"
maven {
url = uri("https://git.zontreck.com/api/packages/ObsidianMC/maven")
name = "obsidian"
credentials {
username = project.findProperty(MAVEN_USER)?.toString()
password = project.findProperty(MAVEN_PASSWORD)?.toString()
}
}
}
@ -109,11 +119,11 @@ publishing {
}
fun MavenPom.pomConfig() {
val repoPath = "PaperMC/paperweight"
val repoUrl = "https://github.com/$repoPath"
val repoPath = "ObsidianMC/nugget"
val repoUrl = "https://git.zontreck.com/$repoPath"
name.set("paperweight")
description.set("Gradle plugin for the PaperMC project")
name.set("nugget")
description.set("Gradle plugin for the ObsidianMC project")
url.set(repoUrl)
inceptionYear.set("2020")

View file

@ -1,5 +1,5 @@
group = io.papermc.paperweight
version = 1.7.2-SNAPSHOT
group = com.zontreck.nugget
version = 1.7.4-SNAPSHOT
org.gradle.caching = true
org.gradle.parallel = true

View file

@ -4,7 +4,7 @@ plugins {
}
dependencies {
shade(projects.paperweightLib)
shade(projects.nuggetLib)
implementation(libs.bundles.kotson)
}

View file

@ -49,7 +49,7 @@ class PaperweightCore : Plugin<Project> {
override fun apply(target: Project) {
checkJavaVersion()
Git.checkForGit()
printId<PaperweightCore>("paperweight-core", target.gradle)
printId<PaperweightCore>("nugget-core", target.gradle)
val ext = target.extensions.create(PAPERWEIGHT_EXTENSION, PaperweightCoreExtension::class, target)
@ -70,7 +70,7 @@ class PaperweightCore : Plugin<Project> {
target.configurations.create(DECOMPILER_CONFIG)
target.configurations.create(PAPERCLIP_CONFIG)
if (target.providers.gradleProperty("paperweight.dev").orNull == "true") {
if (target.providers.gradleProperty("nugget.dev").orNull == "true") {
target.tasks.register<CreateDiffOutput>("diff") {
inputDir.convention(ext.paper.paperServerDir.map { it.dir("src/main/java") })
val prop = target.providers.gradleProperty("paperweight.diff.output")

View file

@ -97,7 +97,7 @@ abstract class RebuildGitPatches : ControllableOutputTask() {
git("fetch", "--all", "--prune").runSilently(silenceErr = true)
git(
"format-patch",
"--zero-commit", "--full-index", "--no-signature", "--no-stat", "-N",
"--diff-algorithm=myers", "--zero-commit", "--full-index", "--no-signature", "--no-stat", "-N",
"-o", patchFolder.absolutePathString(),
baseRef.get()
).executeSilently()
@ -131,7 +131,7 @@ abstract class RebuildGitPatches : ControllableOutputTask() {
try {
for (patch in patchFiles) {
futures += executor.submit {
val hasNoChanges = git("diff", "--staged", patch.name).getText().lineSequence()
val hasNoChanges = git("diff", "--diff-algorithm=myers", "--staged", patch.name).getText().lineSequence()
.filter { it.startsWith('+') || it.startsWith('-') }
.filterNot { it.startsWith("+++") || it.startsWith("---") }
.all { it.startsWith("+index") || it.startsWith("-index") }

View file

@ -76,6 +76,13 @@ abstract class RemapJar : JavaLauncherTask() {
@TaskAction
fun run() {
if (inputJar.path.absolute().normalize() == outputJar.path.absolute().normalize()) {
throw PaperweightException(
"Invalid configuration, inputJar and outputJar point to the same path: ${inputJar.path}\n" +
"Consider removing customization of output locations, following the default Gradle conventions."
)
}
if (toNamespace.get() != fromNamespace.get()) {
val logFile = layout.cache.resolve(paperTaskOutput("log"))
TinyRemapper.run(

View file

@ -103,7 +103,7 @@ class PatchApplier(
target.createDirectories()
git("checkout", remappedBranch).executeSilently()
git(
"format-patch", "--zero-commit", "--full-index", "--no-signature", "--no-stat", "-N", "-o",
"format-patch", "--diff-algorith=myers", "--zero-commit", "--full-index", "--no-signature", "--no-stat", "-N", "-o",
target.absolutePathString(), remappedBaseTag
).executeOut()
}
@ -114,7 +114,7 @@ class PatchApplier(
}
git("update-index", "--refresh").executeSilently()
if (git("diff-index", "--quiet", "HEAD", "--").runSilently() == 0) {
if (git("diff-index", "--diff-algorithm=myers", "--quiet", "HEAD", "--").runSilently() == 0) {
return git("log", unmappedBranch, "-1", "--pretty=%B").getText().trim() !=
git("log", remappedBranch, "-1", "--pretty=%B").getText().trim()
}

Some files were not shown because too many files have changed in this diff Show more