Skip to content

Instantly share code, notes, and snippets.

@breskeby
Created June 13, 2011 00:24
Show Gist options
  • Save breskeby/1022162 to your computer and use it in GitHub Desktop.
Save breskeby/1022162 to your computer and use it in GitHub Desktop.
Incremental test task execution on jenkins
apply plugin:'groovy'
repositories{
mavenCentral()
}
dependencies{
groovy "org.codehaus.groovy:groovy-all:1.7.10"
testCompile "junit:junit:4.8.2"
}
task jenkinsTest{
inputs.files test.outputs.files
doLast{
def timestamp = System.currentTimeMillis()
test.testResultsDir.eachFile { it.lastModified = timestamp }
}
}
build.dependsOn(jenkinsTest)
task wrapper(type:Wrapper){
gradleVersion = '1.0-milestone-3'
}
@nanthagopal
Copy link

Hi,

where i have to configure the above code.

@fowlie
Copy link

fowlie commented Sep 29, 2014

Hi,

Thanks for sharing this! 👍 The testResultsDir is a deprecated property which is removed in Gradle 2. I have modified this code to be compatible with Gradle 2, and I also created it as a plugin.

Mats

@mundoEarth
Copy link

Hello,

Where am I going to configure that build.gradle file?

Raymund

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment