Skip to content

0.5.5

Compare
Choose a tag to compare
@jamierocks jamierocks released this 07 Nov 13:03
· 81 commits to develop since this release
9d5bd9a

Writer configurations

Writer configurations are a powerful new feature that allows the output of
mappings writers to be fine-tuned as consumers would like. Currently, this
is limited to:

  • The sorting functions used to write mappings for classes, fields, and
    methods.
  • The API is open-ended, so there is potential for further additions to be
    made.

Writer configurations can be created fluently through use the provided
builder, which includes our default implementations.

protected MappingsWriterConfig config = MappingsWriterConfig.builder()
        .classMappingComparator(Comparator.comparing(Mapping::getFullObfuscatedName))
        .fieldMappingComparator(Comparator.comparing(Mapping::getFullObfuscatedName))
        .methodMappingComparator(Comparator.comparing(Mapping::getFullObfuscatedName))
        .build();

They are applied to a mappings writer by use of the new #setConfig method,
and can be retrieved through the corresponding #getConfig() method.

writer.setConfig(MappingsWriterConfig.builder().build());

Fixes

  • The Kin mapping writer now produces consistent output, sorting the
    mappings as per the provided comparators. Output is also now rid of 'junk'
    mappings (those without valid children mappings, or a de-obf mapping of
    their own).