/** * 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<>())); }
/** * 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<>())); }
/** * Create an annotation JAR for a JAR file * * @param jarFile JAR file to process * @return <code>true</code> if nullability information was found */ protected boolean createAnnotationJar(File jarFile) { File annotationJarFile = getTargetFile(jarFile); boolean result = withTempFile("annotations", ".zip", tempFile -> { try { boolean annotated = createAnnotationJar(jarFile, tempFile); if (annotated) { Files.move(tempFile, annotationJarFile); } else { Files.write(new byte[0], annotationJarFile); } return annotated; } catch (Exception e) { throw new GradleException(String.format("Could not read JAR '%s'.", jarFile), e); } }); return result; }
/** * Create an annotation JAR for a JAR file * * @param jarFile JAR file to process * @return <code>true</code> if nullability information was found */ protected boolean createAnnotationJar(File jarFile) { File annotationJarFile = getTargetFile(jarFile); boolean result = withTempFile("annotations", ".zip", tempFile -> { try { boolean annotated = createAnnotationJar(jarFile, tempFile); if (annotated) { Files.move(tempFile, annotationJarFile); } else { Files.write(new byte[0], annotationJarFile); } return annotated; } catch (Exception e) { throw new GradleException(String.format("Could not read JAR '%s'.", jarFile), e); } }); return result; }