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.
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.