I want to create a plugin that applies the shadow ...
# gradle
i
I want to create a plugin that applies the shadow jar plugin and configures it, but i can’t figure out how to add shadowJar as a dependency to the plugin, I tried:
Copy code
implementation("gradle.plugin.com.github.johnrengelman:shadow:7.1.2")
But i can’t reference ShadowJar class in my main plugin (binary) code Any advice?
g
It should work, right
Are you sure that your Gradle sync finished successfully? (for example you may have no gradlePluginPortal() in repositories)
i
Yeah i’m sure.
a
I think that the Shadow plugin is written in Groovy, so unless the
ShadowJar
class is compiled as static then it’s tough to use it from Kotlin or Java there’s an overview of Groovy/Kotlin interop here: https://docs.gradle.org/current/userguide/kotlin_dsl.html#sec:interoperability
g
Just tried and it works as dependency for Kotlin Gradle Plugin, no problem, so it's not an issue of Groovy compatibility, otherwise it wouldn't work with Java and with Kotlin DSL