Java 类org.gradle.api.specs.NotSpec 实例源码

项目:DexKnifePlugin    文件:DexSplitTools.java   
private static Spec<FileTreeElement> getMaindexSpec(PatternSet patternSet) {
        Spec<FileTreeElement> maindexSpec = null;

        if (patternSet != null) {
            Spec<FileTreeElement> includeSpec = null;
            Spec<FileTreeElement> excludeSpec = null;

            if (!patternSet.getIncludes().isEmpty()) {
                includeSpec = patternSet.getAsIncludeSpec();
            }

            if (!patternSet.getExcludes().isEmpty()) {
                excludeSpec = patternSet.getAsExcludeSpec();
            }

            if (includeSpec != null && excludeSpec != null) {
                maindexSpec = new OrSpec<>(includeSpec, new NotSpec<>(excludeSpec));
            } else {
                if (excludeSpec != null) { // only exclude
                    maindexSpec = new NotSpec<>(excludeSpec);
                } else if (includeSpec != null) { //  only include
                    maindexSpec = includeSpec;
                }
            }
        }

//        if (maindexSpec == null) {
//            maindexSpec = Specs.satisfyAll();
//        }

        return maindexSpec;
    }
项目:gradle-avro-plugin    文件:GenerateAvroJavaTask.java   
private void failOnUnsupportedFiles() {
    FileCollection unsupportedFiles = filterSources(new NotSpec<File>(new FileExtensionSpec(SUPPORTED_EXTENSIONS)));
    if (!unsupportedFiles.isEmpty()) {
        throw new GradleException(
            String.format("Unsupported file extension for the following files: %s", unsupportedFiles));
    }
}
项目:gradle-avro-plugin    文件:GenerateAvroProtocolTask.java   
private void failOnUnsupportedFiles() {
    FileCollection unsupportedFiles = filterSources(new NotSpec<>(new FileExtensionSpec(IDL_EXTENSION)));
    if (!unsupportedFiles.isEmpty()) {
        throw new GradleException(
                String.format("Unsupported file extension for the following files: %s", unsupportedFiles));
    }
}
项目:Pushjet-Android    文件:DefaultCopySpec.java   
public CopySpec filesNotMatching(String pattern, Action<? super FileCopyDetails> action) {
    Spec<RelativePath> matcher = PatternMatcherFactory.getPatternMatcher(true, isCaseSensitive(), pattern);
    return eachFile(
            new MatchingCopyAction(new NotSpec<RelativePath>(matcher), action));
}
项目:Pushjet-Android    文件:DefaultCopySpec.java   
public CopySpec filesNotMatching(String pattern, Action<? super FileCopyDetails> action) {
    Spec<RelativePath> matcher = PatternMatcherFactory.getPatternMatcher(true, isCaseSensitive(), pattern);
    return eachFile(
            new MatchingCopyAction(new NotSpec<RelativePath>(matcher), action));
}