apply plugin: 'java'

repositories {
    mavenCentral()
}

sourceSets {
    integrationTest {
        java.srcDir file('src/integration-test/java')
        resources.srcDir file('src/integration-test/resources')
    }
}

dependencies {
    testCompile group: 'junit', name: 'junit', version: '4.8.2'
    integrationTestCompile group: 'commons-collections', name: 'commons-collections', version: '3.2'
    integrationTestCompile sourceSets.main.output
    integrationTestCompile configurations.testCompile
    integrationTestCompile sourceSets.test.output
    integrationTestRuntime configurations.testRuntime
}

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

check.dependsOn integrationTest
