How to implement reporting on a task?

Hi, I’m trying to implement a task that runs a custom unit testing framework, I would like to be able to create a testing report (similar to the ones generated by JUnit) and as well to be able to fail the build whenever the testing framework fails.

For this I have created the task class and implemented Reporting and VerificationTask interfaces. I’m looking at the implementation for the checkstyle task and the UnitTesting task to base my implementation, but both use several internal classes. So the question is, are there any documented guidelines for implementing reporting on a task?

Currently I’m trying to avoid using internal classes and as well get more insight on the reporting framework.

Thanks!

Hi Juan,

There’s currently no public API for the reporting stuff. It’s on the TODO list, but just hasn’t bubbled to the top. The interfaces are public though, just not the implementations. You’d be able to “copy” the internal implementations for the most part, as they themselves use public API.

Hi Luke,

Thanks for the answer, I will dive deeper on the code and solve the puzzle then. I would like to know though, if possible, what the current implementation of gradle does for me around Reporting so I don’t start with the wrong assumptions.

Thanks again!

The only strategic thing we use the “reporting system” for is the build dashboard plugin.

https://github.com/gradle/gradle/blob/master/subprojects/reporting/src/main/groovy/org/gradle/api/re…

Hi Luke,

Ok, thanks again for the insight! This is helpful!