-
Notifications
You must be signed in to change notification settings - Fork 68
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
Support multiple invocations? #3
Comments
I understand that the plug in itself may not be configurable enough to define all the options necessary for non-java code however I think it should be possible to invoke the compiler multiple times using standard maven syntax. What is it that you are trying to do? |
I apologize, I didn't realize that I could configure two Maven executions of the same plugin
Running with cpp (whether alone or in addition to the java generation) results
... looking at the code, the Thrift class assumes that the generated source is placed in "gen-java". Can I suggest that the outputDirectory be made configurable and passed to the thrift compiler? |
Clarification: outputDirectory is indeed configurable, but the method Thrift.moveGeneratedFiles() assumes genDir to be outputDirectory/GENERATED_JAVA. |
Doh, markdown hijacked my last sentence. I meant to say: perhaps it would be safe to assume a convention of outputDirectory + generator for the genDir? |
Turned out the issue was some file deletes and moves that assume only a single run for one generator configuration. I forked and committed some tweaks that allowed me to successfully run multiple executions and retain all generated source: 19dd708 |
I have reviewed your fixes. That said I agree that, the moving files "solution" was a hack, I am trying to think of a better solution, one option may be to have two directories: Working directory - Where the thrift compiler outputs to. Instead of cleaning and moving at two points in the cycle we could just delete the output directory and overwrite with the entire contents of the workingdir/gen-java Three questions: PS I know that this sounds a bit convoluted but I am trying not to break anyone who is already using the plug-in. |
Some notes: I added two boolean configuration flags:
The behavior for each invocation is:
Would you mind reviewing, in particular to see if there's any obvious impact to other use cases? If the changes are reasonable, there would need to be some more cleanup (JavaDoc etc.) to reflect the broader usage beyond Java-only generation. |
Here is some sample config for two runs:
|
This would be nice to have |
Feature suggestion: it would be cool if it were possible to have multiple invocations of the thrift compiler, varying the param in order to generate source for multiple languages.
The text was updated successfully, but these errors were encountered: