If I create a Kotlin object in `buildSrc', would t...
# gradle
a
If I create a Kotlin object in `buildSrc', would that object be accessible to a groovy gradle script ?
i
In a similar question, accessing kotlin classes in plugins from Gradle is seemingly impossible. I don't know if it would be the same answer but I've run into that.
g
Yes, it will be available, because it’s just a JVM class. But syntax will be something like
YourObject.INSTANCE
In a similar question, accessing kotlin classes in plugins from Gradle is seemingly impossible
Why? Do you have any example. Because Kotlin creates Java compatible classes and Groovy can work with Java libraries, so everything should work
j
Beware that if you are using Android Studio 3.3, you don't get IDE integration between
build.gradle
and the
buildSrc
because of this bug. https://issuetracker.google.com/issues/123032843 But the Gradle build itself will just works