melix / jmh-gradle-plugin

Integrates the JMH benchmarking framework with Gradle
Apache License 2.0
676 stars 87 forks source link

Fix error message for unsupported Gradle versions #188

Closed joschi closed 3 years ago

joschi commented 3 years ago

Fix error message when the JMH Gradle plugin is being used with an unsupported version of Gradle.

As of version 0.6.4, the plugin only mentions Gradle 6+ as requirement, which makes the error message a bit unclear.

Example with Gradle 6.7.1:

* What went wrong:
An exception occurred applying plugin request [id: 'me.champeau.jmh', version: '0.6.4']
> Failed to apply plugin 'me.champeau.jmh'.
   > This version of the JMH Gradle plugin requires Gradle 6+, you are using 6.7.1. Please upgrade Gradle or use an older version of the plugin.

This PR is using the minimal Gradle version defined in JMHPlugin to build the error message and adds a functional test to verify the message is correct.

melix commented 3 years ago

Thank you!