|
Re: Code generator conditional behaviour [message #1797292 is a reply to message #1797002] |
Mon, 29 October 2018 15:24 |
|
There are many ways to solve that. At the end, the generator is "just" a Java program and you need to pass the property from Gradle through the main program to the template.
It highly depends on how the generator was implemented. Can't you ask the person from whom you inherited? Without knowing your project we can't give you concrete hints. However, it is possible to get remote support from us if needed.
|
|
|
|
Re: Code generator conditional behaviour [message #1797298 is a reply to message #1797295] |
Mon, 29 October 2018 15:52 |
|
Your generator is invoked with a main method. You can either pass the args to that and pass them through to the template, e.g. by an injectable context object, or - simple, ugly, but effective - pass it as a system arg. Within doGenerator you can of course access these system props. In my projects I prefer to explicitly create a proper CLI for the generator's entry point, parse the arguments and make them accessible by the templates by either the generator's context or by an injectable config singleton configured by the generator's argument in a custom Guice module. It will be easier for you to go the system args way.
|
|
|
|
|
Powered by
FUDForum. Page generated in 0.03311 seconds