quilt-loom icon indicating copy to clipboard operation
quilt-loom copied to clipboard

Multi metadata processing

Open Kneelawk opened this issue 2 years ago • 6 comments

This PR

This pull-request adds support for processing of multiple metadata kinds in the same project as well as fixing interface injectors, which did not function with multiple metadata kinds present before.

Changes to API

This changes the existing quilt-loom api in one breaking way: the metadataPriorities block has been renamed to metadataConfig.

This also adds a new configuration block, dependencyMetadataConfig that allows users to configure processing of dependencies' metadata separately from that of their own project's metadata.

In both of these blocks, a new method ignore has been added, that disables processing of the given metadata type.

loom {
    metadataConfig {
        ignore("fabric.mod.json")
    }

    dependencyMetadataConfig {
        priority("quilt.mod.json", 5)
    }
}

Features Added

  • Both quilt.mod.json and fabric.mod.json files are processed and receive Jar-In-Jar information when remapping, even when both are present in the same project.
  • Mixins reference in both quilt.mod.json and fabric.mod.json files are processed and have refmap references added when remapping, even when both quilt.mod.json and fabric.mod.json are present in the same project.

Things Fixed

  • Interface injectors now apply, even when both kinds of metadata are present in a project or dependency. Currently interface injectors are only applied from the highest priority metadata kind, as I cannot see a use case for applying interface injectors from multiple metadata files.

Testing

I have tested this in my own mod projects. So far I have tested:

  • [x] The multi-metadata JIJ functionality and found that it works correctly.
  • [x] Ignoring a metadata kind in a project and making sure it only applies to the project and not its dependencies.
  • ~~[ ] Setting the priority of a metadata kind for dependencies.~~ (I am not sure what I can use to test this one.)
  • [x] Ignoring a metadata kind for dependencies.
  • [x] Interface injectors respect the proper metadata.
  • [x] Remapping of different mixins for different metadata kinds still works.
  • [x] Remapping of different access wideners from different metadata kinds.

Things Left To Do

~~I would like to also add remapping of multiple metadatas' mixins when the metadatas use different mixins.~~ [Done]

Kneelawk avatar May 03 '22 01:05 Kneelawk

From what I can tell, the main thing dependency metadata is used for is applying transitive access wideners.

Kneelawk avatar May 03 '22 01:05 Kneelawk

This will need to be squashed like the last PR.

Kneelawk avatar May 03 '22 06:05 Kneelawk

I just noticed that in projects with multiple metadata kinds, if the different metadata kinds reference different access widener files, then only the access widener from the highest-priority metadata will be remaped.

I can fix this in the morning if you need me to.

Kneelawk avatar May 03 '22 06:05 Kneelawk

Ok, I've added the ability to remap different accesswideners from quilt.mod.json and fabric.mod.json metadata files.

Kneelawk avatar May 16 '22 17:05 Kneelawk

I am not sure how to go about rebasing this onto the latest commit.

Kneelawk avatar May 16 '22 18:05 Kneelawk

I am not sure how to go about rebasing this onto the latest commit.

That's okay; I will handle it locally when i get a chance to review this PR.

TheGlitch76 avatar May 19 '22 01:05 TheGlitch76