Migrating a build.gradle for a Java project to bui...
# gradle
e
Migrating a build.gradle for a Java project to build.gradle.kts for a Kotlin project. I see that a
byteBuddyJava
task exists for the Java project. Is there something specific I have to do to get an equivalent in Kotlin ie
byteBuddyKotlin
? The opentelemetry extension build.gradle is the one I am trying to convert. Any pointers?
c
Kotlin generates Java bytecode, which can then be instrumented. Perhaps this will work as is, unless OpenTelemetry has specific guidance for Kotlin.
e
@Chris Lee The reason I asked is - the log statement
System.out.println("Adding custom SPAN Processor")
I added in
configureSdkTraceProvider
method gets printed when I use the Java project jar with groovy build script with my sample app. But I dont get the log statement printed for my Kotlin project with kotlin gradle script
c
If the project is still compiling Java it should continue to work. Ensure the appropriate plugins are still applied and configured equilavently.
e
Is there a way to check if I am missing any equivalent kotlin plugins?
c
the same plugins from your groovy script should generally work straight across
e
I see 6 actionable tasks executed for my Java project sample with build.gradle script but only 5 actionable tasks executed for my Kotlin project sample with build.gradle.kts. Not sure what I am missing in my build.gradle.kts. Here is my attempt at converting the groovy build script to kotlin build script