* Add test for #801
* Add test for #572
* Rewrite mod configuration remapping internals to fix bugs
Fixes#801. Fixes#572.
- Instead of individual mod configs getting remapped, Loom now remaps
"collector configs": `mod[Compile/Runtime]Classpath[source set name]`
(eg `modRuntimeClasspathMain` -> `modRuntimeClasspathMainRemapped`)
- This lets us use Gradle's `org.gradle.usage` attributes to select
whether it's a compile-time or runtime dependency
- Note: Remap configurations sourcing from `api` are partially left
intact due to their special logic in the `namedElements` configuration.
- Setting the proper usages fixes#801.
- No dependency files are added to the real target configurations
(like `api` and `implementation`) anymore.
- This fixes#572, since `runtimeClasspath` and `compileClasspath` don't
leak transitive dependencies unlike `implementation` etc.
* Fix checkstyle
* Fix split env dependency consumers
* Only use collector configs for remapped deps and let the inputs stay intact
This way the code has less duplication.
* Improve log messages
* Update year
* Add some comments
* Fix compilation
* Use LinkedHashMap for reliable iteration order through remapped configs
* Use ImmutableMap.of instead of Map.of for reliable ordering
* ModConfigurationRemapper: Move namedElements handling out of forEach
* Add regression test for a crash where loader is resolved after other mods
* Fix the aforementioned bug
* Rename InstallerDataTest -> DependencyOrderTest
* Add TODO about refresh dependencies
The code currently processes the same deps multiple times when
--refresh-dependencies/-Dloom.refresh=true/a cache invalidation
is applied.
Co-authored-by: modmuss50 <modmuss50@gmail.com>