Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ plugins {
id("com.gradleup.shadow") version "8.3.6" apply false
id("me.champeau.jmh") version "0.7.3" apply false
id("org.gradle.playframework") version "0.13" apply false
kotlin("jvm") version libs.versions.kotlin.plugin apply false
}

description = "dd-trace-java"
Expand Down
2 changes: 1 addition & 1 deletion buildSrc/src/main/groovy/InstrumentPlugin.groovy
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ class InstrumentPlugin implements Plugin<Project> {
InstrumentExtension extension = project.extensions.create('instrument', InstrumentExtension)

project.tasks.matching {
it.name in ['compileJava', 'compileScala', 'compileKotlin', 'compileGroovy'] ||
it.name in ['compileJava', 'compileScala', 'compileGroovy'] ||
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No instrumentation is written in Kotlin, and as such there no post-processing involved.

it.name =~ /compileMain_.+Java/
}.all {
AbstractCompile compileTask = it as AbstractCompile
Expand Down
25 changes: 1 addition & 24 deletions dd-java-agent/agent-ci-visibility/build.gradle
Original file line number Diff line number Diff line change
@@ -1,31 +1,8 @@
import com.github.jengelman.gradle.plugins.shadow.tasks.ShadowJar

buildscript {
repositories {
mavenLocal()
if (project.rootProject.hasProperty("gradlePluginProxy")) {
maven {
url project.rootProject.property("gradlePluginProxy")
allowInsecureProtocol = true
}
}
if (project.rootProject.hasProperty("mavenRepositoryProxy")) {
maven {
url project.rootProject.property("mavenRepositoryProxy")
allowInsecureProtocol = true
}
}
gradlePluginPortal()
mavenCentral()
}

dependencies {
classpath group: 'org.jetbrains.kotlin', name: 'kotlin-gradle-plugin', version: libs.versions.kotlin.get()
}
}

plugins {
id 'com.gradleup.shadow'
id 'org.jetbrains.kotlin.jvm' version libs.versions.kotlin.plugin
}

apply from: "$rootDir/gradle/java.gradle"
Expand Down
21 changes: 11 additions & 10 deletions dd-java-agent/agent-llmobs/build.gradle
Original file line number Diff line number Diff line change
@@ -1,23 +1,24 @@
import com.github.jengelman.gradle.plugins.shadow.tasks.ShadowJar

buildscript {
repositories {
mavenCentral()
}

dependencies {
classpath group: 'org.jetbrains.kotlin', name: 'kotlin-gradle-plugin', version: libs.versions.kotlin.get()
}
}
Comment on lines -3 to -11
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Also, this buildscript was not configured to use our maven proxy

import org.jetbrains.kotlin.gradle.dsl.JvmTarget
import org.jetbrains.kotlin.gradle.dsl.KotlinVersion

plugins {
id 'com.gradleup.shadow'
id 'org.jetbrains.kotlin.jvm'
}

apply from: "$rootDir/gradle/java.gradle"
apply from: "$rootDir/gradle/version.gradle"
apply from: "$rootDir/gradle/test-with-kotlin.gradle"

kotlin {
compilerOptions {
jvmTarget = JvmTarget.JVM_1_8
apiVersion = KotlinVersion.KOTLIN_1_6
languageVersion = KotlinVersion.KOTLIN_1_6
}
}

minimumBranchCoverage = 0.0
minimumInstructionCoverage = 0.0

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,14 +7,12 @@ import javax.inject.Inject

import play.api.mvc._

/**
* This controller creates an `Action` to handle HTTP requests to the
/** This controller creates an `Action` to handle HTTP requests to the
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Note can ignore the *.scala files as they were just formatted. Side-effect of fixing the way the spotless plugin is configured. Before these files were not seen.

* application's work page which does busy wait to simulate some work
*/
class HomeController @Inject()(cc: ControllerComponents) extends AbstractController(cc) {
class HomeController @Inject() (cc: ControllerComponents) extends AbstractController(cc) {

/**
* Create an Action to perform busy wait
/** Create an Action to perform busy wait
*/
def doGet(workTimeMS: Option[Long], error: Option[String]) = Action {
implicit request: Request[AnyContent] =>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -78,24 +78,27 @@ class AkkaActors extends AutoCloseable {

object AkkaActors {
// If we can't load the Version class, then assume 2.3
val isAkka23: Boolean = try {
Class.forName("akka.Version")
false
} catch {
case _: Throwable => true
}
val isAkka23: Boolean =
try {
Class.forName("akka.Version")
false
} catch {
case _: Throwable => true
}

// The way to terminate an actor system has changed between versions
val terminate: (ActorSystem) => Unit = {
val t = try {
ActorSystem.getClass.getMethod("terminate")
} catch {
case _: Throwable => try {
ActorSystem.getClass.getMethod("awaitTermination")
val t =
try {
ActorSystem.getClass.getMethod("terminate")
} catch {
case _: Throwable => null
case _: Throwable =>
try {
ActorSystem.getClass.getMethod("awaitTermination")
} catch {
case _: Throwable => null
}
}
}
if (t ne null) {
{ system: ActorSystem =>
t.invoke(system)
Expand Down
Loading
Loading