-
Notifications
You must be signed in to change notification settings - Fork 11
Make it possible to configure schemaDir #5
Comments
I've been meaning to add a convention object, but time has not allowed it. Think it would be easy to add just to be able to change the schemaDir. Not sure how it would work with the dynamic nature of the source sets. JaxbSourceDirectory is not a normal plugin convention as one is created for each source set. So it is more a convention object for each JAXB source drectory set. So a plugin convention would be a new object :-) Good point about changing the default from jaxb to xsd. A little narrowminded of me. That, at least, is a very easy fix. |
I have been able to work around the issue by adding this code to my build:
project.convention.plugins.java.sourceSets.all { SourceSet sourceSet ->
sourceSet.jaxb { srcDir 'src/main/xsd' }
}
Maybe something like this be nice to have?
sourceSets {
main {
xsd { srcDir 'src/main/xsd' }
}
}
|
I'm afraid your
Here you have 3 source sets which normally has 3 schema source directory sets:
If you had applied your But you can actually change the directory properly for multiple source sets with the current version of the plugin, just like what
So when this issue is closed, the previous code block will be the standard setup, that is, the directory for the schemas will be |
Regarding your wish for this:
I think this is better:
As it is a source directory set for the JAXB plugin, it is better to name it |
Changing the default source directory to .../xsd is moved into its own issue. Then the rest of this issue is solved by using the options available in source sets as shown in previous comments. |
Currently the schemaDir is hard coded to "src/${sourceSet.name}/jaxb". Request to allow the default to be changed via a plugin convention object.
I took a look at the source code and it seems the plugin does define a convention object but the name of the object, JaxbSourceDirectory, does not lend itself to extension. I would be happy to create a patch if you felt like it was OK to rename the convention object perhaps to JaxbPluginConvention?
Also, please consider changing the default from "src/${sourceSet.name}/jaxb" to "src/${sourceSet.name}/xsd". This might be more appropriate because there could be other uses for these schemas other than just JAXB code generation.
The text was updated successfully, but these errors were encountered: