Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/main' into addSkipInstallFeature
Browse files Browse the repository at this point in the history
  • Loading branch information
cherylking committed Aug 19, 2023
2 parents 4e30a48 + b08c49b commit 5b1ac77
Showing 1 changed file with 9 additions and 15 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -357,8 +357,9 @@ private enum FileTrackMode {
private File configDirectory;
private File projectDirectory;
private File multiModuleProjectDirectory;
private List<File> resourceDirs;
private List<Path> webResourceDirs;
protected List<File> resourceDirs;
// Not all webResource dirs need to be monitored, but those for which a Maven filtering will be applied do, since they can't be added to the loose app as source
protected List<Path> monitoredWebResourceDirs;
private boolean hotTests;
private Path tempConfigPath;
private boolean skipTests;
Expand Down Expand Up @@ -444,7 +445,7 @@ public DevUtil(File buildDirectory, File serverDirectory, File sourceDirectory,
boolean skipDefaultPorts, JavaCompilerOptions compilerOptions, boolean keepTempDockerfile,
String mavenCacheLocation, List<ProjectModule> upstreamProjects, boolean recompileDependencies,
String packagingType, File buildFile, Map<String, List<String>> parentBuildFiles, boolean generateFeatures,
Set<String> compileArtifactPaths, Set<String> testArtifactPaths, List<Path> webResourceDirs) {
Set<String> compileArtifactPaths, Set<String> testArtifactPaths, List<Path> monitoredWebResourceDirs) {
this.buildDirectory = buildDirectory;
this.serverDirectory = serverDirectory;
this.sourceDirectory = sourceDirectory;
Expand Down Expand Up @@ -511,7 +512,7 @@ public DevUtil(File buildDirectory, File serverDirectory, File sourceDirectory,
this.generateFeatures = generateFeatures;
this.compileArtifactPaths = compileArtifactPaths;
this.testArtifactPaths = testArtifactPaths;
this.webResourceDirs = webResourceDirs;
this.monitoredWebResourceDirs = monitoredWebResourceDirs;
this.generatedFeaturesFile = new File(configDirectory, BinaryScannerUtil.GENERATED_FEATURES_FILE_PATH);
this.generatedFeaturesModified = false;
if (this.generateFeatures) {
Expand Down Expand Up @@ -2840,7 +2841,7 @@ public void watchFiles(File outputDirectory, File testOutputDirectory, final Thr
}

HashMap<Path, Boolean> webResourceMap = new HashMap<Path, Boolean>();
for (Path webResourceDir : webResourceDirs) {
for (Path webResourceDir : monitoredWebResourceDirs) {
webResourceMap.put(webResourceDir, false);
if (Files.exists(webResourceDir)) {
registerAll(webResourceDir, executor);
Expand Down Expand Up @@ -3038,7 +3039,7 @@ public void watchFiles(File outputDirectory, File testOutputDirectory, final Thr
}

// Check if webResourceDirectory has been added or deleted
for (Path webResourceDir : webResourceDirs) {
for (Path webResourceDir : monitoredWebResourceDirs) {
if (!webResourceMap.get(webResourceDir) && Files.exists(webResourceDir)) {
updateLooseApp();
registerAll(webResourceDir, executor);
Expand Down Expand Up @@ -3898,7 +3899,7 @@ private void processFileChanges(
Path configPath = this.configDirectory.getCanonicalFile().toPath();
Path outputPath = this.outputDirectory.getCanonicalFile().toPath();

Path directory = fileChanged.getParentFile().toPath();
Path directory = fileChanged.getParentFile().getCanonicalFile().toPath();

// resource file check
File resourceParent = null;
Expand All @@ -3911,7 +3912,7 @@ private void processFileChanges(

// webResource file check
Path webResourceParent = null;
for (Path webResourceDir : webResourceDirs) {
for (Path webResourceDir : monitoredWebResourceDirs) {
if (directory.startsWith(webResourceDir)) {
webResourceParent = webResourceDir;
break;
Expand Down Expand Up @@ -4087,9 +4088,6 @@ private void processFileChanges(
}
}
}
// Update the loose app in case something changed
updateLooseApp();

} else if (upstreamResourceParent != null
&& directory.startsWith(upstreamResourceParent.getCanonicalFile().toPath())) { // resources
debug("Resource dir: " + upstreamResourceParent.toString());
Expand Down Expand Up @@ -4238,8 +4236,6 @@ private void processFileChanges(
triggerJavaTestRecompile = true;
}
}
// Update the loose app in case something changed
updateLooseApp();
runTestThread(true, executor, numApplicationUpdatedMessages, skipUTs, false, buildFile);
}
} else if (fileChanged.equals(dockerfileUsed)
Expand Down Expand Up @@ -5003,8 +4999,6 @@ protected boolean recompileJava(Collection<File> javaFilesChanged, Set<String> a
// redeploy app after compilation if not loose application
if (!isLooseApplication()) {
redeployApp();
} else {
updateLooseApp();
}
if (projectName != null) {
info(projectName + " source compilation was successful.");
Expand Down

0 comments on commit 5b1ac77

Please sign in to comment.