Closed pgalbraith closed 8 months ago
Hi
Maybe something like
fileFilter = file -> file.path.endsWith('.json')
would do the trick ?
Thanks @unkish ... I finally figured it was failing because it's walking the entire tree and the lambda was returning false for the parent directory and thus not even looking at the schema files. This value of fileFilter
does the trick:
fileFilter = { it.isDirectory() || it.name.endsWith('.json') }
I just want the gradle plugin to process
*.json
schema files and ignore anything that's not*.json
. This is proving to be very difficult, however. I don't doubt that this is just lack of awareness on my part to make it work correctly, but I'm really struggling to makefileFilter
work.Looking at the documentation (https://github.com/joelittlejohn/jsonschema2pojo/tree/master/jsonschema2pojo-gradle-plugin#usage) it suggests I can apply the default filter with
fileFilter = new AllFileFilter()
. However, trying that verbatim yields a build errorunable to resolve class AllFileFilter
.I get the same error if I fully qualify the filter,
fileFilter = new org.jsonschema2pojo.AllFileFilter()
:unable to resolve class org.json2schema2pojo.AllFileFilter
.What I really want is to be able to specify a custom filter ala
fileFilter = { it.name.endsWith('.json') }
but I just can't seem to get anything to work. Would it possible to show a working example of a fileFilter defined in a gradle script?