@OutputFiles public Map<String, File> getOutputFiles() { ArrayListMultimap<String, File> filesWithPotentialNameCollisions = ArrayListMultimap.create(); for (Signature signature : getSignatures()) { String name = JAVA_PARTS.matcher(signature.getName()).replaceAll("_"); if (name.length() > 0 && !Character.isJavaIdentifierStart(name.codePointAt(0))) { name = "_" + name.substring(1); } filesWithPotentialNameCollisions.put(name, signature.getToSign()); } Map<String, File> files = Maps.newHashMap(); for (Map.Entry<String, Collection<File>> entry : filesWithPotentialNameCollisions.asMap().entrySet()) { File[] filesWithSameName = entry.getValue().toArray(new File[0]); boolean hasMoreThanOneFileWithSameName = filesWithSameName.length > 1; for (int i = 0; i < filesWithSameName.length; i++) { File file = filesWithSameName[i]; String key = entry.getKey(); if (hasMoreThanOneFileWithSameName) { key += "$" + (i + 1); } files.put(key, file); } } return files; }
@Incubating @OutputFiles Map<String, File> getEnabledFileReportDestinations();
@Override public Class<? extends Annotation> getAnnotationType() { return OutputFiles.class; }
@OutputFiles private Collection<File> getOutputFiles() { return appVariantContext.manifestMap.values(); }
/** * Get the created annotation JARs * * @return Created annotation JARs */ @OutputFiles public Set<File> getAnnotationJars() { return this.jars.stream().map(f -> getTargetFile(Validate.notNull(f))) .collect(Collectors.toCollection(() -> new HashSet<>())); }
@OutputFiles public Set<File> getEnabledFileReportDestinations() { return CollectionUtils.collect(CollectionUtils.filter(getEnabled(), IS_FILE_OUTPUT_TYPE), toFile); }
@OutputFiles public FileCollection getBypassedArchives() throws MalformedPatternException { return sourceFiles.filter(new FilterSpec("Bypassing archive", toPatterns(archiveBypasses), true)); }
/** * @return a list of files created by this task (i.e. the destination files) */ @OutputFiles public List<File> getOutputFiles() { return action.getOutputFiles(); }