https://kotlinlang.org logo
Title
t

Thomas Oddsund

05/13/2019, 8:57 AM
Hello! How can I apply a plugin that is only available through another plugin? The case is one jar containing all plugins, and explanation in comments 👇
To elaborate, I have created a custom gradle plugin for internal projects, where the projects mostly have a structure like this;
root/
    - client/
    - server/
The plugin is then applied using the plugins dsl to the root project, e.g. like this;
plugins {
    id("com.example.plugin") version "1.0"
}
From there, I can apply the "com.example.plugin.{client|server}" to the subprojects using the plugins dsl - but how can I apply f.ex. the server plugin to the root project? Should I publish three different plugins, or is here some way? Ideally, I would be able to do this in the root project;
plugins {
    id("com.example.plugin") version "1.0"
    id("com.example.plugin.server")
}
Or similar using the apply dsl.
w

wakingrufus

05/13/2019, 3:47 PM
i have done something similar, where there are 2 different plugins, and you apply the appropriate one on each subproject
trying to do it all from the root caused some issues that were hard to work around
but id be interested if you figure it out