apply from: "$rootDir/gradle/instrumentation.gradle"
apply from: "$rootDir/gradle/test-with-scala.gradle"
apply plugin: 'org.unbroken-dome.test-sets'

testSets {
  version101Test {
    dirName = 'test'
  }
}

muzzle {
  pass {
    group = 'com.typesafe.akka'
    module = 'akka-http_2.11'
    versions = "[10.0.0,10.1.0)"
    // later versions of akka-http expect streams to be provided
    extraDependency 'com.typesafe.akka:akka-stream_2.11:2.4.14'
  }
  pass {
    group = 'com.typesafe.akka'
    module = 'akka-http_2.12'
    versions = "[10.0.0,10.1.0)"
    // later versions of akka-http expect streams to be provided
    extraDependency 'com.typesafe.akka:akka-stream_2.12:2.4.14'
  }
  pass {
    group = 'com.typesafe.akka'
    module = 'akka-http_2.11'
    versions = "[10.1.0,)"
    // later versions of akka-http expect streams to be provided
    extraDependency 'com.typesafe.akka:akka-stream_2.11:2.5.11'
  }
  pass {
    group = 'com.typesafe.akka'
    module = 'akka-http_2.12'
    versions = "[10.1.0,)"
    // later versions of akka-http expect streams to be provided
    extraDependency 'com.typesafe.akka:akka-stream_2.12:2.5.11'
  }
  //There is no akka-http 10.0.x series for scala 2.13
  pass {
    group = 'com.typesafe.akka'
    module = 'akka-http_2.13'
    versions = "[10.1.8,)"
    // later versions of akka-http expect streams to be provided
    extraDependency 'com.typesafe.akka:akka-stream_2.13:2.5.23'
  }
}

dependencies {
  library group: 'com.typesafe.akka', name: 'akka-http_2.11', version: '10.0.0'
  library group: 'com.typesafe.akka', name: 'akka-stream_2.11', version: '2.4.14'

  // There are some internal API changes in 10.1 that we would like to test separately for
  version101TestImplementation group: 'com.typesafe.akka', name: 'akka-http_2.11', version: '10.1.0'
  version101TestImplementation group: 'com.typesafe.akka', name: 'akka-stream_2.11', version: '2.5.11'
}

test.dependsOn version101Test

compileVersion101TestGroovy {
  classpath = classpath.plus(files(compileVersion101TestScala.destinationDir))
  dependsOn compileVersion101TestScala
}
