Skip to content

Commit

Permalink
Fix multiple AT files not working when final file name matches
Browse files Browse the repository at this point in the history
  • Loading branch information
pupnewfster committed Nov 9, 2023
1 parent 999892f commit ba3749b
Showing 1 changed file with 10 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,16 @@ public static TaskProvider<? extends AccessTransformer> createAccessTransformer(

final TaskProvider<? extends WithOutput> provider = definition.getSpecification().getProject().getTasks().register(name, ArtifactProvider.class, task -> {
task.getInput().set(file);
task.getOutput().set(new File(workspaceDirectory, "accesstransformers/" + namePreFix + "/" + file.getName()));
String outputFileName = file.getName();
if (index > 0) {
int extensionDot = outputFileName.lastIndexOf('.');
if (extensionDot == -1) {
outputFileName += "_" + index;
} else {
outputFileName = outputFileName.substring(0, extensionDot) + "_" + index + outputFileName.substring(extensionDot);
}
}
task.getOutput().set(new File(workspaceDirectory, "accesstransformers/" + namePreFix + "/" + outputFileName));
});

fileProducingTasks.add(provider);
Expand Down

0 comments on commit ba3749b

Please sign in to comment.