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

muzzle {
  pass {
    group = "javax.servlet"
    module = 'javax.servlet-api'
    versions = "[3.0,)"
    assertInverse = true
  }
  fail {
    group = "javax.servlet"
    module = 'servlet-api'
    versions = "(,)"
  }
}

dependencies {
  compileOnly group: 'javax.servlet', name: 'javax.servlet-api', version: '3.0.1'
  api(project(':instrumentation-core:servlet-2.2'))

  testInstrumentation project(':instrumentation:jetty-8.0:javaagent')
  testInstrumentation project(':instrumentation:servlet:servlet-common:javaagent')

  testImplementation(project(':testing-common')) {
    exclude group: 'org.eclipse.jetty', module: 'jetty-server'
  }
  testLibrary group: 'org.eclipse.jetty', name: 'jetty-server', version: '8.0.0.v20110901'
  testLibrary group: 'org.eclipse.jetty', name: 'jetty-servlet', version: '8.0.0.v20110901'
  testLibrary group: 'org.apache.tomcat.embed', name: 'tomcat-embed-core', version: '8.0.41'
  testLibrary group: 'org.apache.tomcat.embed', name: 'tomcat-embed-jasper', version: '8.0.41'

  // Jetty 10 seems to refuse to run on java8.
  // TODO: we need to setup separate test for Jetty 10 when that is released.
  latestDepTestLibrary group: 'org.eclipse.jetty', name: 'jetty-server', version: '9.+'
  latestDepTestLibrary group: 'org.eclipse.jetty', name: 'jetty-servlet', version: '9.+'

  latestDepTestLibrary group: 'org.apache.tomcat.embed', name: 'tomcat-embed-core', version: '9.+'
  latestDepTestLibrary group: 'org.apache.tomcat.embed', name: 'tomcat-embed-jasper', version: '9.+'
}
