org.gradle.api.specs.NotSpec Java Examples

The following examples show how to use org.gradle.api.specs.NotSpec. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: DexSplitTools.java    From DexKnifePlugin with Apache License 2.0 5 votes vote down vote up
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;
    }
 
Example #2
Source File: ResolveAvroDependenciesTask.java    From gradle-avro-plugin with Apache License 2.0 5 votes vote down vote up
private void failOnUnsupportedFiles() {
    FileCollection unsupportedFiles = filterSources(new NotSpec<>(new FileExtensionSpec(SCHEMA_EXTENSION)));
    if (!unsupportedFiles.isEmpty()) {
        throw new GradleException(
            String.format("Unsupported file extension for the following files: %s", unsupportedFiles));
    }
}
 
Example #3
Source File: GenerateAvroJavaTask.java    From gradle-avro-plugin with Apache License 2.0 5 votes vote down vote up
private void failOnUnsupportedFiles() {
    FileCollection unsupportedFiles = filterSources(new NotSpec<>(new FileExtensionSpec(SUPPORTED_EXTENSIONS)));
    if (!unsupportedFiles.isEmpty()) {
        throw new GradleException(
            String.format("Unsupported file extension for the following files: %s", unsupportedFiles));
    }
}
 
Example #4
Source File: GenerateAvroProtocolTask.java    From gradle-avro-plugin with Apache License 2.0 5 votes vote down vote up
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));
    }
}
 
Example #5
Source File: GenerateAvroSchemaTask.java    From gradle-avro-plugin with Apache License 2.0 5 votes vote down vote up
private void failOnUnsupportedFiles() {
    FileCollection unsupportedFiles = filterSources(new NotSpec<>(new FileExtensionSpec(PROTOCOL_EXTENSION)));
    if (!unsupportedFiles.isEmpty()) {
        throw new GradleException(
            String.format("Unsupported file extension for the following files: %s", unsupportedFiles));
    }
}
 
Example #6
Source File: DefaultCopySpec.java    From pushfish-android with BSD 2-Clause "Simplified" License 4 votes vote down vote up
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));
}
 
Example #7
Source File: DefaultCopySpec.java    From pushfish-android with BSD 2-Clause "Simplified" License 4 votes vote down vote up
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));
}
 
Example #8
Source File: DefaultCopySpec.java    From Pushjet-Android with BSD 2-Clause "Simplified" License 4 votes vote down vote up
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));
}
 
Example #9
Source File: DefaultCopySpec.java    From Pushjet-Android with BSD 2-Clause "Simplified" License 4 votes vote down vote up
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));
}