Skip to content
forked from CadixDev/Mercury

A source transformation and -remapping framework for Java.

License

Notifications You must be signed in to change notification settings

FabricMC/Mercury

 
 

Repository files navigation

Mercury

Mercury is a source code transformation library for Java codebases, with an included remapper - built on Eclipse's JDT and [tiny-remapper]. Mercury is licensed under the Eclipse Public License 2.0.

While Mercury is used by the following projects:

Usage

Mercury is centred around the Mercury class, which is the effective control centre. See the following example, for a demonstration of remapping a codebase using Lorenz.

final Mercury mercury = new Mercury();

// Due to the nature of how mercury works, it is essential that we have
// the full binary classpath.
mercury.getClassPath().add(Paths.get("example.jar"));

// To remap the codebase using Lorenz, we must install a MercuryRemapper,
// with our MappingSet.
mercury.getProcessors().add(MercuryRemapper.create(mappings));

// Lets rewrite our codebase at "a/" to "b/".
mercury.rewrite(Paths.get("a"), Paths.get("b"));

See Also

There is beginning to be tooling designed to work with Mercury, these may be helpful in your project:

Discuss

Found an issue with Mercury? Make an issue! We'd rather close invalid reports than have bugs go unreported :)

We have an IRC channel on EsperNet, #cadix, which is available for all registered users to join and discuss Mercury and other Cadix projects.

About

A source transformation and -remapping framework for Java.

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • Java 100.0%