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

muzzle {
  // Cant assert fails because muzzle assumes all instrumentations will fail
  // Instrumentations in jaxrs-2.0-common will pass

  // Resteasy changes a class's package in 3.1.0 then moves it back in 3.5.0 and then moves it forward again in 4.0.0
  // so the jaxrs-2.0-resteasy-3.0 module applies to [3.0, 3.1) and [3.5, 4.0)
  // and the jaxrs-2.0-resteasy-3.1 module applies to [3.1, 3.5) and [4.0, )
  pass {
    group = "org.jboss.resteasy"
    module = "resteasy-jaxrs"
    versions = "[3.0.0.Final,3.1.0.Final)"
  }

  pass {
    group = "org.jboss.resteasy"
    module = "resteasy-jaxrs"
    versions = "[3.5.0.Final,4)"
  }
}

dependencies {
  compileOnly group: 'javax.ws.rs', name: 'javax.ws.rs-api', version: '2.0'
  library group: 'org.jboss.resteasy', name: 'resteasy-jaxrs', version: '3.0.0.Final'

  implementation project(':instrumentation:jaxrs:jaxrs-2.0:jaxrs-2.0-common:javaagent')

  testInstrumentation project(':instrumentation:servlet:servlet-3.0:javaagent')
  testInstrumentation project(':instrumentation:servlet:servlet-common:javaagent')

  testImplementation project(':instrumentation:jaxrs:jaxrs-2.0:jaxrs-2.0-testing')

  testLibrary(group: 'org.jboss.resteasy', name: 'resteasy-undertow', version: '3.0.4.Final') {
    exclude group: 'org.jboss.resteasy', module: 'resteasy-client'
  }
  testLibrary group: 'io.undertow', name: 'undertow-servlet', version: '1.0.0.Final'

  latestDepTestLibrary group: 'org.jboss.resteasy', name: 'resteasy-jaxrs', version: '3.+'
  latestDepTestLibrary(group: 'org.jboss.resteasy', name: 'resteasy-undertow', version: '3.+') {
    exclude group: 'org.jboss.resteasy', module: 'resteasy-client'
  }
}

test {
  systemProperty 'testLatestDeps', testLatestDeps
}
