[html checking plugin] how to copy required css to output directory?

My htmlSanityCheck plugin produces a html result file.

How can I copy the appropriate css stylesheet (that I maintain in my plugin project) into the target directory?


There is not gradle api for doing this at the moment, so you have to deal with this in plain java/groovy.

Stackoverflow has plenty of examples for this. For example have a look at http://stackoverflow.com/questions/10308221/how-to-copy-file-inside-jar-to-outside-the-jar

cheers, René

In the gradle codebase itself we’re doing this too. Have a look at https://github.com/gradle/gradle/blob/master/subprojects/performance/src/testFixtures/groovy/org/gradle/performance/results/ReportGenerator.java#L50-50 for an example.

You should be able to reuse GFileUtils#copyURLToFile that is part of the Gradle codebase.

hope that helps, cheers, René

René, thank you so much - exactly what I was looking for!!

you’re awesome :slight_smile: