Gradle 5.4.1. How to show a message whether an annotation processor creates files or not - preferable for my custom 'generateMappers' task

Courtesy of M.Ricciuti who answered my initial ‘Migrating from Gradle 4 to 5. How to get mapstruct working with it’ question.

Could NOT get it to work with the apt plugin but got it working with Gradle’s annotationProcessor.

I would like to have a Gradle ‘generateMappers’ task to generate the mapstruct source files AND display a message when the sources are generated and preferable one which tells me that nothing is generated because it wasn’t needed.

In the old situation we had a generateMappers task which used mapstruct to generate source files AND display a message when the files were created. Now its basically empty.

task generateMappers (type: JavaCompile, dependsOn: compileJava) {
        doFirst {
                println "\tGenerating mapper classes"

        doLast {
                println "\tMapping classes generated"

Gradlew -i generateMappers reveals the following. 
Skipping task '' as it has no source files and no previous output files. (Thread[Execution worker for ':' Thread 4,5,main]) completed. Took 0.0 secs.[enter link description here][1]
NOTE: > Task FROM-CACHE does trigger correctly ONLY when the sources are not there. 

By changing the task into ‘task generateMappers {…}’ I ALWAY get a message - even when no new files are generated because nothing has changed in the mappers. Gradlew --info reveals

> Task
Custom actions are attached to task ''.
Caching disabled for task '' because:
  Caching has not been enabled for the task
Task '' is not up-to-date because:
  Task has not declared any outputs despite executing actions.
        Generating mapper classes
        Mapping classes generated

Its wrong because caching is disabled and I know this is only cosmetic because whether the sources are there or not I will always get this message.

I’ve this feeling I’m on the WRONG track and I somehow have to hook into the annotationProcessor to get the required two messages BUT I also would like to have a seperate ‘generateMappers’ task to call. Any further hints/pointers is greatly appreciated.