use of org.gradle.util.internal.Java9ClassReader in project gradle by gradle.
the class AbiExtractingClasspathContentHasher method hashClassBytes.
private void hashClassBytes(InputStream inputStream, Hasher hasher) throws IOException {
// Use the ABI as the hash
byte[] classBytes = ByteStreams.toByteArray(inputStream);
ApiClassExtractor extractor = new ApiClassExtractor(Collections.<String>emptySet());
Java9ClassReader reader = new Java9ClassReader(classBytes);
if (extractor.shouldExtractApiClassFrom(reader)) {
byte[] signature = extractor.extractApiClassFrom(reader);
if (signature != null) {
hasher.putBytes(signature);
}
}
}
Aggregations