Arjan van Wieringen
01/30/2023, 6:55 AMbuildSrc
, because I needed them in the precompiled scripts, I needed to add them to the implementation
block. However this resulted in the fact that they were on the classpath in the other projects as well and there I only needed to apply them when needed. This felt a bit weird, but writing it out it makes sense I think.... but it is not something I did before. Normally I would define the plugins in the root build.gradle.kts
with the apply
set to false
• IntelliJ IDE autocomplete and code-highlighting is terribly broken in the plugins. The only cure was restarting the IDE a lot of times. This made development a bit hard. I have the latest IDE.
• Getting the plugins from the version-catalog in the implementation
of the the buildSrc
I had to do weird string interpolation and separate getting of the plugin-id and plugin-version.
However, I learned a lot I think, but Gradle is still a very complicated powerful beast for me.
I have the working repository here: https://github.com/avwie/kotlinx Maybe if some people have some comments on how to do it better I'd like to know.PoisonedYouth
01/30/2023, 7:52 AMArjan van Wieringen
01/30/2023, 8:04 AMAdam S
01/30/2023, 8:59 AMdefining plugin versions inthis is my preferred way of defining plugins! It means that I can apply the plugins in convention plugins, or directly in projects, without versions - and they will always be aligned.buildSrc/build.gradle.kts
IntelliJ IDE autocomplete and code-highlighting is terribly broken in the pluginsit’s gotten better recently, but yes, it still fails a lot. Could you add a link to your project to this ticket so it can be investigated? https://youtrack.jetbrains.com/issue/KTIJ-19446
Getting the plugins from the version-catalog in theI prefer defining the Maven coordinates of a plugin, not the plugin ID, inof the theimplementation
buildSrc
libs.versions.toml
- it’s much more simple. the [plugins]
block isn’t so useful for buildSrcPoisonedYouth
01/30/2023, 5:53 PMthis is my preferred way of defining plugins! It means that I can apply the plugins in convention plugins, or directly in projects, without versions - and they will always be aligned.The same you can do if defining the convention plugin in submodule and include by "includeBuild(...)" in your settings.build.gradle.kts
Arjan van Wieringen
01/30/2023, 5:54 PMbuildSrc
is just the default includeBuild
.PoisonedYouth
01/30/2023, 6:03 PMAdam S
01/30/2023, 6:08 PMArjan van Wieringen
01/30/2023, 6:30 PMPoisonedYouth
01/30/2023, 6:54 PM