Are there some default imports applied to Gradle c...
# community-support
s
Are there some default imports applied to Gradle conventions plugins below
buildSrc
? Because it seems I don't have to import e.g.
import org.gradle.api.plugins.jvm.JvmTestSuite
(although IntelliJ does not flag them as unneeded, either)?
a
in a *.kts script plugin? Yeah, the default imports are here https://docs.gradle.org/8.6/userguide/writing_build_scripts.html#script-default-imports
s
Yes, great, thanks for the reference!
👍 1
v
IJ does not flag unneeded imports, just unused imports. It might make sense to post a feature request to also remove unneeded ones. 🙂 Sometimes the explicit imports are indeed necessary though, for example if you have multiple classes with the same name in different packages. Btw. just a reminder for the backmind, "convention plugin" != "precompiled script plugin" :-)
s
If anyone is interested, I've hacked together a small Kotlin script to remove these: https://github.com/sschuberth/dev-scripts/blob/main/kotlin/remove-default-gradle-build-script-imports.main.kts