apply plugin: 'groovy'
apply from: "$rootDir/gradle/integTest.gradle"

dependencies {
    groovy libraries.groovy_depends

    testCompile project(path: ':core', configuration: 'testFixtures')
    testRuntime project(path: ':core', configuration: 'testFixturesRuntime')

    integTestCompile libraries.slf4j_api
    integTestCompile project(path: ':core', configuration: 'integTestFixtures')
    integTestRuntime project(path: ':core', configuration: 'integTestFixturesRuntime')
}

//create a task for running the integration tests
task integTest(type: Test, dependsOn: [ rootProject.intTestImage ]) {
    systemProperties['integTest.gradleHomeDir'] = rootProject.intTestImage.integTestGradleHome.absolutePath
    systemProperties['integTest.gradleUserHomeDir'] = rootProject.integTest.integTestUserDir.absolutePath
    testClassesDir = sourceSets.integTest.classesDir
    classpath = sourceSets.integTest.runtimeClasspath + configurations.integTestRuntime

    doFirst { task -> systemProperties['integTest.gradleHomeDir'] = rootProject.intTestImage.integTestGradleHome.absolutePath }
}
