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

bindingFiles property is not working #5

Open felixsemmler opened 5 years ago

felixsemmler commented 5 years ago

bindingFiles property is always empty in https://github.com/bjornvester/xjc-gradle-plugin/blob/master/src/main/kotlin/com/github/bjornvester/xjc/XjcTask.kt

Example configuration: xjc { xsdDir = file("${projectDir}/src/main/resources/") bindingFiles = files("${projectDir}/src/main/resources/my-bindings.xjb") }

I fixed this locally by setting the bindingFiles property again in fun doCodeGeneration(): bindingFiles = getXjcExtension().bindingFiles Also changed class member bindingFiles from val to var for my test.

TweetyHH commented 5 years ago

I think it's a Problem with all FileCollections. We can't set the xsdFiles parameter. If we set only one xsd file here, it uses all xsd files (the default value).

Example: xjc { xsdFiles = (project.files(xsdDir.file("/xsd/abc/def.xsd")) }

We use Gradle 5.6.2 with Java 11