apply plugin: 'java'

if (hasProperty('showOutput')) {

// Various ways to access the main source set
println sourceSets.main.output.classesDirs
println sourceSets['main'].output.classesDirs
sourceSets {
    println main.output.classesDirs
}
sourceSets {
    main {
        println output.classesDirs
    }
}

// Iterate over the source sets
sourceSets.all {
    println name
}

}

sourceSets {
    intTest
}

repositories {
    mavenCentral()
}

sourceSets {
    intTest
}

dependencies {
    intTestCompile 'junit:junit:4.12'
    intTestRuntime 'org.ow2.asm:asm-all:4.0'
}

task intTestJar(type: Jar) {
    from sourceSets.intTest.output
}

task intTestJavadoc(type: Javadoc) {
    source sourceSets.intTest.allJava
}

task intTest(type: Test) {
    testClassesDirs = sourceSets.intTest.output.classesDirs
    classpath = sourceSets.intTest.runtimeClasspath
}
