Skip to content

Hand SlimeLauncher the extracted metadata zip, cache extraction - #1084

Open
PaintNinja wants to merge 1 commit into
MinecraftForge:FG_7.0from
PaintNinja:7.0-provide-extracted-slimelauncher-metadata
Open

Hand SlimeLauncher the extracted metadata zip, cache extraction#1084
PaintNinja wants to merge 1 commit into
MinecraftForge:FG_7.0from
PaintNinja:7.0-provide-extracted-slimelauncher-metadata

Conversation

@PaintNinja

@PaintNinja PaintNinja commented Aug 18, 2026

Copy link
Copy Markdown
Contributor
  • Avoids needing to re-extract it every launch from SlimeLauncher's end
  • Zip extraction is now cached by Gradle's build cache feature across builds with the same metadata zip

I think this is the only task runs after configuration time that could be cached - if so, this PR also implements #993 as FG7 core now intentionally supports Gradle's Build Cache for this task.

- Avoids needing to re-extract it every launch from SlimeLauncher's end
- Zip extraction is now cached by Gradle's build cache feature across builds with the same metadata zip

@LexManos LexManos left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This would also need the ForgeDevPlugin side of things.

}
this.getFileSystemOperations().sync(spec -> {
spec.from(this.getArchiveOperations().zipTree(archive));
spec.into(outputDir);

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just for note, this technically causes the entire zip archive to be extracted to disc twice due to how zipTree is implemented in gradle. Once in their zipTree cache and then to the output directory.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is there another way that would be preferred over this?

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The old code extracts just the files needed, do file locking. Its a trade off of which part you care about. It would probably be worth doing a matching('launcher/') to emulate the filter we had before. But the metadata zip doesn't contain much in it.


protected abstract @InputFiles ConfigurableFileCollection getMetadata();
@PathSensitive(PathSensitivity.NONE)
protected abstract @InputFiles ConfigurableFileCollection getMetadataZip();

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is a breaking DSL change, i'd keep the property named getMetadata so that we don't have to worry about that.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement Enhances an existing feature in the codebase

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants