From e532439ea1545853f173a618f335eeed78e6cadc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Rafa=C5=82=20Struz=CC=87yk?= Date: Fri, 20 Sep 2024 15:06:49 +0200 Subject: [PATCH] Extract IncrementalMojoHelper and use it in the NpmMojo Incremental build now activated with the execution `incremental` configuration flag set to `true` --- .../plugins/frontend/mojo/IncrementalMojoHelper.java | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/frontend-maven-plugin/src/main/java/com/github/eirslett/maven/plugins/frontend/mojo/IncrementalMojoHelper.java b/frontend-maven-plugin/src/main/java/com/github/eirslett/maven/plugins/frontend/mojo/IncrementalMojoHelper.java index 00fb884e4..110ddeab7 100644 --- a/frontend-maven-plugin/src/main/java/com/github/eirslett/maven/plugins/frontend/mojo/IncrementalMojoHelper.java +++ b/frontend-maven-plugin/src/main/java/com/github/eirslett/maven/plugins/frontend/mojo/IncrementalMojoHelper.java @@ -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() { @@ -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; @@ -232,12 +232,12 @@ static private String getFileExtension(String fileName) { } private static String createDigest(ArrayList digestFiles) { - return createFileDigest(digestFiles) + return createFilesDigest(digestFiles) + createToolsDigest() + createEnvironmentDigest(); } - private static String createFileDigest(ArrayList digestFiles) { + private static String createFilesDigest(ArrayList digestFiles) { return digestFiles.parallelStream().map(file -> { try { MessageDigest digest = MessageDigest.getInstance("SHA-256");