paperweight Gradle Plugins

repository·main·Indexed 43 days ago

https://github.com/papermc/paperweight

A suite of Gradle plugins for building, patching, and developing Paper and its derivatives. Includes paperweight-core for building Paper, paperweight-patcher for creating forks, and paperweight-userdev for developing internal plugins using Mojang mappings.

Tokens
473
Snippets
4
Records
6
Agent score
6%

What's inside paperweight

  1. Overview of paperweight Gradle plugins

    main

    paperweight provides three distinct Gradle plugins for different development workflows:

    1. paperweight-core: Used for building Paper.
    2. paperweight-patcher: Used to create forks of Paper or other forks based on paperweight-patcher.
    3. paperweight-userdev: Used to develop internal plugins using Mojang mappings.
  2. Format code using ktlint

    main

    This project uses ktlint for code style. You can automatically reformat the project code by running the format task. If ktlint cannot fix an error automatically, you must adjust it manually before committing.

    ./gradlew format
  3. Configure IDE and Git hooks for ktlint

    main

    To ensure your IDE follows the project's ktlint style settings and to automatically format code before every Git commit, run the following tasks:

    ./gradlew ktlintApplyToIdea addKtlintFormatGitPreCommitHook
  4. Debug paperweight Gradle tasks

    main

    To debug paperweight, create a remote JVM debug run configuration in IntelliJ IDEA connected to port 5005. Then, run your desired Gradle task with the debug flag. Gradle will wait for the debugger to connect before starting execution.

    ./gradlew --no-daemon -Dorg.gradle.debug=true <task>
  5. Install paperweight to Maven Local for testing

    main

    To test changes locally, install the current version of paperweight to your local Maven repository and configure your test project to resolve plugins from mavenLocal().

    Note: When using local versions, the -SNAPSHOT suffix from the version defined in gradle.properties is replaced with -LOCAL-SNAPSHOT.

    ./gradlew publishToMavenLocal
  6. Handling Unstable Gradle API warnings in IntelliJ

    main
    Because this project uses new Gradle features to maintain compatibility with Gradle 7.0+, you may see many "Unstable API Usages" inspections in IntelliJ. It is recommended to disable this inspection in your IDE settings to avoid noise.