FabricMC / fabric-loom

Gradle build system plugin used to automate the setup of a minecraft mod development environment.
MIT License
223 stars 194 forks source link

Download intermediary using Gradle #1042

Closed jpenilla closed 5 months ago

jpenilla commented 5 months ago

This gives us free caching and improved usability under offline mode.

modmuss50 commented 5 months ago

It seems all the test are broken :)

Whats the reasoning behind this change? Looms own downloader should be able to cache this just fine and handle offline mode. I do want to try and add an intergration test to provide offline works, I just dont have a good way to run loom without a working internet connection in CI.

jpenilla commented 5 months ago

The downloader's caching isn't being used as the destination is a temporary directory. In cases where we can't use Gradle's dependency resolution, the downloader's caching is great, i.e. Mojang's server/client.txt mappings. But for things that are available as artifacts on the Maven, I think it's better to use Gradle's built-in resolution. This way users can control the cache times, etc. through the standard Gradle mechanisms, and the cached artifacts can survive a loom cache rebuild.

modmuss50 commented 5 months ago

The downloader's caching isn't being used as the destination is a temporary directory.

Ah ok, yes thats the real issue here. Ideally everything that is downloaded via looms downloader wont be reset during a cache rebuild. Ill see if I can add a test for this in another PR.

At somepoint (likely loom 2.0) I want to remove getIntermediaryUrl from the extension, and replace it fully with the newer IntermediateMappingsProvider API, would save needing to have these two paths. For now what you have is ok.