FileCollection variantCompileClasspath = getJarDependencies(); FileCollection uft = new UnionFileCollection(javaCompiler.getSource(), project.fileTree(destinationFolder)); javaCompiler.setSource(uft); logger.debug("Analyzing configuration: " + variantCompileClasspath.getFiles());
@Override public void apply(Project project) { GeneratePluginExtension generatePluginExtension = project.getExtensions().create(EXTENSION_NAME, GeneratePluginExtension.class, project); GenerateTask generateTask = project.getTasks().create(TASK_NAME, GenerateTask.class); generateTask.setGroup(BasePlugin.BUILD_GROUP); generateTask.setDescription("Generates DDL scripts based on JPA model."); generateTask.setExtension(generatePluginExtension); generateTask.dependsOn(JavaBasePlugin.BUILD_TASK_NAME); project.afterEvaluate(evaluatedProject -> { fillDefaults(evaluatedProject, generatePluginExtension); SourceSetContainer sourceSets = (SourceSetContainer) project.getProperties().get("sourceSets"); Set<File> paths; if (sourceSets != null) { UnionFileCollection mainClasspath = (UnionFileCollection) sourceSets.getByName(SourceSet.MAIN_SOURCE_SET_NAME).getRuntimeClasspath(); paths = mainClasspath.getFiles(); } else { paths = new HashSet<>(); } generateTask.setOutputClassesDirs(paths); }); }
public FileCollection plus(FileCollection collection) { return new UnionFileCollection(this, collection); }
/** * Returns the classpath used to compile this source. * * @return The classpath. Never returns null. * @see SourceSet#getCompileClasspath() */ protected FileCollection getCompileClasspath(AndroidSourceSet androidSourceSet) { List<FileCollection> fileCollections = getAllVariants(androidSourceSet) .map(BaseVariant::getJavaCompiler) .filter(JavaCompile.class::isInstance) .map(JavaCompile.class::cast) .map(JavaCompile::getClasspath) .collect(Collectors.toList()); return new UnionFileCollection(fileCollections); }
public FileCollection resolve() { try { walker.add(queue); return new UnionFileCollection(walker.findValues()); } finally { queue.clear(); } }
mergedOptions.setSystemProperties(mergedSystemProperties); mergedOptions.setBootstrapClasspath(new UnionFileCollection(getBootstrapClasspath(), options.getBootstrapClasspath()));