当前位置: 首页>>代码示例>>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;未经允许,请勿转载。