No description
Find a file
2021-06-14 19:39:23 +02:00
.github/workflows Cache more in GitHub Actions 2021-05-09 22:48:19 -05:00
buildSrc Hopefully actually fix library relocating 2021-06-11 06:17:38 -05:00
gradle Update Hypo (fixes running on Java 8) 2021-06-11 23:26:12 -05:00
license Initial work on supporting forks 2021-06-09 20:55:14 -05:00
paperweight-core initial try to add a importmcdev task 2021-06-14 19:39:23 +02:00
paperweight-lib initial try to add a importmcdev task 2021-06-14 19:39:23 +02:00
paperweight-patcher Fix patching and fork issues on Windows 2021-06-13 17:00:06 -05:00
.editorconfig Add ktlint formatter 2020-12-26 15:56:49 -08: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
gradle.properties Initial work on supporting forks 2021-06-09 20:55:14 -05:00
gradlew Gradle 6.7, initial patch remap (not working) 2020-08-11 23:01:37 -07:00
gradlew.bat Gradle 6.7, initial patch remap (not working) 2020-08-11 23:01:37 -07:00
readme.md Add ktlint formatter 2020-12-26 15:56:49 -08:00
settings.gradle.kts Initial work on supporting forks 2021-06-09 20:55:14 -05:00

paperweight

How to use this for testing:

Install this plugin to Maven Local:

./gradlew publishToMavenLocal

Clone a new Paper repo and checkout the feature/mojmap branch.

  • Add mavenLocal() to the list of repos in settings.gradle.kts.
  • Change paperweight version to 1.0.0-LOCAL-SNAPSHOT in the plugins {} block in build.gradle.kts.

Run the task (on the Paper repo) to set up the development environment:

./gradlew patchPaper

All task outputs paperweight creates goes into <project-root>/.gradle/caches.

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.