in my gradle task I iterate through fileTree and all works good:
myTask {
fileTree("${project.projectDir}/dir").visit { FileVisitDetails details ->
exec {
//do some operations
}
}
}
but now I have different types of files in my directory:
dir
├── sub1
│ ├── file1.json
│ └── file2.js
├── sub2
│ ├── file1.json
│ └── file2.js
└── sub3
├── file1.js
└── file2.json
How to iterate for only certain type of files? Because
"${project.projectDir}/folder/dir/**/*.json"
doesnt work.
Thanks for any advice
fileTree("${project.projectDir}/dir/").matching { include "**/*.json" }.visit { FileVisitDetails details -> exec { //do some operations }
it works! :) Thanks for help – Perales