Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Parallel execution of uptodate-properties #201

Merged
merged 1 commit into from
Apr 3, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@
import java.io.File;
import java.io.IOException;
import java.util.Map;
import java.util.Map.Entry;

import org.apache.maven.plugin.MojoExecutionException;
import org.apache.maven.plugin.MojoFailureException;
Expand Down Expand Up @@ -63,11 +62,11 @@ protected void execute(UpToDatePropertySetting config) throws MojoExecutionExcep
// Treat a file set that yields no files as intrinsically out of date.
upToDate = !includedFiles.isEmpty();

for (Entry<String, String> entry : includedFiles.entrySet()) {
upToDate &= includedFiles.entrySet().parallelStream().allMatch(entry -> {
// If targetFile is out of date WRT srcFile, note the fact and stop processing.
File srcFile = getFile(fileSet, false, entry.getKey());
File targetFile = getFile(fileSet, true, entry.getValue());
upToDate = isUpToDate(srcFile, targetFile);
boolean isUpToDate = isUpToDate(srcFile, targetFile);

if (getLog().isDebugEnabled()) {
try {
Expand All @@ -76,7 +75,7 @@ protected void execute(UpToDatePropertySetting config) throws MojoExecutionExcep
msg.append(" (nonexistent)");
}
msg.append("\n\tis ")
.append(upToDate ? "up to date" : "out of date")
.append(isUpToDate ? "up to date" : "out of date")
.append(" with respect to \n\t")
.append(srcFile.getCanonicalPath());
if (!srcFile.exists()) {
Expand All @@ -89,10 +88,8 @@ protected void execute(UpToDatePropertySetting config) throws MojoExecutionExcep
}
}

if (!upToDate) {
break;
}
}
return isUpToDate;
});
} catch (MapperException e) {
throw new MojoExecutionException("", e);
}
Expand Down