/** * 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; }