mirror of
https://github.com/architectury/architectury-loom.git
synced 2026-03-28 04:07:01 -05:00
Fix handling of classes with no package in CachedJarProcessor.
Closes #1121
This commit is contained in:
@@ -87,7 +87,7 @@ public record CachedJarProcessor(CachedFileStore<CachedData> fileStore, String b
|
||||
misses++;
|
||||
} else {
|
||||
final Path outputPath = existingSourcesFs.getPath(outputFileName);
|
||||
Files.createDirectories(outputPath.getParent());
|
||||
createParentDirectories(outputPath);
|
||||
Files.writeString(outputPath, entryData.sources());
|
||||
|
||||
entry.copyTo(inputFs.getRoot(), existingClassesFs.getRoot());
|
||||
@@ -226,7 +226,7 @@ public record CachedJarProcessor(CachedFileStore<CachedData> fileStore, String b
|
||||
final Path outputPath = outputFs.getRoot().resolve(existingPath.toString());
|
||||
|
||||
LOGGER.debug("Copying existing entry to output: {}", existingPath);
|
||||
Files.createDirectories(outputPath.getParent());
|
||||
createParentDirectories(outputPath);
|
||||
Files.copy(existingPath, outputPath);
|
||||
}
|
||||
}
|
||||
@@ -300,4 +300,14 @@ public record CachedJarProcessor(CachedFileStore<CachedData> fileStore, String b
|
||||
*/
|
||||
public record FullWorkJob(Path incomplete, Path output, Map<String, String> outputNameMap) implements WorkToDoJob {
|
||||
}
|
||||
|
||||
private static void createParentDirectories(Path path) throws IOException {
|
||||
final Path parent = path.getParent();
|
||||
|
||||
if (parent == null) {
|
||||
return;
|
||||
}
|
||||
|
||||
Files.createDirectories(parent);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user