Rewrite Checksum util class (#1304)

* Rewrite Checksum util class as the old one was annoying me.

* Small cleanup in UnpickService

* Test fixes & cleanup

* Fix build

* Fix OfflineModeTest
This commit is contained in:
modmuss
2025-05-07 12:13:35 +01:00
committed by GitHub
parent eff00a1c30
commit 0a35910c63
22 changed files with 150 additions and 152 deletions

View File

@@ -409,17 +409,13 @@ public abstract class GenerateSourcesTask extends AbstractLoomTask {
getLogger().info("Decompile cache data: {}", sj);
try {
return Checksum.sha256Hex(sj.toString().getBytes(StandardCharsets.UTF_8));
} catch (IOException e) {
throw new UncheckedIOException(e);
}
return Checksum.of(sj.toString()).sha256().hex();
}
private String getDecompilerCheckKey() {
var sj = new StringJoiner(",");
sj.add(decompilerOptions.getDecompilerClassName().get());
sj.add(Checksum.fileCollectionHash(decompilerOptions.getClasspath()));
sj.add(Checksum.of(decompilerOptions.getClasspath()).sha256().hex());
for (Map.Entry<String, String> entry : decompilerOptions.getOptions().get().entrySet()) {
sj.add(entry.getKey() + "=" + entry.getValue());