当前位置: 首页>>代码示例>>Java>>正文


Java ConfigurableFileTree类代码示例

本文整理汇总了Java中org.gradle.api.file.ConfigurableFileTree的典型用法代码示例。如果您正苦于以下问题:Java ConfigurableFileTree类的具体用法?Java ConfigurableFileTree怎么用?Java ConfigurableFileTree使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。


ConfigurableFileTree类属于org.gradle.api.file包,在下文中一共展示了ConfigurableFileTree类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: getAwSourceOutputDir

import org.gradle.api.file.ConfigurableFileTree; //导入依赖的package包/类
public List<ConfigurableFileTree> getAwSourceOutputDir(AwbBundle awbBundle) {
    Project project = scope.getGlobalScope().getProject();
    // Build the list of source folders.
    ImmutableList.Builder<ConfigurableFileTree> sourceSets = ImmutableList.builder();

    // then all the generated src folders.
    if (getAwbRClassSourceOutputDir(awbBundle) != null) {
        sourceSets.add(project.fileTree(getAwbRClassSourceOutputDir(awbBundle)));
    }

    if (scope.getGlobalScope().getExtension().getDataBinding().isEnabled()) {
        sourceSets.add(project.fileTree(getAwbClassOutputForDataBinding(awbBundle)));
    }

    return sourceSets.build();
}
 
开发者ID:alibaba,项目名称:atlas,代码行数:17,代码来源:AppVariantContext.java

示例2: findBukkitBuildToRun

import org.gradle.api.file.ConfigurableFileTree; //导入依赖的package包/类
private Integer findBukkitBuildToRun() throws IOException
{
    final ConfigurableFileTree bukkitFiles = getProject().fileTree(new File(getProject().getBuildDir(), "bukkit"));
    bukkitFiles.include("bukkit-*.jar");

    int currentLatestBuildNum = -1;
    for (final File bukkitFile : bukkitFiles)
    {
        final String fileName = bukkitFile.getName();
        int buildNum = Integer.parseInt(fileName.substring(fileName.indexOf("-") + 1, fileName.indexOf(".")));
        if (buildNum > currentLatestBuildNum)
        {
            currentLatestBuildNum = buildNum;
        }
    }

    return currentLatestBuildNum;
}
 
开发者ID:Monofraps,项目名称:GradleBukkit,代码行数:19,代码来源:RunBukkit.java

示例3: validate

import org.gradle.api.file.ConfigurableFileTree; //导入依赖的package包/类
@Override
protected void validate(String propertyName, Object value, Collection<String> messages) {
    File fileValue = (value instanceof ConfigurableFileTree) ? ((ConfigurableFileTree) value).getDir() : (File) value;
    if (!fileValue.exists()) {
        messages.add(String.format("Directory '%s' specified for property '%s' does not exist.", fileValue, propertyName));
    } else if (!fileValue.isDirectory()) {
        messages.add(String.format("Directory '%s' specified for property '%s' is not a directory.", fileValue, propertyName));
    }
}
 
开发者ID:lxxlxx888,项目名称:Reer,代码行数:10,代码来源:InputDirectoryPropertyAnnotationHandler.java

示例4: execute

import org.gradle.api.file.ConfigurableFileTree; //导入依赖的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

示例5: filesFor

import org.gradle.api.file.ConfigurableFileTree; //导入依赖的package包/类
private FileCollection filesFor(final Algorithm algo) {
    return getProject().fileTree(getOutputDir(), new Action<ConfigurableFileTree>() {
        @Override
        public void execute(ConfigurableFileTree files) {
            files.include("**/*." + algo.toString().toLowerCase());
        }
    });
}
 
开发者ID:gradle,项目名称:gradle-checksum,代码行数:9,代码来源:Checksum.java

示例6: Parser

import org.gradle.api.file.ConfigurableFileTree; //导入依赖的package包/类
/**
 * Create a new parser object which will loop through the lines of the file
 * looking for copyright notices and (potentially) update them
 * 
 * @param project The Gradle project
 * @param extension The plugin extension with the options
 */
public Parser(Project project, CopyrightrPluginExtension extension) {
	this.logger = project.getLogger();
	this.copyrightHolder = extension.getCopyrightHolder();

	this.includes = extension.getIncludes();
	this.excludes = extension.getExcludes();
	this.dryRun = extension.getDryRun();
	this.onlyReplaceFirst = extension.getOnlyReplaceFirst();
	this.yearSeparator = extension.getYearSeparator();
	this.failOnMissing = extension.getFailOnMissing();

	// compile the patterns to ensure that they work
	for (String pattern : PATTERNS) {
		String patternFormat = String.format("%s%s%s%s", pattern, ".*", Pattern.quote(copyrightHolder), ".*$");
		compiledPatterns.add(Pattern.compile(patternFormat));
		logger.debug("Compiled pattern:"  + Pattern.compile(patternFormat).pattern());
	}

	String absoluteProjectPath = project.getProjectDir().getAbsolutePath();

	Map<String, Object> map  = new HashMap<String, Object>();
	map.put(KEY_DIR, absoluteProjectPath);
	map.put(KEY_INCLUDES, includes);
	map.put(KEY_EXCLUDES, excludes);

	ConfigurableFileTree fileTree = project.fileTree(map);
	asFileTree = fileTree.getAsFileTree();
}
 
开发者ID:synapticloop,项目名称:copyrightr,代码行数:36,代码来源:Parser.java

示例7: getSassFiles

import org.gradle.api.file.ConfigurableFileTree; //导入依赖的package包/类
FileCollection getSassFiles() {
    if(getSrcDir().exists() == false)
        throw new RuntimeException("srcDir doesn't exists");
    if(getSrcDir().isDirectory() == false)
        throw new RuntimeException("srcDir isn't directory");

    ConfigurableFileTree fileTree = getProject().fileTree(getSrcDir());
    if(getInclude() != null)
        fileTree.include(getInclude());
    if(getExclude() != null)
        fileTree.exclude(getExclude());

    return fileTree;
}
 
开发者ID:kravemir,项目名称:GradleSassPlugin,代码行数:15,代码来源:AbstractSassCompileTask.java

示例8: getInputFiles

import org.gradle.api.file.ConfigurableFileTree; //导入依赖的package包/类
@InputFiles
FileCollection getInputFiles() {
    if(getSrcDir().exists() == false)
        throw new RuntimeException("srcDir doesn't exists");
    if(getSrcDir().isDirectory() == false)
        throw new RuntimeException("srcDir isn't directory");

    ConfigurableFileTree fileTree = getProject().fileTree(getSrcDir());
    return fileTree;
}
 
开发者ID:kravemir,项目名称:GradleSassPlugin,代码行数:11,代码来源:AbstractSassCompileTask.java

示例9: validate

import org.gradle.api.file.ConfigurableFileTree; //导入依赖的package包/类
public void validate(String propertyName, Object value, Collection<String> messages) {
    File fileValue = (value instanceof ConfigurableFileTree) ? ((ConfigurableFileTree) value).getDir() : (File) value;
    if (!fileValue.exists()) {
        messages.add(String.format("Directory '%s' specified for property '%s' does not exist.", fileValue, propertyName));
    } else if (!fileValue.isDirectory()) {
        messages.add(String.format("Directory '%s' specified for property '%s' is not a directory.", fileValue, propertyName));
    }
}
 
开发者ID:Pushjet,项目名称:Pushjet-Android,代码行数:9,代码来源:InputDirectoryPropertyAnnotationHandler.java

示例10: fileTree

import org.gradle.api.file.ConfigurableFileTree; //导入依赖的package包/类
public ConfigurableFileTree fileTree(Object baseDir) {
    return getFileOperations().fileTree(baseDir);
}
 
开发者ID:lxxlxx888,项目名称:Reer,代码行数:4,代码来源:DefaultProject.java

示例11: builtBy

import org.gradle.api.file.ConfigurableFileTree; //导入依赖的package包/类
public ConfigurableFileTree builtBy(Object... tasks) {
    buildDependency.add(tasks);
    return this;
}
 
开发者ID:lxxlxx888,项目名称:Reer,代码行数:5,代码来源:DefaultConfigurableFileTree.java

示例12: setBuiltBy

import org.gradle.api.file.ConfigurableFileTree; //导入依赖的package包/类
public ConfigurableFileTree setBuiltBy(Iterable<?> tasks) {
    buildDependency.setValues(tasks);
    return this;
}
 
开发者ID:lxxlxx888,项目名称:Reer,代码行数:5,代码来源:DefaultConfigurableFileTree.java

示例13: fileTree

import org.gradle.api.file.ConfigurableFileTree; //导入依赖的package包/类
@Override
public ConfigurableFileTree fileTree(Object baseDir) {
    return fileOperations.fileTree(baseDir);
}
 
开发者ID:lxxlxx888,项目名称:Reer,代码行数:5,代码来源:DefaultScript.java

示例14: setupPackageTasks

import org.gradle.api.file.ConfigurableFileTree; //导入依赖的package包/类
void setupPackageTasks(Project project, Task generateTask) {
	final File buildDir = new File(project.getBuildDir(), "npm_compile");
	final File distDir = getNpmOutputDir(project);

	project.getTasks().create(PublishTypescriptStubsTask.NAME, PublishTypescriptStubsTask.class);
	TSGeneratorConfig config = project.getExtensions().getByType(TSGeneratorConfig.class);

	Copy copySources = project.getTasks().create("processTypescript", Copy.class);
	copySources.from(config.getGenDir());
	copySources.into(buildDir);
	copySources.dependsOn(generateTask);

	// copy .npmrc file from root to working directory if available
	final File npmrcFile = new File(project.getProjectDir(), ".npmrc");
	if (npmrcFile.exists()) {
		copySources.getInputs().file(npmrcFile);
		copySources.doFirst(new Action<Task>() {
			@Override
			public void execute(Task task) {
				File targetFile = new File(buildDir, ".npmrc");
				buildDir.mkdirs();
				TypescriptUtils.copyFile(npmrcFile, targetFile);
			}
		});
	}

	CompileTypescriptStubsTask compileTypescriptTask = project.getTasks().create(CompileTypescriptStubsTask.NAME,
			CompileTypescriptStubsTask.class);
	try {
		NpmInstallTask npmInstall = (NpmInstallTask) project.getTasks().getByName("npmInstall");
		npmInstall.setWorkingDir(buildDir);
		npmInstall.dependsOn(copySources);
		npmInstall.getInputs().file(new File(buildDir, "package.json"));
		npmInstall.getOutputs().dir(new File(buildDir, "node_modules"));
		compileTypescriptTask.dependsOn(npmInstall);
	}
	catch (UnknownTaskException e) {
		LOGGER.warn("task not found, ok in testing", e);
	}

	ConfigurableFileTree fileTree = project.fileTree(buildDir);
	fileTree.include("package.json");
	fileTree.include(".npmrc");
	fileTree.include("**/*.ts");
	fileTree.exclude("**/*.d.ts");
	compileTypescriptTask.getInputs().files(fileTree);
	compileTypescriptTask.setWorkingDir(buildDir);
	compileTypescriptTask.getOutputs().dir(buildDir);

	ConfigurableFileTree assembleFileTree = project.fileTree(new File(buildDir, "src"));
	assembleFileTree.include("**/*.ts");
	assembleFileTree.include("**/*.js");
	assembleFileTree.include("**/*.js.map");

	Copy assembleSources = project.getTasks().create("assembleTypescript", Copy.class);
	assembleSources.from(assembleFileTree);
	assembleSources.from(new File(buildDir, "package.json"));
	assembleSources.into(distDir);
	assembleSources.dependsOn(compileTypescriptTask);
}
 
开发者ID:crnk-project,项目名称:crnk-framework,代码行数:61,代码来源:TSGeneratorPlugin.java

示例15: fileTree

import org.gradle.api.file.ConfigurableFileTree; //导入依赖的package包/类
public ConfigurableFileTree fileTree(Object baseDir) {
    return fileOperations.fileTree(baseDir);
}
 
开发者ID:Pushjet,项目名称:Pushjet-Android,代码行数:4,代码来源:DefaultScript.java


注:本文中的org.gradle.api.file.ConfigurableFileTree类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。