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; }
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)); } }
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)); } }
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)); }