Merged
Conversation
The NodeMapper is now used to load smithy-build.json configuration files, reducing the boilerplate needed to deserialize it (and the error-prone need to manually update the deserialization code as things are added to the POJOs). The #toNode methods and methods were removed from the build/model/* classes for the same reasons. An explicit POJO that defines the format of smithy-build-info.json files was added, and the NodeMapper is now used to serialize it. This should give the format a well-defined structure and allow other tools to properly deserialize it too. Finally, a ConfigurableSmithyBuildPlugin abstract class was added that makes it easier to add NodeMapper deserialization into a plugin specific configuration POJO. Most plugins will ultimately extend from this class and get deserialization for free.
9458ed0 to
5608d3a
Compare
This commit updates smithy-build so that model transformations accept
an object of configuration values rather than just a list of strings.
This makes transformers far more powerful and configurable. In order to
maintain backward compatibility with existing smithy-build.json files,
an array of strings provided for a transformer is automatically
transformed into `{"__args": [X]}` where "X" is the original array of
arguments.
kstich
approved these changes
Mar 9, 2020
| if (arg.endsWith("#")) { | ||
| traitNamespaces.add(arg.substring(0, arg.length() - 1)); | ||
| } else if (arg.equals(Prelude.NAMESPACE)) { |
Contributor
There was a problem hiding this comment.
This seems like a pretty rare case to run in to, but calling out that we're removing this without having deprecated it in 0.9.x.
Member
Author
There was a problem hiding this comment.
I'll add a PR to master to emit a warning.
mtdowling
added a commit
that referenced
this pull request
Mar 9, 2020
mtdowling
added a commit
that referenced
this pull request
Mar 9, 2020
Merged
This file contains hidden or 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
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.
Update smithy-build to use NodeMapper
Adds support for more build transform options
By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.