INNER CODE UNIT · Java
shouldIncludeFile
quarkusio/quarkus-super-heroes · .github/calculateModules.java:27
private static boolean shouldIncludeFile(String fileName) {
// Files in /deploy or <module-name>/deploy are generated by the build process,
// so they could skew which modules we "think" have changed
// So remove them and only look at the other changes
return Objects.nonNull(fileName) &&
!fileName.trim().isEmpty() &&
!fileName.trim().contains("deploy/");
}
private static Set<String> getChangedModules(String timeframe) throws IOException, InterruptedException {
// Use git log to get a list of all the files that changed in the timeframe
var process = ProcessBuilder.startPipeline(
List.of(
new ProcessBuilder("git", "log", "--pretty=format:", "--since=\"%s ago\"".formatted(timeframe), "--name-only"),
new ProcessBuilder("sort")
)
).getLast();