-
-
Notifications
You must be signed in to change notification settings - Fork 7
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
Lorenz 0.6.0 #47
Open
jamierocks
wants to merge
64
commits into
master
Choose a base branch
from
develop
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Lorenz 0.6.0 #47
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Fabric don't have 'none/' in their mappings.
I want to get our repositories in shape, to accept contributions during Hacktoberfest - though this should have been included here a long time ago...
Signed-off-by: Jamie Mansfield <[email protected]>
Closes GH-27. Signed-off-by: Jamie Mansfield <[email protected]>
Signed-off-by: Jamie Mansfield <[email protected]>
Signed-off-by: Jamie Mansfield <[email protected]>
This will prevent any collision with another JSON implementation, if 2 need to be in the environment for some reason. Signed-off-by: Jamie Mansfield <[email protected]>
This isn't needed and will cause issues if the output is longer than the buffer can handle. Signed-off-by: Jadon Fowler <[email protected]>
for reversing and merging. Fixes GH-34. Co-authored-by: Jamie Mansfield <[email protected]>
In both InnerClassMapping and TopLevelClassMapping the merge methods are implemented by looping over the members of the left side and merging the value with the members on the right side. This properly handles both new mappings provided by the left side, and mappings provided by both sides. The only part it leaves out is new mappings provided by the right side. This commit accomplishes this by keeping track of the mappings which have already been seen with HashSets during the iteration over the left members, and then only applying new mappings from the right by iterating over the right side and ignoring mappings we've already seen. Since this commit now uses the hashCode methods, I also found a recursive hashCode bug due to members trying to get the hashCode of classes which contain said member. I fixed this by instead just hashing the parent's names.
Currently the Enigma module is the only mapping format to make use of this new API. I have also corrected the standard file extension reported by the Enigma mapping format - to "mapping".
<3 Spock
I have ported those tests to Spock/Groovy, and they now perform the copy/reverse operation directly on the class/field/method/etc. This means that we don't need to perform all the tests in one horrible chunk of code.
Theres a few things I've identified that need to be looked into: - Generic bounds in both the mapping model and Groovy DSL - Removing usage of the Groovy DSL in the standard Lorenz tests - Splitting up the Groovy DSL unit test
This isn't a complete test, field mapping handling should be added, members that are private/protected/etc should be tested, and tests to handle b4cb5bf should be added.
Kashike told me a while back this was no longer needed.
This was (to my knowledge) only used by Survey - but was a non-standard mapping format, its place isn't in Lorenz in any case.
Though we may decide to change this somewhat in the future, this is a good step to clean up the ever-growing directory listing. With the commit, changelogs for published versions reside in 'changelogs/x.y/x.y.z.md'. Currently work-in-progress versions still sit within `changelogs` - this is just to promote the approriate and current changelog.
This should make it easier to support the rest of Fabric's changes.
In short, they don't write out the fully-qualified class name - just the class' name. In practise, this just affects inner classes.
In short, they don't write out the fully-qualified class name - just the class' name. In practise, this just affects inner classes.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Groovy DSL
Lorenz now has a Groovy DSL, that simplifies the creation of mappings.
To use the Groovy DSL, simply add
org.cadixdev:lorenz-dsl-groovy:0.6.0
to your buildtool.
ASM Module
Inline with changes made in Bombe 0.4.0, the ASM package is no more - with both classes
now available under the same package in the core Lorenz module.
Enigma Module
The Enigma mapping format no longer erroneously reports the standard file extension as
being "enigma", but rather the standard (as set by cuchaz's mapping project, and continued
by the Fabric Project) "mapping". The former file extension is included as a supported file
extension with the new multiple file extension functionality (detailed below).
Additionally, we now have support for reading/writing Fabric's fork of the format (which
merely differs by usage of the
none/
prefix) - registered asfabric-engima
.Mapping Formats
Registration
Mapping Formats are still registered by use of service loaders, populating a registry in
MappingFormats
- however their registration key (identifier) is now more explicit, andformats are able to provide a name. Implementations must now provide the following:
File extensions
Mapping Formats can now specify multiple file extensions that are typical, this will allow
tools such as Symphony and Nocturne to give richer (and more useful) file choice dialogs.
Miscellaneous
tools, for example, to only show supported formats in a file save or file read dialog.
Conveniences
Mapping#set(key, value)
now returns theMapping
allowing for fluent method calls.Mapping
s are now observable, throughMapping#addListener(MappingChangedListener)
.