本文整理汇总了Java中org.gradle.util.CollectionUtils.any方法的典型用法代码示例。如果您正苦于以下问题:Java CollectionUtils.any方法的具体用法?Java CollectionUtils.any怎么用?Java CollectionUtils.any使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.gradle.util.CollectionUtils
的用法示例。
在下文中一共展示了CollectionUtils.any方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: maybeGetPCHArgs
import org.gradle.util.CollectionUtils; //导入方法依赖的package包/类
protected List<String> maybeGetPCHArgs(final T spec, File sourceFile) {
if (spec.getPreCompiledHeader() == null) {
return Lists.newArrayList();
}
final IncludeDirectives includes = spec.getSourceFileIncludeDirectives().get(sourceFile);
final String header = spec.getPreCompiledHeader();
List<Include> headers = includes.getIncludesAndImports();
boolean usePCH = !headers.isEmpty() && header.equals(headers.get(0).getValue());
if (usePCH) {
return getPCHArgs(spec);
} else {
boolean containsHeader = CollectionUtils.any(headers, new Spec<Include>() {
@Override
public boolean isSatisfiedBy(Include include) {
return include.getValue().equals(header);
}
});
if (containsHeader) {
logger.log(LogLevel.WARN, getCantUsePCHMessage(spec.getPreCompiledHeader(), sourceFile));
}
return Lists.newArrayList();
}
}
示例2: sourceFilesUseMacroIncludes
import org.gradle.util.CollectionUtils; //导入方法依赖的package包/类
private boolean sourceFilesUseMacroIncludes(Collection<File> files, final CompilationState compilationState) {
// If we couldn't determine all dependencies of some files due to macros, we have to scan all include directories.
return CollectionUtils.any(files, new Spec<File>() {
@Override
public boolean isSatisfiedBy(File file) {
// If a macro was used for any #includes
return CollectionUtils.any(compilationState.getState(file).getResolvedIncludes(), new Spec<ResolvedInclude>() {
@Override
public boolean isSatisfiedBy(ResolvedInclude element) {
// Using macro
return element.isMaybeMacro();
}
});
}
});
}
示例3: isPreemptiveEnabled
import org.gradle.util.CollectionUtils; //导入方法依赖的package包/类
private boolean isPreemptiveEnabled(Collection<Authentication> authentications) {
return CollectionUtils.any(authentications, new Spec<Authentication>() {
@Override
public boolean isSatisfiedBy(Authentication element) {
return element instanceof BasicAuthentication;
}
});
}
示例4: hasTwirlSourceSetsWithJavaImports
import org.gradle.util.CollectionUtils; //导入方法依赖的package包/类
private static boolean hasTwirlSourceSetsWithJavaImports(PlayApplicationSpec playApplicationSpec) {
return CollectionUtils.any(playApplicationSpec.getSources().withType(TwirlSourceSet.class).values(), new Spec<TwirlSourceSet>() {
@Override
public boolean isSatisfiedBy(TwirlSourceSet twirlSourceSet) {
return twirlSourceSet.getDefaultImports() == TwirlImports.JAVA;
}
});
}