apply from: "$rootDir/gradle/instrumentation.gradle"

muzzle {
  pass {
    name = "webflux_5.0.0+_with_netty_0.8.0"
    group = "org.springframework"
    module = "spring-webflux"
    versions = "[5.0.0.RELEASE,)"
    assertInverse = true
    extraDependency "io.projectreactor.netty:reactor-netty:0.8.0.RELEASE"
  }

  pass {
    name = "webflux_5.0.0_with_ipc_0.7.0"
    group = "org.springframework"
    module = "spring-webflux"
    versions = "[5.0.0.RELEASE,)"
    assertInverse = true
    extraDependency "io.projectreactor.ipc:reactor-netty:0.7.0.RELEASE"
  }

  pass {
    name = "netty_0.8.0+_with_spring-webflux:5.1.0"
    group = "io.projectreactor.netty"
    module = "reactor-netty"
    versions = "[0.8.0.RELEASE,)"
    extraDependency "org.springframework:spring-webflux:5.1.0.RELEASE"
  }

  pass {
    name = "ipc_0.7.0+_with_spring-webflux:5.0.0"
    group = "io.projectreactor.ipc"
    module = "reactor-netty"
    versions = "[0.7.0.RELEASE,)"
    extraDependency "org.springframework:spring-webflux:5.0.0.RELEASE"
  }
}

dependencies {
  implementation project(':instrumentation:spring:spring-webflux-5.0:library')
  compileOnly group: 'org.springframework', name: 'spring-webflux', version: '5.0.0.RELEASE'
  compileOnly group: 'io.projectreactor.ipc', name: 'reactor-netty', version: '0.7.0.RELEASE'

  testInstrumentation project(':instrumentation:netty:netty-4.1:javaagent')
  testInstrumentation project(':instrumentation:reactor-3.1:javaagent')

  testLibrary group: 'org.springframework.boot', name: 'spring-boot-starter-webflux', version: '2.0.0.RELEASE'
  testLibrary group: 'org.springframework.boot', name: 'spring-boot-starter-test', version: '2.0.0.RELEASE'
  testLibrary group: 'org.springframework.boot', name: 'spring-boot-starter-reactor-netty', version: '2.0.0.RELEASE'
  testImplementation group: 'org.spockframework', name: 'spock-spring', version: '1.1-groovy-2.4'
}

tasks.withType(Test) {
  // TODO run tests both with and without experimental span attributes
  jvmArgs '-Dotel.instrumentation.spring-webflux.experimental-span-attributes=true'

  systemProperty "testLatestDeps", testLatestDeps
}
