Skip to content
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

Multi metadata processing #12

Open
wants to merge 6 commits into
base: main
Choose a base branch
from

Conversation

Kneelawk
Copy link
Contributor

@Kneelawk Kneelawk commented May 3, 2022

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:

  • The multi-metadata JIJ functionality and found that it works correctly.
  • 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.)
  • Ignoring a metadata kind for dependencies.
  • Interface injectors respect the proper metadata.
  • Remapping of different mixins for different metadata kinds still works.
  • 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]

This also separates the metadata configuration of the project from the metadata configuration of the project's dependencies
@Kneelawk
Copy link
Contributor Author

Kneelawk commented May 3, 2022

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

@Kneelawk Kneelawk marked this pull request as ready for review May 3, 2022 06:16
@Kneelawk
Copy link
Contributor Author

Kneelawk commented May 3, 2022

This will need to be squashed like the last PR.

@Kneelawk
Copy link
Contributor Author

Kneelawk commented May 3, 2022

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
Copy link
Contributor Author

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

@Kneelawk
Copy link
Contributor Author

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

@TheGlitch76
Copy link
Member

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.

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