Add system for publishing and consuming ATs #146
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Currently, a limit of access transformers is that, if you wish to use a vanilla class you've ATed in a mod's API, every dependent must independently apply the AT in question. This PR offers a solution to this, that does not have the worries associated with it of "transitive ATs" or similar concepts, and is no less safe in terms of modders forgetting a
mods.toml
dependency than existingimplementation
dependencies are.Goals
Non-goals
fg.deobf
sucked and we don't want it back.To expose an AT file, a mod would do the following:
This publishes the AT file as a new variant of the project with the
accesstransformer
category.To consume the AT of a module requires an additional dependency on it beyond the normal
implementation
or the like:Note that the explicit need to declare a dependency on the access transformers of the module makes this no less safe, in terms of forgetting to declare a
mods.toml
dependency, than a normalimplementation
dependency on a mod and the use of its classes would; a mod cannot "accidentally" consume a foreign AT file.