ext {
  // Play doesn't work with Java 9+ until 2.6.12
  maxJavaVersionForTests = JavaVersion.VERSION_1_8
}

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

muzzle {
  pass {
    group = 'com.typesafe.play'
    module = 'play_2.11'
    versions = '[2.4.0,2.6)'
    assertInverse = true
  }
  fail {
    group = 'com.typesafe.play'
    module = 'play_2.12'
    versions = '[,]'
  }
  fail {
    group = 'com.typesafe.play'
    module = 'play_2.13'
    versions = '[,]'
  }
}

dependencies {
  // TODO(anuraaga): Something about library configuration doesn't work well with scala compilation
  // here.
  compileOnly group: 'com.typesafe.play', name: 'play_2.11', version: '2.4.0'

  testInstrumentation project(':instrumentation:netty:netty-4.0:javaagent')
  testInstrumentation project(':instrumentation:netty:netty-4.1:javaagent')
  testInstrumentation project(':instrumentation:akka-http-10.0:javaagent')
  testInstrumentation project(':instrumentation:async-http-client-2.0:javaagent')

  // Before 2.5, play used netty 3.x which isn't supported, so for better test consistency, we test with just 2.5
  testLibrary group: 'com.typesafe.play', name: 'play-java_2.11', version: '2.5.0'
  testLibrary group: 'com.typesafe.play', name: 'play-java-ws_2.11', version: '2.5.0'
  testLibrary(group: 'com.typesafe.play', name: 'play-test_2.11', version: '2.5.0') {
    exclude group: 'org.eclipse.jetty.websocket', module: 'websocket-client'
  }

  latestDepTestLibrary group: 'com.typesafe.play', name: 'play-java_2.11', version: '2.5.+'
  latestDepTestLibrary group: 'com.typesafe.play', name: 'play-java-ws_2.11', version: '2.5.+'
  latestDepTestLibrary(group: 'com.typesafe.play', name: 'play-test_2.11', version: '2.5.+') {
    exclude group: 'org.eclipse.jetty.websocket', module: 'websocket-client'
  }
}
