Permalink
Switch branches/tags
Nothing to show
Find file Copy path
Fetching contributors…
Cannot retrieve contributors at this time
96 lines (83 sloc) 2.04 KB
apply plugin: 'java'
println '\n'
println 'Build script runs unit tests located in src/test by default'
println 'Run integration tests located in src/test-integration by executing \'gradle integrationTest\''
println 'Run acceptance tests located in src/test-acceptance by executing \'gradle acceptanceTest\''
println '\n'
sourceCompatibility = 1.7
buildDir = 'target/gradle-build'
sourceSets {
main {
java {
srcDir 'src/main/java'
}
resources {
srcDir 'src/main/resources'
}
}
test {
java {
srcDir 'src/test/java'
}
resources {
srcDir 'src/test/resources'
}
}
integrationTest {
java {
srcDir 'src/test-integration/java'
}
resources {
srcDir 'src/test-integration/resources'
}
compileClasspath += sourceSets.main.runtimeClasspath
}
acceptanceTest {
java {
srcDir 'src/test-acceptance/java'
}
resources {
srcDir 'src/test-acceptance/resources'
}
compileClasspath += sourceSets.main.runtimeClasspath
}
}
println 'Source set output classes directories:'
sourceSets.all {
println name + ' -> ' + it.output.classesDir
}
repositories {
mavenCentral()
}
dependencies {
testCompile 'junit:junit:4.10'
integrationTestCompile 'junit:junit:4.10'
acceptanceTestCompile 'junit:junit:4.10'
}
task wrapper(type: Wrapper) {
gradleVersion = '0.9'
}
task integrationTest(type: Test) {
description = "Runs integration tests"
testClassesDir = sourceSets.integrationTest.output.classesDir
classpath += sourceSets.test.runtimeClasspath + sourceSets.integrationTest.runtimeClasspath
useJUnit()
testLogging {
events "passed", "skipped", "failed"
}
}
task acceptanceTest(type: Test) {
description = "Runs acceptance tests"
testClassesDir = sourceSets.acceptanceTest.output.classesDir
classpath += sourceSets.test.runtimeClasspath + sourceSets.acceptanceTest.runtimeClasspath
useJUnit()
testLogging {
events "passed", "skipped", "failed"
}
}
test {
useJUnit()
testLogging {
events "passed", "skipped", "failed"
}
}