Fix jarhell marker to be written on info logging, and document how the

marker file works.
This commit is contained in:
Ryan Ernst 2015-11-19 10:21:25 -08:00
parent fce0052fd9
commit 0e8958d1e8
1 changed files with 11 additions and 2 deletions

View File

@ -95,6 +95,13 @@ class PrecommitTasks {
}
}
/**
* Adds a task to run jar hell before on the test classpath.
*
* We use a simple "marker" file that we touch when the task succeeds
* as the task output. This is compared against the modified time of the
* inputs (ie the jars/class files).
*/
static Task configureJarHell(Project project) {
File successMarker = new File(project.buildDir, 'markers/jarHell')
Exec task = project.tasks.create(name: 'jarHell', type: Exec)
@ -115,10 +122,12 @@ class PrecommitTasks {
logger.error(standardOutput.toString())
throw new GradleException("JarHell failed")
}
successMarker.parentFile.mkdirs()
successMarker.setText("", 'UTF-8')
})
}
task.doLast({
successMarker.parentFile.mkdirs()
successMarker.setText("", 'UTF-8')
})
return task
}
}