properties for common rdl generation options
boynton opened this issue · comments
The rdl command supports a few options that should be specifiable from the pom file as plugin properties:
--ns namespace Use the specified namespace for code generation. Default is to use the namespace in the schema.
-b path Specify the base path of the URL for server and client generators.
The "--ns com.yahoo.rdl.example" option has the same effect as specifying 'namespace com.yahoo.rdl.example' in the RDL source file, but is preferred, as such a namespace is specific to the java generator (it will never be shared with the Go generator, for example, which has different rules for its package names).
Yep, I can take a look at this. Right now the command run is
rdl generate -o <targetFolder> (java-model|java-server) <rdlFile>
Rather than duplicating these new options (--ns
and -b
) in the java, what about just having one plugin property that allows complete control of the commands? The default value would be this:
<configuration>
<commands>
<command>%{rdlBin} generate -o %{generatedResourcesDirectory} java-model %{rdlFile}</command>
<command>%{rdlBin} generate -o %{generatedResourcesDirectory} java-server %{rdlFile}</command>
</commands>
</configuration>
Substitution would be done by StrSubstitutor, except configured to use %
instead of $
as the prefix and escape character, to avoid conflicts with maven properties.
That would work. With the bonus of allowing client generation, too.