Skip to content

Commit

Permalink
Fix unpackSourcePatches and generate binary patches (#199)
Browse files Browse the repository at this point in the history
Co-authored-by: Marc Hermans <[email protected]>
  • Loading branch information
coehlrich and marchermans committed Jun 7, 2024
1 parent 281a603 commit 9c04626
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -282,11 +282,13 @@ public void hash(TaskInputs inputs) throws IOException {
});

for (File file : inputs.getFiles()) {
debugLog(task, "Hashing task input file: " + file.getAbsolutePath());
hasher.putString(file.getName());
final HashCode code = hashFunction.hashFile(file);
debugLog(task, "Hashing task input file hash: " + code);
hasher.putHash(code);
for (Path path : Files.walk(file.toPath()).filter(Files::isRegularFile).toList()) {
debugLog(task, "Hashing task input file: " + path.toAbsolutePath());
hasher.putString(path.getFileName().toString());
final HashCode code = hashFunction.hashFile(path.toFile());
debugLog(task, "Hashing task input file hash: " + code);
hasher.putHash(code);
}
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -250,7 +250,7 @@ public void runtime(final String neoFormVersion, Directory patches, Directory re
});

final TaskProvider<? extends UnpackZip> unpackZip = project.getTasks().register("unpackSourcePatches", UnpackZip.class, task -> {
task.getInput().from(createPatches.flatMap(WithOutput::getOutput));
task.getInput().from(project.zipTree(createPatches.flatMap(WithOutput::getOutput)));
task.getUnpackingTarget().set(patches);

CommonRuntimeExtension.configureCommonRuntimeTaskParameters(task, runtimeDefinition, workingDirectory);
Expand Down

0 comments on commit 9c04626

Please sign in to comment.