melix / jmh-gradle-plugin

Integrates the JMH benchmarking framework with Gradle
Apache License 2.0
659 stars 88 forks source link

Infer task default tools from the project toolchain (if available) #228

Closed TheMrMilchmann closed 1 year ago

TheMrMilchmann commented 1 year ago

This change adjusts the plugin to infer java tools (specifically, the launcher and compiler) for the plugin's tasks from the project toolchain (if available). Currently, the tools from the Java version used to run Gradle are used. This is usually not desired when configuring toolchains. Although the tasks can be configured to use the toolchain in user code, this is unintuitive and easily overlooked. (See also #218.) Thus, I believe that the behavior introduced in this PR is a more reasonable default.

I'm unsure how to add tests for this to the project but I've run some basic tests by publishing and consuming the plugin to/from mavenLocal to confirm that it is working as intended. Please let me know how to continue or feel free to take it from here.

Chasson1992 commented 1 year ago

Thank you! This will be nice not having manually configure the compile and launcher options.

melix commented 1 year ago

Thanks a lot for the contribution!