Serialize resource pack snapshots with AstraPlus asset exports
This commit is contained in:
+1
-1
@@ -3,7 +3,7 @@ plugins {
|
|||||||
id("net.neoforged.moddev") version "2.0.146"
|
id("net.neoforged.moddev") version "2.0.146"
|
||||||
}
|
}
|
||||||
group = "online.astradev"
|
group = "online.astradev"
|
||||||
version = "0.2.0"
|
version = "0.2.1"
|
||||||
repositories {
|
repositories {
|
||||||
mavenCentral()
|
mavenCentral()
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -72,6 +72,14 @@ public final class PackBuilder {
|
|||||||
}
|
}
|
||||||
|
|
||||||
private int writeArchive(Path contents, Path target, String resourceVersion) throws IOException {
|
private int writeArchive(Path contents, Path target, String resourceVersion) throws IOException {
|
||||||
|
// Shared with server-side exporters (AstraPlus). A build must see one complete asset generation.
|
||||||
|
String lock = "AstraPacks:contents:" + contents.toAbsolutePath().normalize().toString().toLowerCase(java.util.Locale.ROOT);
|
||||||
|
synchronized (lock.intern()) {
|
||||||
|
return writeLockedArchive(contents, target, resourceVersion);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private int writeLockedArchive(Path contents, Path target, String resourceVersion) throws IOException {
|
||||||
int files = 0;
|
int files = 0;
|
||||||
long totalBytes = 0;
|
long totalBytes = 0;
|
||||||
try (var paths = Files.walk(contents);
|
try (var paths = Files.walk(contents);
|
||||||
|
|||||||
Reference in New Issue
Block a user