bjorn
First things first, it is Björn or Bjoern, not Bjorn.
tad worried for if/when the buildscript/dependencies ‘legacy’, as indicated on the gradle-plugins page, is removed
No idea what the Gradle folks have in mind, but I wouldn’t expect it to go anywhere soon, even with the plugins { ... }
block being the recommended method, especially as you can use the “legacy” way also to get other libraries into the buildscript classpath.
The plugins { ... }
block is especially important when using the Kotlin DSL, which I strongly recommend anyway. By now it is the default DSL, you immediately get typesafe build scripts, acutally useful error messages if you mess up the syntax, and amazingly better IDE support if you use a good IDE like IntelliJ IDEA or Android Studio. And for that using the plugins { ... }
block also is essential as you only get types-safe accessors for convenient configuration and IDE assistance for plugins you apply in that block.
But besides that, you could also for example have a convention plugin that you always apply there instead and within the convention plugin then encapsulate the conditional logic.
we’ll have another pipeline that basically extends the project’s gradle but adds sq plugin, execs and publishes the report.
Maybe you should not apply the plugin in the build script then, but inject it in that pipeline using an init script or something like that?
apply from ./build.gradle’ that would be really nice
You should never even consider doing that.
What you talk about are legacy script plugins (the things you use with “apply from”).
They have many quirks and are discouraged.
Besides that it would in no way change your problem in any way, but would just add bad-practice to your setup.
also, what is an XY problem?
XY problem - Wikipedia