bjornvester / xjc-gradle-plugin

A Gradle plugin for running the XJC binding compiler to generate JAXB Java source code from XSD schemas
MIT License
59 stars 10 forks source link

Add an option to change the source set of the generated code #37

Open tacascer opened 9 months ago

tacascer commented 9 months ago

Currently the default xjc task is created and its output is added to the main SourceSet.

I have a project that only generates code for the test SourceSet. Ideally I would like the ability to switch the source set of the generated code.

It seems like the main SourceSet is being hard-coded to be added to here

snicoll commented 4 months ago

We're facing the same issue and we only use schema in tests. As the plugin we were using previously does not seem to be supported anymore, we've migrated to this one with a workaround.

It would be nice to have a task for both the source and the test and be able to disable any of them.

snicoll commented 3 months ago

FTR the workaround broke support in Eclipse so we're looking at a different way of handling this.

@bjornvester any appetite to update the plugin to offer a main and a test tasks?

sbrannen commented 3 months ago

FTR the workaround broke support in Eclipse so we're looking at a different way of handling this.

This was the second workaround that we came up with which also allows our projects to be imported into Eclipse IDE: https://github.com/spring-projects/spring-framework/commit/5aa38833dddf427c3d702930bf1678a126806191

@bjornvester any appetite to update the plugin to offer a main and a test tasks?

@bjornvester, that would be awesome if you would implement that! 😎