123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110 |
- plugins {
- id("otel.javaagent-instrumentation")
- id("otel.scala-conventions")
- }
- muzzle {
- // There are some weird library issues below 2.9 so can't assert inverse
- pass {
- group.set("com.twitter")
- module.set("finatra-http_2.11")
- versions.set("[2.9.0,]")
- excludeDependency("io.netty:netty-transport-native-epoll")
- }
- pass {
- group.set("com.twitter")
- module.set("finatra-http_2.12")
- versions.set("[2.9.0,]")
- excludeDependency("io.netty:netty-transport-native-epoll")
- }
- }
- // Test suites don't allow excluding transitive dependencies. We use this configuration to declare
- // dependency to latest finatra and exclude netty-transport-native-epoll.
- val finatraLatest by configurations.creating {
- isCanBeConsumed = false
- isCanBeResolved = false
- }
- dependencies {
- // TODO(anuraaga): Something about library configuration doesn't work well with scala compilation
- // here.
- compileOnly("com.twitter:finatra-http_2.11:2.9.0")
- testInstrumentation(project(":instrumentation:netty:netty-4.1:javaagent"))
- testImplementation(enforcedPlatform("com.fasterxml.jackson:jackson-bom:2.9.10"))
- testImplementation("com.twitter:finatra-http_2.11:19.12.0") {
- // Finatra POM references linux-aarch64 version of this which we don't need. Including it
- // prevents us from managing Netty version because the classifier name changed to linux-aarch_64
- // in recent releases. So we exclude and force the linux-x86_64 classifier instead.
- exclude("io.netty", "netty-transport-native-epoll")
- }
- testImplementation("io.netty:netty-transport-native-epoll:4.1.51.Final:linux-x86_64")
- // Required for older versions of finatra on JDKs >= 11
- testImplementation("com.sun.activation:javax.activation:1.2.0")
- finatraLatest("com.twitter:finatra-http_2.13:+") {
- exclude("io.netty", "netty-transport-native-epoll")
- }
- }
- testing {
- suites {
- val latestDepTest by registering(JvmTestSuite::class) {
- dependencies {
- // finatra is included via finatraLatest configuation
- implementation("io.netty:netty-transport-native-epoll:4.1.51.Final:linux-x86_64")
- }
- }
- }
- }
- configurations {
- named("latestDepTestImplementation") {
- extendsFrom(configurations["finatraLatest"])
- }
- }
- tasks {
- if (findProperty("testLatestDeps") as Boolean) {
- // Separate task
- named("test") {
- enabled = false
- }
- named("compileTestScala") {
- enabled = false
- }
- check {
- dependsOn(testing.suites)
- }
- }
- withType<Test>().configureEach {
- // required on jdk17
- jvmArgs("--add-opens=java.base/java.lang=ALL-UNNAMED")
- jvmArgs("-XX:+IgnoreUnrecognizedVMOptions")
- }
- val testStableSemconv by registering(Test::class) {
- jvmArgs("-Dotel.semconv-stability.opt-in=http")
- }
- check {
- dependsOn(testStableSemconv)
- }
- }
- // com.fasterxml.jackson.module:jackson-module-scala_2.11:2.15.2 is missing force using jackson 2.15.1
- // remove this when a new version of jackson is released
- configurations.configureEach {
- resolutionStrategy {
- eachDependency {
- if (requested.group == "com.fasterxml.jackson" && requested.name == "jackson-bom" && requested.version == "2.15.2") {
- useVersion("2.15.1")
- }
- }
- }
- }
|