Skip to content

Update gradle build to support new gradle features + use configuration cache #1611

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Draft
wants to merge 11 commits into
base: nightly
Choose a base branch
from

Conversation

DasBabyPixel
Copy link
Contributor

@DasBabyPixel DasBabyPixel commented Apr 17, 2025

Motivation

I wanna be able to build this on my laptop without waiting for us to collide with the andromeda galaxy.
Also the build task did not properly build everything. You need to call build shadowJar atm.

Modification

  • Removed many overlapping task outputs by specifying the exact task instead of using withType<Jar>(). The overlaps were mainly caused by shadowJar and jar, which always makes them not up-to-date, slowing down the build.
  • Enabled configuration cache
  • Removed all usages of subprojects and allprojects. The equivalent is now in build-extensions using the gradle lifecycle allprojects and then filtering for project paths.
  • Added develocity plugin + automatic build scans (only if file gradle.tos.agree exists)
  • Updated shadow plugin to `9.0.0-beta12. I needed this to make my life easier
  • Enabled Configuration on Demand
  • Started to move towards support for Isolated Projects be removing usage of shared mutable state, and instead using a supported alternative, like consumable configurations
  • Fixed task execution, build now actually builds everything. To be more precise: assemble builds everything, build is assemble + all tests/checks
  • A lot of decoupling. This should help to increase the amount of work gradle can to parallel, decreasing build time.
  • Moved exportCnlFile and exportLanguageFileInformation into tasks
  • use .configureEach everywhere to make task configuration lazy

Remaining work

Result

Overall better build performance and no more deprecated features used.

@derklaro
Copy link
Member

while we're at it anyway, can we ignore the scaffold projects from deployment too? e.g. for the wrapper, only the wrapper-api and wrapper-impl projects should be published, but not the "glue" wrapper module.

@DasBabyPixel
Copy link
Contributor Author

Yes, I can change that! Still waiting on indra... Unless we create/publish a fork just for that 1 line...

@DasBabyPixel
Copy link
Contributor Author

Correction: Apparantly indra v4 should already be configuration cache compatible.
I'll try later to move to indra v4 published to
https://repo.stellardrift.ca/maven/#/snapshots/net/kyori/indra-git/4.0.0-SNAPSHOT
https://github.com/KyoriPowered/indra/blob/c43317c8f5f5d73e50cce414b2be3c6a6c8100e7/build.gradle#L98C41-L98C91

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.

2 participants