-
Notifications
You must be signed in to change notification settings - Fork 218
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
Update smithy-build to use NodeMapper #305
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.
if (arg.endsWith("#")) { | ||
traitNamespaces.add(arg.substring(0, arg.length() - 1)); | ||
} else if (arg.equals(Prelude.NAMESPACE)) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'll add a PR to master to emit a warning.
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.