Skip to content

Commit

Permalink
Migrate instrumentation gradle files to kotlin (#3414)
Browse files Browse the repository at this point in the history
* Migrate instrumentation gradle files to kotlin

* Convert

* Muzzle
  • Loading branch information
Anuraag Agrawal committed Jun 28, 2021
1 parent 9e2fcba commit 761b9c2
Show file tree
Hide file tree
Showing 450 changed files with 6,133 additions and 5,962 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -14,14 +14,14 @@ abstract class MuzzleExtension @Inject constructor(private val objectFactory: Ob

internal abstract val directives: ListProperty<MuzzleDirective>

fun pass(action: Action<in MuzzleDirective?>) {
fun pass(action: Action<MuzzleDirective>) {
val pass = objectFactory.newInstance(MuzzleDirective::class.java)
action.execute(pass)
pass.assertPass.set(true)
directives.add(pass)
}

fun fail(action: Action<in MuzzleDirective?>) {
fun fail(action: Action<MuzzleDirective>) {
val fail = objectFactory.newInstance(MuzzleDirective::class.java)
action.execute(fail)
fail.assertPass.set(false)
Expand Down
4 changes: 3 additions & 1 deletion gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -6,4 +6,6 @@ org.gradle.priority=low
# Gradle default is 256m which causes issues with our build - https://docs.gradle.org/current/userguide/build_environment.html#sec:configuring_jvm_memory
org.gradle.jvmargs=-XX:MaxMetaspaceSize=512m

org.gradle.warning.mode=fail
# TODO(anuraaga): Reenable closer to Gradle 8.0. Currently protobuf plugin fails due to bug
# https://github.com/google/protobuf-gradle-plugin/issues/444
# org.gradle.warning.mode=fail
36 changes: 0 additions & 36 deletions instrumentation/akka-actor-2.5/javaagent/build.gradle

This file was deleted.

38 changes: 38 additions & 0 deletions instrumentation/akka-actor-2.5/javaagent/build.gradle.kts
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
plugins {
id("otel.javaagent-instrumentation")
id("otel.scala-conventions")
}

muzzle {
pass {
group.set("com.typesafe.akka")
module.set("akka-actor_2.11")
versions.set("[2.5.0,)")
}
pass {
group.set("com.typesafe.akka")
module.set("akka-actor_2.12")
versions.set("[2.5.0,)")
}
pass {
group.set("com.typesafe.akka")
module.set("akka-actor_2.13")
versions.set("(,)")
}
}

dependencies {
compileOnly("com.typesafe.akka:akka-actor_2.11:2.5.0")
testImplementation("com.typesafe.akka:akka-actor_2.11:2.5.0")

latestDepTestLibrary("com.typesafe.akka:akka-actor_2.13:+")
}

if (findProperty("testLatestDeps") as Boolean) {
configurations {
// akka artifact name is different for regular and latest tests
testImplementation {
exclude("com.typesafe.akka", "akka-actor_2.11")
}
}
}
16 changes: 0 additions & 16 deletions instrumentation/akka-actor-fork-join-2.5/javaagent/build.gradle

This file was deleted.

Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
plugins {
id("otel.javaagent-instrumentation")
id("otel.scala-conventions")
}

muzzle {
pass {
group.set("com.typesafe.akka")
module.set("akka-actor_2.11")
versions.set("[2.5.0,)")
}
}

dependencies {
library("com.typesafe.akka:akka-actor_2.11:2.5.0")
}
53 changes: 0 additions & 53 deletions instrumentation/akka-http-10.0/javaagent/build.gradle

This file was deleted.

53 changes: 53 additions & 0 deletions instrumentation/akka-http-10.0/javaagent/build.gradle.kts
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
plugins {
id("otel.javaagent-instrumentation")
id("otel.scala-conventions")
}

muzzle {
pass {
group.set("com.typesafe.akka")
module.set("akka-http_2.11")
versions.set("[10.0.0,10.1.0)")
// later versions of akka-http expect streams to be provided
extraDependency("com.typesafe.akka:akka-stream_2.11:2.4.14")
}
pass {
group.set("com.typesafe.akka")
module.set("akka-http_2.12")
versions.set("[10.0.0,10.1.0)")
// later versions of akka-http expect streams to be provided
extraDependency("com.typesafe.akka:akka-stream_2.12:2.4.14")
}
pass {
group.set("com.typesafe.akka")
module.set("akka-http_2.11")
versions.set("[10.1.0,)")
// later versions of akka-http expect streams to be provided
extraDependency("com.typesafe.akka:akka-stream_2.11:2.5.11")
}
pass {
group.set("com.typesafe.akka")
module.set("akka-http_2.12")
versions.set("[10.1.0,)")
// later versions of akka-http expect streams to be provided
extraDependency("com.typesafe.akka:akka-stream_2.12:2.5.11")
}
//There is no akka-http 10.0.x series for scala 2.13
pass {
group.set("com.typesafe.akka")
module.set("akka-http_2.13")
versions.set("[10.1.8,)")
// later versions of akka-http expect streams to be provided
extraDependency("com.typesafe.akka:akka-stream_2.13:2.5.23")
}
}

dependencies {
library("com.typesafe.akka:akka-http_2.11:10.0.0")
library("com.typesafe.akka:akka-stream_2.11:2.4.14")

// these instrumentations are not needed for the tests to pass
// they are here to test for context leaks
testInstrumentation(project(":instrumentation:akka-actor-2.5:javaagent"))
testInstrumentation(project(":instrumentation:akka-actor-fork-join-2.5:javaagent"))
}

This file was deleted.

Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
plugins {
id("otel.java-conventions")
}

dependencies {
testImplementation(project(":instrumentation:apache-camel-2.20:javaagent"))
testImplementation("org.apache.camel:camel-core:2.20.1")
testImplementation("org.apache.camel:camel-aws:2.20.1")
testImplementation("org.apache.camel:camel-http:2.20.1")

testImplementation("io.opentelemetry:opentelemetry-extension-trace-propagators")
testImplementation("io.opentelemetry:opentelemetry-extension-aws")
testImplementation("org.assertj:assertj-core")
}
65 changes: 0 additions & 65 deletions instrumentation/apache-camel-2.20/javaagent/build.gradle

This file was deleted.

Loading

0 comments on commit 761b9c2

Please sign in to comment.