當前位置: 首頁>>代碼示例>>Java>>正文


Java FileCollection類代碼示例

本文整理匯總了Java中org.gradle.api.file.FileCollection的典型用法代碼示例。如果您正苦於以下問題:Java FileCollection類的具體用法?Java FileCollection怎麽用?Java FileCollection使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。


FileCollection類屬於org.gradle.api.file包,在下文中一共展示了FileCollection類的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。

示例1: createInstallTask

import org.gradle.api.file.FileCollection; //導入依賴的package包/類
public static void createInstallTask(final NativeBinarySpecInternal binary, final NativeInstallationSpec installation, final NativeExecutableFileSpec executable, final BinaryNamingScheme namingScheme) {
    binary.getTasks().create(namingScheme.getTaskName("install"), InstallExecutable.class, new Action<InstallExecutable>() {
        @Override
        public void execute(InstallExecutable installTask) {
            installTask.setDescription("Installs a development image of " + binary.getDisplayName());
            installTask.setGroup(LifecycleBasePlugin.BUILD_GROUP);
            installTask.setToolChain(executable.getToolChain());
            installTask.setPlatform(binary.getTargetPlatform());
            installTask.setExecutable(executable.getFile());
            installTask.setDestinationDir(installation.getDirectory());
            //TODO:HH wire binary libs via executable
            installTask.lib(new BinaryLibs(binary) {
                @Override
                protected FileCollection getFiles(NativeDependencySet nativeDependencySet) {
                    return nativeDependencySet.getRuntimeFiles();
                }
            });

            //TODO:HH installTask.dependsOn(executable)
            installTask.dependsOn(binary);
        }
    });
}
 
開發者ID:lxxlxx888,項目名稱:Reer,代碼行數:24,代碼來源:NativeComponents.java

示例2: convertInto

import org.gradle.api.file.FileCollection; //導入依賴的package包/類
public void convertInto(Object element, Collection<? super MinimalFileCollection> result, PathToFileResolver resolver) {
    if (element instanceof DefaultFileCollectionResolveContext) {
        DefaultFileCollectionResolveContext nestedContext = (DefaultFileCollectionResolveContext) element;
        result.addAll(nestedContext.resolveAsMinimalFileCollections());
    } else if (element instanceof MinimalFileCollection) {
        MinimalFileCollection collection = (MinimalFileCollection) element;
        result.add(collection);
    } else if (element instanceof FileCollection) {
        throw new UnsupportedOperationException(String.format("Cannot convert instance of %s to MinimalFileCollection", element.getClass().getSimpleName()));
    } else if (element instanceof TaskDependency) {
        // Ignore
        return;
    } else {
        result.add(new ListBackedFileSet(resolver.resolve(element)));
    }
}
 
開發者ID:lxxlxx888,項目名稱:Reer,代碼行數:17,代碼來源:DefaultFileCollectionResolveContext.java

示例3: execute

import org.gradle.api.file.FileCollection; //導入依賴的package包/類
public void execute(FileCollection classpath, final FileCollection executionData, final File destinationFile) {
    ant.withClasspath(classpath).execute(new Closure<Object>(this, this) {
        @SuppressWarnings("UnusedDeclaration")
        public Object doCall(Object it) {
            final GroovyObjectSupport antBuilder = (GroovyObjectSupport) it;
            antBuilder.invokeMethod("taskdef", ImmutableMap.of(
                "name", "jacocoMerge",
                "classname", "org.jacoco.ant.MergeTask"
            ));
            Map<String, File> arguments = ImmutableMap.of("destfile", destinationFile);
            antBuilder.invokeMethod("jacocoMerge", new Object[]{arguments, new Closure<Object>(this, this) {
                public Object doCall(Object ignore) {
                    executionData.addToAntBuilder(antBuilder, "resources");
                    return null;
                }
            }});
            return null;
        }
    });
}
 
開發者ID:lxxlxx888,項目名稱:Reer,代碼行數:21,代碼來源:AntJacocoMerge.java

示例4: execute

import org.gradle.api.file.FileCollection; //導入依賴的package包/類
@Override
public void execute() {
    ImmutableMap.Builder<String, Object> options = ImmutableMap.builder();
    options.put("destDir", getDestinationDir());
    options.putAll(compileOptions.getDependOptions().optionMap());
    if (compileOptions.getDependOptions().isUseCache()) {
        options.put("cache", dependencyCacheDir);
    }

    final AntBuilder ant = antBuilderFactory.create();
    ant.getProject().addTaskDefinition("gradleDepend", AntDepend.class);
    ant.invokeMethod("gradleDepend", new Object[]{options.build(), new Closure<Object>(this, this) {
        @SuppressWarnings("UnusedDeclaration")
        public void doCall(Object ignore) {
            getSource().addToAntBuilder(ant, "src", FileCollection.AntType.MatchingTask);
        }
    }});
}
 
開發者ID:lxxlxx888,項目名稱:Reer,代碼行數:19,代碼來源:AntDependsStaleClassCleaner.java

示例5: registerWatchPoints

import org.gradle.api.file.FileCollection; //導入依賴的package包/類
@Override
public void registerWatchPoints(FileSystemSubset.Builder builder) {
    for (Dependency dependency : allDependencies) {
        if (dependency instanceof FileCollectionDependency) {
            FileCollection files = ((FileCollectionDependency) dependency).getFiles();
            ((FileCollectionInternal) files).registerWatchPoints(builder);
        }
    }
    super.registerWatchPoints(builder);
}
 
開發者ID:lxxlxx888,項目名稱:Reer,代碼行數:11,代碼來源:DefaultConfiguration.java

示例6: add

import org.gradle.api.file.FileCollection; //導入依賴的package包/類
@Override
public UnionFileTree add(FileCollection source) {
    if (!(source instanceof FileTree)) {
        throw new UnsupportedOperationException(String.format("Can only add FileTree instances to %s.", getDisplayName()));
    }

    sourceTrees.add(Cast.cast(FileTreeInternal.class, source));
    return this;
}
 
開發者ID:lxxlxx888,項目名稱:Reer,代碼行數:10,代碼來源:UnionFileTree.java

示例7: isEmpty

import org.gradle.api.file.FileCollection; //導入依賴的package包/類
@Override
public boolean isEmpty() {
    for (FileCollection collection : getSourceCollections()) {
        if (!collection.isEmpty()) {
            return false;
        }
    }
    return true;
}
 
開發者ID:lxxlxx888,項目名稱:Reer,代碼行數:10,代碼來源:CompositeFileCollection.java

示例8: fixed

import org.gradle.api.file.FileCollection; //導入依賴的package包/類
@Override
public FileCollection fixed(final String displayName, File... files) {
    return new FileCollectionAdapter(new ListBackedFileSet(files) {
        @Override
        public String getDisplayName() {
            return displayName;
        }
    });
}
 
開發者ID:lxxlxx888,項目名稱:Reer,代碼行數:10,代碼來源:DefaultFileCollectionFactory.java

示例9: execute

import org.gradle.api.file.FileCollection; //導入依賴的package包/類
@Override
public void execute(DataBindingExportBuildInfoTask task) {
    final BaseVariantData<? extends BaseVariantOutputData> variantData = appVariantContext.getScope()
        .getVariantData();
    task.setXmlProcessor(
        AwbXmlProcessor.getLayoutXmlProcessor(appVariantContext, awbBundle, dataBindingBuilder));
    task.setSdkDir(appVariantContext.getScope().getGlobalScope().getSdkHandler().getSdkFolder());
    task.setXmlOutFolder(appVariantContext.getAwbLayoutInfoOutputForDataBinding(awbBundle));

    ConventionMappingHelper.map(task, "compilerClasspath", new Callable<FileCollection>() {
        @Override
        public FileCollection call() {
            return appVariantContext.getScope().getJavaClasspath();
        }
    });
    ConventionMappingHelper
        .map(task, "compilerSources", new Callable<Iterable<ConfigurableFileTree>>() {
            @Override
            public Iterable<ConfigurableFileTree> call() throws Exception {
                return Iterables.filter(appVariantContext.getAwSourceOutputDir(awbBundle),
                                        new Predicate<ConfigurableFileTree>() {
                                            @Override
                                            public boolean apply(ConfigurableFileTree input) {
                                                File
                                                    dataBindingOut = appVariantContext
                                                    .getAwbClassOutputForDataBinding(awbBundle);
                                                return !dataBindingOut.equals(input.getDir());
                                            }
                                        });
            }
        });

    task.setExportClassListTo(variantData.getType().isExportDataBindingClassList() ?
                                  new File(appVariantContext.getAwbLayoutFolderOutputForDataBinding(awbBundle),
                                           "_generated.txt") : null);
    //task.setPrintMachineReadableErrors(printMachineReadableErrors);
    task.setDataBindingClassOutput(appVariantContext.getAwbClassOutputForDataBinding(awbBundle));
}
 
開發者ID:alibaba,項目名稱:atlas,代碼行數:39,代碼來源:AwbDataBindingExportBuildInfoTask.java

示例10: getFilesToSign

import org.gradle.api.file.FileCollection; //導入依賴的package包/類
/**
 * All of the files that will be signed by this operation.
 */
public FileCollection getFilesToSign() {
    return newSignatureFileCollection(new Function<Signature, File>() {
        @Override
        public File apply(Signature input) {
            return input.getToSign();
        }
    });
}
 
開發者ID:lxxlxx888,項目名稱:Reer,代碼行數:12,代碼來源:SignOperation.java

示例11: createWorkerProcess

import org.gradle.api.file.FileCollection; //導入依賴的package包/類
private FindBugsWorker createWorkerProcess(File workingDir, WorkerProcessFactory workerFactory, FileCollection findBugsClasspath, FindBugsSpec spec) {
    SingleRequestWorkerProcessBuilder<FindBugsWorker> builder = workerFactory.singleRequestWorker(FindBugsWorker.class, FindBugsExecuter.class);
    builder.setBaseName("Gradle FindBugs Worker");
    builder.applicationClasspath(findBugsClasspath);
    builder.sharedPackages(Arrays.asList("edu.umd.cs.findbugs"));
    JavaExecHandleBuilder javaCommand = builder.getJavaCommand();
    javaCommand.setWorkingDir(workingDir);
    javaCommand.setMaxHeapSize(spec.getMaxHeapSize());
    return builder.build();
}
 
開發者ID:lxxlxx888,項目名稱:Reer,代碼行數:11,代碼來源:FindBugsWorkerManager.java

示例12: doResolve

import org.gradle.api.file.FileCollection; //導入依賴的package包/類
private <T> List<T> doResolve(Converter<? extends T> converter) {
    List<T> result = new ArrayList<T>();
    while (!queue.isEmpty()) {
        Object element = queue.remove(0);
        // TODO - need to sync with BuildDependenciesOnlyFileCollectionResolveContext
        if (element instanceof DefaultFileCollectionResolveContext) {
            DefaultFileCollectionResolveContext nestedContext = (DefaultFileCollectionResolveContext) element;
            converter.convertInto(nestedContext, result, fileResolver);
        } else if (element instanceof FileCollectionContainer) {
            FileCollectionContainer fileCollection = (FileCollectionContainer) element;
            resolveNested(fileCollection, result, converter);
        } else if (element instanceof FileCollection || element instanceof MinimalFileCollection) {
            converter.convertInto(element, result, fileResolver);
        } else if (element instanceof Task) {
            Task task = (Task) element;
            queue.add(0, task.getOutputs().getFiles());
        } else if (element instanceof TaskOutputs) {
            TaskOutputs outputs = (TaskOutputs) element;
            queue.add(0, outputs.getFiles());
        } else if (element instanceof Callable) {
            Callable callable = (Callable) element;
            Object callableResult = uncheckedCall(callable);
            if (callableResult != null) {
                queue.add(0, callableResult);
            }
        } else if (element instanceof Iterable) {
            Iterable<?> iterable = (Iterable) element;
            GUtil.addToCollection(queue.subList(0, 0), iterable);
        } else if (element instanceof Object[]) {
            Object[] array = (Object[]) element;
            GUtil.addToCollection(queue.subList(0, 0), Arrays.asList(array));
        } else {
            converter.convertInto(element, result, fileResolver);
        }
    }
    return result;
}
 
開發者ID:lxxlxx888,項目名稱:Reer,代碼行數:38,代碼來源:DefaultFileCollectionResolveContext.java

示例13: configureWithJavaPluginApplied

import org.gradle.api.file.FileCollection; //導入依賴的package包/類
private void configureWithJavaPluginApplied(final Project project, final EarPluginConvention earPluginConvention, PluginContainer plugins) {
    plugins.withType(JavaPlugin.class, new Action<JavaPlugin>() {
        public void execute(JavaPlugin javaPlugin) {
            final JavaPluginConvention javaPluginConvention = project.getConvention().findPlugin(JavaPluginConvention.class);

            SourceSet sourceSet = javaPluginConvention.getSourceSets().getByName(SourceSet.MAIN_SOURCE_SET_NAME);
            sourceSet.getResources().srcDir(new Callable() {
                public Object call() throws Exception {
                    return earPluginConvention.getAppDirName();
                }
            });
            project.getTasks().withType(Ear.class, new Action<Ear>() {
                public void execute(final Ear task) {
                    task.dependsOn(new Callable<FileCollection>() {
                        public FileCollection call() throws Exception {
                            return javaPluginConvention.getSourceSets().getByName(SourceSet.MAIN_SOURCE_SET_NAME)
                                    .getRuntimeClasspath();
                        }
                    });
                    task.from(new Callable<FileCollection>() {
                        public FileCollection call() throws Exception {
                            return javaPluginConvention.getSourceSets().getByName(SourceSet.MAIN_SOURCE_SET_NAME).getOutput();
                        }
                    });
                }
            });
        }
    });
}
 
開發者ID:lxxlxx888,項目名稱:Reer,代碼行數:30,代碼來源:EarPlugin.java

示例14: apply

import org.gradle.api.file.FileCollection; //導入依賴的package包/類
public void apply(Project project) {
    project.getPluginManager().apply(JavaScriptBasePlugin.class);

    JavaScriptExtension jsExtension = project.getExtensions().findByType(JavaScriptExtension.class);
    final RhinoExtension rhinoExtension = ((ExtensionAware) jsExtension).getExtensions().create(RhinoExtension.NAME, RhinoExtension.class);

    final Configuration configuration = addClasspathConfiguration(project.getConfigurations());
    configureDefaultRhinoDependency(configuration, project.getDependencies(), rhinoExtension);

    ConventionMapping conventionMapping = ((IConventionAware) rhinoExtension).getConventionMapping();
    conventionMapping.map("classpath", new Callable<Configuration>() {
        public Configuration call() {
            return configuration;
        }
    });
    conventionMapping.map("version", new Callable<String>() {
        public String call() {
            return RhinoExtension.DEFAULT_RHINO_DEPENDENCY_VERSION;
        }
    });

    project.getTasks().withType(RhinoShellExec.class, new Action<RhinoShellExec>() {
        public void execute(RhinoShellExec task) {
            task.getConventionMapping().map("classpath", new Callable<FileCollection>() {
                public FileCollection call() {
                    return rhinoExtension.getClasspath();
                }
            });
            task.getConventionMapping().map("main", new Callable<String>() {
                public String call() {
                    return RhinoExtension.RHINO_SHELL_MAIN;
                }
            });
            task.setClasspath(rhinoExtension.getClasspath());
        }
    });
}
 
開發者ID:lxxlxx888,項目名稱:Reer,代碼行數:38,代碼來源:RhinoPlugin.java

示例15: createScalaSdkFromPlatform

import org.gradle.api.file.FileCollection; //導入依賴的package包/類
private static ProjectLibrary createScalaSdkFromPlatform(ScalaPlatform platform, FileCollection scalaClasspath, boolean useScalaSdk) {
    String version = platform.getScalaVersion();
    if (useScalaSdk) {
        return createScalaSdkLibrary("scala-sdk-" + version, scalaClasspath);
    }
    return createProjectLibrary("scala-compiler-" + version, scalaClasspath);
}
 
開發者ID:lxxlxx888,項目名稱:Reer,代碼行數:8,代碼來源:IdeaScalaConfigurer.java


注:本文中的org.gradle.api.file.FileCollection類示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。