use of org.gradle.external.javadoc.internal.JavadocExecHandleBuilder in project gradle by gradle.
the class JavadocGenerator method execute.
@Override
public WorkResult execute(JavadocSpec spec) {
JavadocExecHandleBuilder javadocExecHandleBuilder = new JavadocExecHandleBuilder(execActionFactory);
javadocExecHandleBuilder.setExecutable(spec.getExecutable());
javadocExecHandleBuilder.execDirectory(spec.getWorkingDir()).options(spec.getOptions()).optionsFile(spec.getOptionsFile());
ExecAction execAction = javadocExecHandleBuilder.getExecHandle();
if (spec.isIgnoreFailures()) {
execAction.setIgnoreExitValue(true);
}
try {
execAction.execute();
} catch (ExecException e) {
LOG.info("Problems generating Javadoc." + "\n Command line issued: " + execAction.getCommandLine() + "\n Generated Javadoc options file has following contents:\n------\n{}------", GFileUtils.readFileQuietly(spec.getOptionsFile()));
throw new GradleException(String.format("Javadoc generation failed. Generated Javadoc options file (useful for troubleshooting): '%s'", spec.getOptionsFile()), e);
}
return new SimpleWorkResult(true);
}
Aggregations