gradle-git-versioning-plugin icon indicating copy to clipboard operation
gradle-git-versioning-plugin copied to clipboard

feat: move extra logging to info level

Open cklein-arcadia opened this issue 3 months ago • 1 comments

Currently the plugin prints out 5 separate log messages describing refs, configurations, versions, and describeTagFirstParent, plus a newline.

This is in addition to printing out the actual fully resolved version. The vast majority of the time this information is not valuable, but it gets printed even when running other gradle tasks (like compile!) in a project that uses this plugin.

This commit moves these messages to the info log level so they are not printed by default all the time, and instead only become visible if you add the --info (or higher) log level.

Example from my project's compileJava task before this change:

$ ./gradlew compileJava

> Configure project :
matching ref: TAG - 0.4.0-56c10c1
  ref configuration: TAG - pattern: .+
    version: ${ref}
    describeTagFirstParent: true

project version: 0.4.0-56c10c1

BUILD SUCCESSFUL in 882ms
4 actionable tasks: 4 up-to-date

Clearly this information is not relevant to users running the compileJava task.

And after this change:

$ ./gradlew compileJava

> Task :compileJava

BUILD SUCCESSFUL in 2s
4 actionable tasks: 1 executed, 3 up-to-date

And here's what it looks like when you run the version task:

$ ./gradlew :version

> Task :version
0.4.0-56c10c1

BUILD SUCCESSFUL in 522ms
1 actionable task: 1 executed

And

$ ./gradlew :version -q
0.4.0-56c10c1

cklein-arcadia avatar Aug 27 '25 21:08 cklein-arcadia