+/**
+ * Gathers modifications performed on the original binaries and sources,
+ * especially in order to comply with their license requirements.
+ */
+class A2Origin {
+ Set<String> modified = new TreeSet<>();
+ Set<String> deleted = new TreeSet<>();
+ Set<String> added = new TreeSet<>();
+ Set<String> moved = new TreeSet<>();
+
+ /** Append changes to the A2-ORIGIN/changes file. */
+ void appendChanges(Path baseDirectory) throws IOException {
+ Path changesFile = baseDirectory.resolve("A2-ORIGIN/changes");
+ Files.createDirectories(changesFile.getParent());
+ try (BufferedWriter writer = Files.newBufferedWriter(changesFile, StandardOpenOption.APPEND,
+ StandardOpenOption.CREATE)) {
+ for (String msg : modified)
+ writer.write("- Modified " + msg + ".\n");
+ for (String msg : added)
+ writer.write("- Added " + msg + ".\n");
+ for (String msg : deleted)
+ writer.write("- Deleted " + msg + ".\n");
+ for (String msg : moved)
+ writer.write("- Moved " + msg + ".\n");
+ }
+ }
+}
+