• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

PaperMC/paperweight: Gradle build system plugin for Paper and Paper forks

原作者: [db:作者] 来自: 网络 收藏 邀请

开源软件名称(OpenSource Name):

PaperMC/paperweight

开源软件地址(OpenSource Url):

https://github.com/PaperMC/paperweight

开源编程语言(OpenSource Language):

Kotlin 100.0%

开源软件介绍(OpenSource Introduction):

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.




鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap