My scenario is to apply other plug-ins in my customized plug-in, but before applying other plug-ins, the dependencies must be configured, otherwise an error will be reported when running, and the plug-in cannot be found, so I want to configure the plug-in dependencies when applying the plug-in. , this will automatically download the plug-in
class MyPlugin : Plugin<Project> {
override fun apply(target: Project) {
//If you apply it directly like this, an error will be reported. The plug-in cannot be found. It must be configured first in plugins{} of build.gradle in the root directory.
//Is there a way for me to configure the dependencies of the plugin here so that I don’t need to configure it in plugin{} of build.gradle?
target.apply("org.jetbrains.kotlin.plugin.compose")
}
}
I tried to get the org.gradle.plugin.use.PluginDependency object in the Plugin so that I can add dependencies, but I didn’t find how to get the PluginDependency object in the Plugin.