Don't add generated folder to srcDirs
mfulgo opened this issue · comments
What I ultimately want is to add the generated files to version control so I can track differences in the files over time and customize the classes.
In an earlier version of the plugin, there was the option to output the generated files to a specified folder. That was removed, and now the generated files always go to build/generated/wsdl
. The plugin now also adds that folder to the main Java source sets: https://github.com/nilsmagnus/wsdl2java/blob/master/src/main/groovy/no/nils/wsdl2java/Wsdl2JavaPlugin.groovy#L77
However, build
directories are generally ephemeral and ignored by git. This means that I have to create a gradle task to copy over the generated files to something like src/main/java-generated
and add that to my source sets. But, adding it to the source sets then causes problems because unless I remove the build/generated/wsdl
directory, there are duplicated classes.
So, I can see three ways of resolving this:
- Re-add the option to specify the output directory and keep the line that adds the output directory to the source sets. Or...
- Don't add the output directory to source sets and require the plugin user to move the files around and add the desired director to the source sets on their own. Or...
- Re-add the option to specify the output directory and get rid of the line that adds the output directory to the source sets.