This extension can be used to change the rendering of the logs printed by the plugin.
Type | Name and description |
---|---|
org.gradle.api.Project |
project |
Constructor and description |
---|
LogsExtension
(org.gradle.api.Project project) |
Type Params | Return Type | Name and description |
---|---|---|
|
ReportUrlRenderer |
getReportUrlRenderer() |
|
void |
reportBaseUrl(java.lang.String newBaseUrl, java.lang.String localBaseUrl = "$project.buildDir/reports") This method provides a convenient way for creating a custom ReportUrlRenderer that will replace the base
url of each report in the logs with one of choice. |
|
void |
reportUrlRenderer(groovy.lang.Closure<java.lang.String> renderer) This method will create a new ReportUrlRenderer using the transformation closure provided.
|
Methods inherited from class | Name |
---|---|
class java.lang.Object |
java.lang.Object#wait(long, int), java.lang.Object#wait(long), java.lang.Object#wait(), java.lang.Object#equals(java.lang.Object), java.lang.Object#toString(), java.lang.Object#hashCode(), java.lang.Object#getClass(), java.lang.Object#notify(), java.lang.Object#notifyAll() |
This method provides a convenient way for creating a custom ReportUrlRenderer
that will replace the base
url of each report in the logs with one of choice. The target for the replacement by default is set to the
reports dir of the project, but can be changed if needed.
newBaseUrl
- the base url to be usedlocalBaseUrl
- optional, the local base url to be replaced with newBaseUrl
This method will create a new ReportUrlRenderer
using the transformation closure provided.
The closure will receive the report as File
and should provide a String
as output.
Here an example of custom renderer that will render report urls as markdown links (?!):
staticAnalysis { ... logs { reportUrlRenderer { report -> "[$report.name]($report.path)" } } }
renderer
- a closure that will transform a given File
into a String
Groovy Documentation