Skip to content

Commit

Permalink
Extract IncrementalMojoHelper and use it in the NpmMojo
Browse files Browse the repository at this point in the history
Incremental build now activated with the execution `incremental` configuration flag set to `true`
  • Loading branch information
rafalsatl committed Sep 20, 2024
1 parent 3bf8d6f commit e532439
Showing 1 changed file with 4 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ public IncrementalMojoHelper(String activationFlag, File workingDirectory, Log l
this.workingDirectory = workingDirectory;
this.log = log;

this.isActive = activationFlag.equals("true");
this.isActive = activationFlag != null && activationFlag.equals("true");
}

public boolean shouldExecute() {
Expand Down Expand Up @@ -62,7 +62,7 @@ public boolean shouldExecute() {

saveDigestCandidate(currDigest);
} catch (IOException e) {
getLog().error("Failed to determine if an incremental build is needed: " + e);
getLog().error("Failure while determining if an incremental build is needed: " + e);
}

return true;
Expand Down Expand Up @@ -232,12 +232,12 @@ static private String getFileExtension(String fileName) {
}

private static String createDigest(ArrayList<File> digestFiles) {
return createFileDigest(digestFiles)
return createFilesDigest(digestFiles)
+ createToolsDigest()
+ createEnvironmentDigest();
}

private static String createFileDigest(ArrayList<File> digestFiles) {
private static String createFilesDigest(ArrayList<File> digestFiles) {
return digestFiles.parallelStream().map(file -> {
try {
MessageDigest digest = MessageDigest.getInstance("SHA-256");
Expand Down

0 comments on commit e532439

Please sign in to comment.