Merge pull request #14906 from nik9000/gradle_empty_dir

Survive missing directories
This commit is contained in:
Nik Everett 2015-11-20 17:48:11 -05:00
commit ea512763ae
2 changed files with 10 additions and 2 deletions

View File

@ -288,7 +288,11 @@ class BuildPlugin implements Plugin<Project> {
project.tasks.withType(JavaCompile) {
options.fork = true
options.forkOptions.executable = new File(project.javaHome, 'bin/javac')
options.compilerArgs << '-Werror' << '-Xlint:all' << '-Xdoclint:all' << '-Xdoclint:-missing'
/*
* -path because gradle will send in paths that don't always exist.
* -missing because we have tons of missing @returns and @param.
*/
options.compilerArgs << '-Werror' << '-Xlint:all,-path' << '-Xdoclint:all' << '-Xdoclint:-missing'
options.encoding = 'UTF-8'
}
}

View File

@ -111,7 +111,11 @@ class PrecommitTasks {
task.outputs.file(successMarker)
task.executable = new File(project.javaHome, 'bin/java')
task.doFirst({
task.args('-cp', testClasspath.asPath, 'org.elasticsearch.bootstrap.JarHell')
/* JarHell doesn't like getting directories that don't exist but
gradle isn't especially careful about that. So we have to do it
filter it ourselves. */
def taskClasspath = testClasspath.filter { it.exists() }
task.args('-cp', taskClasspath.asPath, 'org.elasticsearch.bootstrap.JarHell')
})
if (task.logger.isInfoEnabled() == false) {
task.standardOutput = new ByteArrayOutputStream()