-
Notifications
You must be signed in to change notification settings - Fork 125
Mustachio: Add getProperty(), and end-to-end Renderer test #2442
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
Conversation
…test This includes some unorthodox tests: I've added a package in `testing/mustachio`, complete with a pubspec.yaml and a build.yaml. These are required in order to test the runtime behavior of generated code; in order to make assertions on the generated code (not its String content, but its runtime properties), it must be generated with public classes (the default is private). In order to pass a configuration to the Builder, I need a build.yaml separate from dartdoc's. In order to import `testing/mustachio/lib/foo.renderers.dart`, and resolve that library's reference to `package:testing_mustachio/foo.dart`, I need to add `testing_mustachio` to `dev_dependencies`. In order to reference the builders from the testing package, the builder code needed to move from `tool/mustachio/` to `lib/src/mustachio/`. The generated code now always references the library that generated it, on the assumption that it needs types from that file. This is not necessarily correct, but is a decent approximation until we start using code_builder. RendererBase now needs to know about the renderer of the parent context type, so it gets a new field. Property and each renderer's propertyMap gets corrected code; the runtime tests revealed some runtime type bugs.
@jcollins-g what do you think about the try-publish failure? Moving the builder to lib/ would necessitate (?) that |
@jcollins-g OK I think I've got this working; I've added a second build target in build.yaml which builds testing code. build_runner refused to generate any files in |
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.
Approved assuming that a rebuilding check for foo.dart is added.
The generated code now always references the library that generated it, on the
assumption that it needs types from that file. This is not necessarily correct,
but is a decent approximation until we start using code_builder.
RendererBase now needs to know about the renderer of the parent context type,
so it gets a new field.
Property and each renderer's propertyMap gets corrected code; the runtime tests
revealed some runtime type bugs.