https://kotlinlang.org logo
Title
e

Exerosis

09/28/2020, 11:24 PM
Is there a way to have the lifecycle tasks defined without having a platform plugin applied like kotlin jvm? Am I incorrect I'm my assumption that projects that don't have sources probably should not have source related plugins? For example if my root project has no sources it would define the plugins with apply(false). The problem I'm having is that one of my subprojects uses the docker plugin to build some docker images... meanwhile another subproject uses the kotlin jvm plugin to compile and jar some sources and dependencies and ALSO does a docker build. I would like to "build" the project and by the end have 2 docker images. I can't work out what the cleanest way to do this would be, it feels like the dynamic nature of gradle is kind of tripping up and clashing with the type safety and modularity of kotlin.
a

araqnid

09/29/2020, 12:13 AM
There is a “base” plugin that defines generic tasks like clean, assemble, check, build
When you run “gradle build” it should find the “build” tasks in all the subprojects, as I remember.
e

Exerosis

09/29/2020, 12:25 AM
Ah I see, I tried just creating a task named build and then it does find that... Is there somewhere that explains why that happens? What order it goes in etc.? I figured that whatever was adding the build plugin automatically looked for "children". Base plugin looks like what I want! Sidenote, is there a good place I can learn all this stuff? I've used gradle for years and I feel like I still only kind of understand it.
n

no

09/29/2020, 8:21 AM
Here are some good trainings on the Gradle Build Tool: https://gradle.com/training/