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

Documentation: xsdFiles not supported #31

Open enqueue opened 1 year ago

enqueue commented 1 year ago

The README section about which files to generate schemas for is outdated, i.e. it refers to the xsdFiles. Instead, this should probably be migrated to the includes property.

nathanclayton commented 1 year ago

Also, the includes property needs to take a collection of Strings, no more collections of file objects, so you need to do something like this (in Groovy):

var fileList = xjc.xsdDir.asFileTree.matching { include("**/*.xsd") }.getFiles().parallelStream().map { inFile -> inFile::getName() }.collect(Collectors.toList())
xjc {
    includes.set(fileList)
    xjcVersion.set('3.0.1')
    bindingFiles = project.files(xsdDir.file('site-template.xjb'))
}