From b21d77661aa4a2243bc73ce49315d3afe19ac4a5 Mon Sep 17 00:00:00 2001 From: Arun Venmany Date: Thu, 16 Jan 2025 21:24:33 +0530 Subject: [PATCH] lastBuildFileChange will be updated only when a recompile is needed Signed-off-by: Arun Venmany --- .../openliberty/tools/common/plugins/util/DevUtil.java | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/src/main/java/io/openliberty/tools/common/plugins/util/DevUtil.java b/src/main/java/io/openliberty/tools/common/plugins/util/DevUtil.java index bcb3d149..0ff8648d 100644 --- a/src/main/java/io/openliberty/tools/common/plugins/util/DevUtil.java +++ b/src/main/java/io/openliberty/tools/common/plugins/util/DevUtil.java @@ -4055,14 +4055,16 @@ private void initWatchLoop() throws IOException { if (projectRecompileMap == null) { info("Recompile " + project.getProjectName()); triggerUpstreamModuleCompile(project, false); + // build file tracking of upstream projects + lastBuildFileChange.put(project.getBuildFile(), System.currentTimeMillis()); } else if (Boolean.TRUE.equals(projectRecompileMap.get(project.getProjectName()))) { info("Recompile " + project.getProjectName() + " due to an earlier compilation error"); triggerUpstreamModuleCompile(project, false); + // build file tracking of upstream projects + lastBuildFileChange.put(project.getBuildFile(), System.currentTimeMillis()); } else { info("Recompile skipped for " + project.getProjectName() + " since earlier compilation is successful"); } - // build file tracking of upstream projects - lastBuildFileChange.put(project.getBuildFile(), System.currentTimeMillis()); } } @@ -4071,14 +4073,16 @@ private void initWatchLoop() throws IOException { if (projectRecompileMap == null) { info("Recompile " + getProjectName()); triggerMainModuleCompile(false); + // build file tracking of main project + lastBuildFileChange.put(buildFile, System.currentTimeMillis()); } else if (Boolean.TRUE.equals(projectRecompileMap.get(getProjectName()))) { info("Recompile " + getProjectName() + " due to an earlier compilation error"); triggerMainModuleCompile(false); // build file tracking of main project + lastBuildFileChange.put(buildFile, System.currentTimeMillis()); } else { info("Recompile skipped for " + getProjectName() + " since earlier compilation is successful"); } - lastBuildFileChange.put(buildFile, System.currentTimeMillis()); } private void processFileChanges(