use of org.gradle.api.tasks.scala.ScalaDoc in project gradle by gradle.
the class ScalaPlugin method configureScaladoc.
private static void configureScaladoc(final Project project) {
project.getTasks().withType(ScalaDoc.class, new Action<ScalaDoc>() {
@Override
public void execute(ScalaDoc scalaDoc) {
final SourceSet main = project.getConvention().getPlugin(JavaPluginConvention.class).getSourceSets().getByName("main");
scalaDoc.getConventionMapping().map("classpath", new Callable<FileCollection>() {
@Override
public FileCollection call() throws Exception {
ConfigurableFileCollection files = project.files();
files.from(main.getOutput());
files.from(main.getCompileClasspath());
return files;
}
});
scalaDoc.setSource(InvokerHelper.invokeMethod(main, "getScala", null));
}
});
ScalaDoc scalaDoc = project.getTasks().create(SCALA_DOC_TASK_NAME, ScalaDoc.class);
scalaDoc.setDescription("Generates Scaladoc for the main source code.");
scalaDoc.setGroup(JavaBasePlugin.DOCUMENTATION_GROUP);
}
Aggregations