in build-tools/src/main/java/co/elastic/otel/android/compilation/tools/tasks/CreateNoticeTask.java [98:114]
private void saveMetadata() {
if (!getDependenciesHashFile().isPresent()) {
Project project = getProject();
project.getLogger().lifecycle("Skipping metadata saving for project: " + project.getName());
return;
}
File dependenciesHashFile = getDependenciesHashFile().get().getAsFile();
File metadataFile = getMetadataOutputFile().get().getAsFile();
try {
String dependenciesHash = FileUtils.readFileToString(dependenciesHashFile, StandardCharsets.UTF_8);
NoticeMetadataHandler noticeMetadataHandler = NoticeMetadataHandler.create();
noticeMetadataHandler.setDependenciesHash(dependenciesHash);
noticeMetadataHandler.save(metadataFile);
} catch (IOException e) {
throw new RuntimeException(e);
}
}