Skip to content

Commit

Permalink
final cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
lkasso committed Dec 7, 2023
1 parent 87d938f commit ea81ee9
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -144,9 +144,12 @@ Gradle also provides integration with the Java Util Logging, Jakarta Commons Log
[[sec:changing_what_gradle_logs]]
== Changing what Gradle logs

WARNING: The <<configuration_cache.adoc#config_cache,configuration cache>> limits the ability to customize Gradle's logging UI.
[WARNING]
====
The <<configuration_cache.adoc#config_cache,configuration cache>> limits the ability to customize Gradle's logging UI.
The custom logger can only implement <<configuration_cache.adoc#config_cache:requirements:build_listeners,supported listener interfaces>>.
These interfaces do not receive events when the configuration cache entry is reused, because the whole configuration phase is skipped.
====

You can replace much of Gradle's logging UI with your own. You might do this, for example, if you want to customize the UI in some way - to log more or less information, or to change the formatting. You replace the logging using the link:{groovyDslPath}/org.gradle.api.invocation.Gradle.html#org.gradle.api.invocation.Gradle:useLogger(java.lang.Object)[Gradle.useLogger(java.lang.Object)] method. This is accessible from a build script, or an init script, or via the embedding API. Note that this completely disables Gradle's default output. Below is an example init script which changes how task execution and build completion is logged.

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ include::sample[dir="snippets/tasks/defineAsKotlinDelegatedProperty/groovy",file
[WARNING]
====
If you look at the API of the _tasks_ container you may notice that there are additional methods to _create_ tasks.
*The use of these methods is discouraged* and will be deprecated in future versions.
The use of these methods is discouraged and will be deprecated in future versions.
These methods only exist for backward compatibility as they were introduced before <<task_configuration_avoidance#task_configuration_avoidance,task configuration avoidance>> was added to Gradle.
====
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -361,7 +361,8 @@ task anEagerTask {

This section describes two ways to keep your plugin backward compatible with older version of Gradle if you must maintain compatibility with versions of Gradle older than 4.9. Most of the new API methods are available starting with Gradle 4.9.

NOTE: Although backward compatibility is good for users, we still recommended to upgrade to newer Gradle releases in a timely manner. This will reduce your maintenance burden.
NOTE: Although backward compatibility is good for users, we still recommended to upgrade to newer Gradle releases in a timely manner.
This will reduce your maintenance burden.

The first method to maintain compatibility is to compile your plugin against the Gradle 4.9 API and conditionally call the right APIs with Groovy (https://github.com/melix/jmh-gradle-plugin/blob/a034aa88805b7a06fa9c5a825d573554b2aa23e2/src/main/groovy/me/champeau/gradle/JMHPlugin.groovy#L289-L296[example]).

Expand Down

0 comments on commit ea81ee9

Please sign in to comment.