Defining Inputs and Outputs for a Test task

I’m defining a test task in a custom plugin… this is using basic Gradle tasks, not custom task classes. I have some specialized integration tests that I run using Spock, and Spock has some shared declarations that call custom methods to generate and arrange files for the @Unroll portion of the Spock specification.

Within a plugin, I can’t seem to figure out how to define directories as Outputs such that the directories will be created when they need to be, and cleaned as part of the clean task rule that’s a part of the Base Plugin. If this were a custom task class… I’d use the annotations @OutputDirectory and @OutputFile. Can I use something else inside a defined task in a custom plugin?