Is it possible to rename the XML files created when running JUnit?

We migrated from Ant to Gradle; we used to be able to use a formatter in the junit ant task that allowed us (among other things) to add a suffix to all the result XML files created from the tests.

Is there a way to do that in Gradle; is there a hook in the API to provide a formatter? And if not, is there a way to just rename the files on the fly?

I know we can use the ant.junit task within Gradle, but we would rather stick with the native Gradle test task if possible…

1 Like

It’s possible to configure the destination directory but not the names of the XML files. If you need the latter, you’ll have to rename them yourself, perhaps in a ‘test.doLast { … }’.

That’s what I thought, and that’s what’s we ended up doing; thanks for the reply.