Register build service as part of multi-project plugin

I think I have what is the intended use case of a build service - I need to create and configure access to the JakartaTransformer tool that will be used by multiple tasks registered from my plugin.

I’m a little confused how to best accomplish this though when:

  1. the plugin is applied to sub-projects
  2. the build service needs configuration/parameters

It’s the registration and configuration/parameters part I am unsure of. That config should be the same across all of the sub-projects, but I am unsure of how to expose it in a singular, common way. ​This particular service would need access to:

  1. some dependencies (for the JakartaTransformer tool). or at least a version which I can then use to create a detached Configuration
  2. multiple RegularFile references

I am looking for best practices here. I have concocted a few possible solutions I think would work, though neither feel particular “right”…

  1. Make the user manually add and configure the build service from settings.gradle or the root-project’s build.gradle.
  2. Add the servuce from the first project that has the plugin applied and have the service configure itself via property file or somesuch

Would appreciate any guidance as to better solutions.

Thanks!