apply plugin: 'java'

repositories {
    mavenCentral()
}

configurations {
    integrationTestCompile {
        extendsFrom testCompile
    }
    integrationTestRuntime {
        extendsFrom integrationTestCompile, testRuntime
    }
}

dependencies {
    testCompile group: 'junit', name: 'junit', version: '4.7'
    integrationTestCompile group: 'commons-collections', name: 'commons-collections', version: '3.2'
}

sourceSets {
    integrationTest {
        java.srcDir file('src/integration-test/java')
        resources.srcDir file('src/integration-test/resources')
        compileClasspath = sourceSets.main.classes + sourceSets.test.classes + configurations.integrationTestCompile
        runtimeClasspath = classes + compileClasspath + configurations.integrationTestRuntime
    }
}

task integrationTest(type: Test, dependsOn: jar) {
    testClassesDir = sourceSets.integrationTest.classesDir
    classpath = sourceSets.integrationTest.runtimeClasspath
    systemProperties['jar.path'] = jar.archivePath
}

build.dependsOn integrationTest
