use of org.gradle.api.file.ConfigurableFileCollection 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);
}
use of org.gradle.api.file.ConfigurableFileCollection in project gradle by gradle.
the class DefaultIdeArtifactRegistry method getIdeArtifacts.
@Override
public FileCollection getIdeArtifacts(final Class<? extends IdeProjectMetadata> type) {
return fileOperations.files(new Callable<List<FileCollection>>() {
@Override
public List<FileCollection> call() {
return CollectionUtils.collect(getIdeArtifactMetadata(type), new Transformer<FileCollection, Reference<?>>() {
@Override
public FileCollection transform(Reference<?> result) {
ConfigurableFileCollection singleton = fileOperations.files(result.get().getFile());
singleton.builtBy(result.getBuildDependencies());
return singleton;
}
});
}
});
}
use of org.gradle.api.file.ConfigurableFileCollection in project crnk-framework by crnk-project.
the class ForkedGenerateTypescriptTask method initClassPath.
private void initClassPath() {
RuntimeClassLoaderFactory classLoaderFactory = new RuntimeClassLoaderFactory(getProject());
Set<File> classpath = new HashSet<>();
classpath.addAll(classLoaderFactory.getProjectLibraries());
try {
classpath.add(Paths.get(classLoaderFactory.getPluginUrl().toURI()).toFile());
} catch (URISyntaxException e) {
throw new IllegalStateException(e);
}
Project project = getProject();
ConfigurableFileCollection files = project.files(classpath.toArray());
setClasspath(files);
}
use of org.gradle.api.file.ConfigurableFileCollection in project gradle by gradle.
the class GroovyBasePlugin method configureGroovydoc.
private void configureGroovydoc() {
project.getTasks().withType(Groovydoc.class).configureEach(groovydoc -> {
groovydoc.getConventionMapping().map("groovyClasspath", () -> {
FileCollection groovyClasspath = groovyRuntime.inferGroovyClasspath(groovydoc.getClasspath());
// Jansi is required to log errors when generating Groovydoc
ConfigurableFileCollection jansi = project.getObjects().fileCollection().from(moduleRegistry.getExternalModule("jansi").getImplementationClasspath().getAsFiles());
return groovyClasspath.plus(jansi);
});
groovydoc.getConventionMapping().map("destinationDir", () -> javaPluginExtension().getDocsDir().dir("groovydoc").get().getAsFile());
groovydoc.getConventionMapping().map("docTitle", () -> projectExtension(ReportingExtension.class).getApiDocTitle());
groovydoc.getConventionMapping().map("windowTitle", () -> projectExtension(ReportingExtension.class).getApiDocTitle());
});
}
use of org.gradle.api.file.ConfigurableFileCollection in project gradle by gradle.
the class JvmPluginsHelper method configureForSourceSet.
private static void configureForSourceSet(final SourceSet sourceSet, final SourceDirectorySet sourceDirectorySet, AbstractCompile compile, final Project target) {
compile.setDescription("Compiles the " + sourceDirectorySet.getDisplayName() + ".");
compile.setSource(sourceSet.getJava());
ConfigurableFileCollection classpath = compile.getProject().getObjects().fileCollection();
classpath.from((Callable<Object>) () -> sourceSet.getCompileClasspath().plus(target.files(sourceSet.getJava().getClassesDirectory())));
compile.getConventionMapping().map("classpath", () -> classpath);
}
Aggregations