Bernhard Posselt
10/02/2024, 7:47 AMtasks.register<ValidateJsonFiles>("validateJsonFiles") {
files = listOf(
layout.projectDirectory.dir("data/recipes") to layout.projectDirectory.dir("schemas/recipes.json"),
layout.projectDirectory.dir("data/tasks") to layout.projectDirectory.dir("schemas/tasks.json"),
)
}
what property do I need to use on the task to correctly define inputs/ouptputs?Vampire
10/02/2024, 9:00 AMValidateJsonFiles is an own task and iirc, you should make a managed type like DirAndJson which has @InputDirectory on its dir property and @InputFile on its json property and then have files be a ListProperty<DirAndJson> that is annotated with @Nested.Vampire
10/02/2024, 9:00 AMBernhard Posselt
10/02/2024, 9:00 AMBernhard Posselt
10/02/2024, 9:01 AMVampire
10/02/2024, 9:01 AMDirAndJson instances for you, so that you can e. g. do setFiles(dir to file, dir2 to file2) and the setFiles method then creates the DirAndJson instances and adds them to the files listBernhard Posselt
10/02/2024, 9:02 AM