Slackbot
06/09/2022, 12:28 AMFrançois Guillot
06/09/2022, 7:54 AMsettings file, then yes, it’s not as straightforward.
See https://github.com/gradle/gradle/issues/14171
Until this is fixed, you can follow the workaround on the issue, or even something simpler:
interface ScriptServices {
val execOps: ExecOperations
}
gradleEnterprise {
buildScan {
val execOps = extensions.create<ScriptServices>("scriptServices").execOps
background {
// ...
}
}
}
The idea being to use ExtensionContainer instead of the ObjectFactory , as the former is already available in settings scripts, and knows how to inject the various available services.Michael Bailey
06/10/2022, 5:22 PM