No description
Find a file
Jason Penilla c8f6e05472
Plugin remapping (#239)
* Work

* Include mappings hash in manifest

* Use manifest instead of marker file

* Create the manifest if it doesn't exist

* Make RemapJar no-op when the namespaces match

* move files

* decorate userdev jar manifests

* fix relocated shadow jar manifest

* feat(core/patcher): Replace use of shadow plugin

We now reobf using the relocated mappings.
The constant pool still needs to be relocated for references to CB classes by name in for example Commodore or class preloading.

* chore(core/patcher): Remove no longer needed relocation logic from GenerateDevBundle

* chore(core/patcher): Do not extract manifest when including mappings

We don't need this after removing shadow usage

* Bump version to 1.6.0-SNAPSHOT
2024-04-23 11:40:20 -07:00
.github/workflows feat(userdev): Add experimental (for now) option for shared userdev caches (#187) 2023-04-04 11:56:51 -07:00
buildSrc fix(core/patcher): Download Spigot dependencies using DetachedResolver (#233) 2024-03-27 12:38:27 -07:00
gradle Update Gradle wrapper to 8.7 2024-03-26 11:54:19 -07:00
license Update license headers 2023-02-02 16:26:35 -07:00
paperweight-core Plugin remapping (#239) 2024-04-23 11:40:20 -07:00
paperweight-lib Plugin remapping (#239) 2024-04-23 11:40:20 -07:00
paperweight-patcher Plugin remapping (#239) 2024-04-23 11:40:20 -07:00
paperweight-userdev Plugin remapping (#239) 2024-04-23 11:40:20 -07:00
.editorconfig Update Hypo to 1.2.2 (#102) 2021-10-24 00:14:34 -07:00
.gitattributes Gradle 6.7, initial patch remap (not working) 2020-08-11 23:01:37 -07:00
.gitignore Initial work on supporting forks 2021-06-09 20:55:14 -05:00
build.gradle.kts Update Gradle wrapper to 8.7 2024-03-26 11:54:19 -07:00
gradle.properties Plugin remapping (#239) 2024-04-23 11:40:20 -07:00
gradlew Update Gradle to 8.4 (#224) 2023-11-20 16:12:08 -07:00
gradlew.bat Update Gradle wrapper to 8.7 2024-03-26 11:54:19 -07:00
readme.md Small readme updates (#80) 2021-09-23 23:34:33 -07:00
settings.gradle.kts Update foojay resolver 2024-03-27 12:41:01 -07:00

paperweight

paperweight consists of three Gradle plugins:

  • paperweight-core: Used to build Paper
  • paperweight-patcher: Used to create forks of Paper or other paperweight-patcher-based forks
  • paperweight-userdev: Used to develop internals plugins using Mojang mappings

How to use this for testing:

  • Install paperweight to Maven Local:
./gradlew publishToMavenLocal
  • Add mavenLocal() for plugin resolution in your test project (see the Gradle docs for more details)
  • Adjust the paperweight version in your test project
    • Local versions of paperweight will use have the -SNAPSHOT suffix in the version from gradle.properties replaced by -LOCAL-SNAPSHOT

Most output paperweight creates goes into <project-root>/.gradle/caches/paperweight

Debugging

Create a remote JVM debug run configuration in IntelliJ which connects to port 5005, then run Gradle in debug mode:

./gradlew --no-daemon -Dorg.gradle.debug=true <task>

Gradle will not start until the debugger is connected so you don't need to worry about missing a breakpoint.

Style Guide

This projects follows the opinionated ktlint linter and formatter. It uses the ktlint-gradle plugin to automatically check and format the code in this repo.

Run the format task to automatically reformat the project using ktlint - which should handle most cases - to maintain a consistent code style. Adjust any errors ktlint can't fix itself before committing.

./gradlew format

IDE Setup

It's recommended to run the ktlintApplyToIdea and addKtlintFormatGitPreCommitHook tasks to configure your IDE with ktlint style settings and to automatically format this project's code before committing:

./gradlew ktlintApplyToIdea addKtlintFormatGitPreCommitHook

This project uses many new Gradle features to make sure we're ready for Gradle 7.0 and beyond, and we don't find ourselves stuck in a bad position where it's too hard for us to update. That being said, Gradle always marks new APIs as unstable for a bit until the next major version, so you should probably disable the "Unstable API Usages" inspection in IntelliJ as well. The easiest way to do this is just find any place where an "unstable API" is used (tons in Paperweight.kt) and disable the inspection from there.