Add TestGenerateMojo to the akka-grpc-maven-plugin#1100
Conversation
* Refactor common code to AbstractGenerateMojo * Introduce TestGenerateMojo including plugin.xml addition * Introduce new parameter 'outputDirectory' for both GenerateMojo and TestGenerateMojo
|
Hi @samantmaharaj, Thank you for your contribution! We really value the time you've taken to put this together. Before we proceed with reviewing this pull request, please sign the Lightbend Contributors License Agreement: |
|
Thank you for your pull request! After a quick sanity check one of the team will reply with 'OK TO TEST' to kick off our automated validation on Jenkins. This compiles the project, runs the tests, and checks for things like binary compatibility and source code formatting. When two team members have also manually reviewed and (perhaps after asking for some amendments) accepted your contribution, it should be good to be merged. For more details about our contributing process, check out CONTRIBUTING.md - and feel free to ask! |
|
OK TO TEST |
raboof
left a comment
There was a problem hiding this comment.
Thanks for the contribution! This mostly LGTM, though it's a shame about the duplication on the XML side. Should we look into other code-generating plugins and see if they have some clever solution for this? Or is this just a limitation of maven?
| <generatorSettings implementation="java.util.List" default-value=""/> | ||
| <extraGenerators implementation="java.util.List" default-value=""/> | ||
| <protoPaths default-value="src/test/proto,src/test/protobuf">${akka-grpc.protoPaths}</protoPaths> | ||
| <outputDirectory default-value="target/generated-test-sources">${akka-grpc.outputDirectory}</outputDirectory> |
There was a problem hiding this comment.
Hmm, that's quite some duplication.
Is this the way other code-generating plugins do it as well?
There was a problem hiding this comment.
If you develop using maven, the plugin.xml is generated based on annotations in the code so it's not a problem that normally comes up as you don't need to maintain it.
I could factor the common XML out and use a templating tool but I'm not that familiar with SBT so I'd appreciate some help on how to do it.
There was a problem hiding this comment.
Aah makes sense. Adding templating would be possible for example with sbt-twirl, but to be honest I'm not sure the added complexity is worth it. Let's live with the duplication for now ;)
| import javax.inject.Inject | ||
| import org.sonatype.plexus.build.incremental.BuildContext | ||
|
|
||
| class TestGenerateMojo @Inject() (buildContext: BuildContext) extends AbstractGenerateMojo(buildContext) { |
References #1099