Skip to content

Improve Gradle Practices#3

Merged
sisby-folk merged 28 commits intoModFest:fabric-26.1from
TropheusJ:fabric-26.1
Apr 7, 2026
Merged

Improve Gradle Practices#3
sisby-folk merged 28 commits intoModFest:fabric-26.1from
TropheusJ:fabric-26.1

Conversation

@TropheusJ
Copy link
Copy Markdown
Member

@TropheusJ TropheusJ commented Apr 7, 2026

Did a bunch of stuff, reasons for everything are in commit descriptions.

Oddities:

  • Bumped Minecraft and FAPI, since the project doesn't actually work out of the box.
  • Also tweaked the workflow. Now publishes the sources jar too, and can be invoked manually. Bumped dependency versions here too.
  • The sources jar will be published to modrinth as an additional file
  • Fixes Attest Build Provenance fails in PRs #2 out of necessity

TropheusJ added 28 commits April 6, 2026 23:38
gradle can import it automatically, and it's good to follow the standard
this is *long* gone. removed in loom 1.8
- parallel: enable parallel mode. should be on by default IMO.
- caching: enable the build cache (https://docs.gradle.org/current/userguide/build_cache.html)
- configuration-cache: enable the config cache (https://docs.gradle.org/current/userguide/configuration_cache.html)
- configuration-cache.parallel: enable additional parallelization of the config cache (https://docs.gradle.org/current/userguide/configuration_cache_enabling.html#config_cache:usage:parallel)
- configureondemand: avoids configuring projects that aren't needed for a build (https://docs.gradle.org/current/userguide/configuration_on_demand.html)
- warning.mode: enabled all warnings, to catch problems before they become errors

These flags are pretty stable, but may cause issues with some use cases. For a simple mod project, they should all work fine and provide significant performance boosts.
It's possible to also enable isolated projects, but that is known to not be fully compatible with loom yet. It's also still incubating, and labeled as unsafe. (https://docs.gradle.org/current/userguide/isolated_projects.html)
this is required for configuration cache support
setting the root project name is preferred
as far as I know there's no reason to do this
no clue why this is here
this is more accurate to gradle's internal model, and allows a project to be scaled into a multiproject build more easily.
this is an official gradle best practice: https://docs.gradle.org/current/userguide/best_practices_dependencies.html#set_up_repositories_in_settings
it's expected that fabric loader and API are part of a mod's API surface
mod-publish-plugin is a much more modern method of publishing mods. it's config-cache compatible, and supports a lot more than just modrinth.
- publish and attest sources jars too
- run correct task to publish to modrinth
lets you run the workflow manually
it's not always making a release
@TropheusJ TropheusJ linked an issue Apr 7, 2026 that may be closed by this pull request
@sisby-folk
Copy link
Copy Markdown
Contributor

looks good - out of curiosity, why move the libs.versions.toml back to gradle/? outside it being the default, I always thought it was easier to work with and easier to recognize when it's in root.

@TropheusJ
Copy link
Copy Markdown
Member Author

I think it being the default is a pretty good reason. It's where others may expect it to be, and it doesn't teach people to assume something non-default.
I also think that putting it in gradle just makes sense because it's not tied to a specific project.

@sisby-folk sisby-folk merged commit 15d38b8 into ModFest:fabric-26.1 Apr 7, 2026
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Attest Build Provenance fails in PRs

2 participants