Skip to content

Commit

Permalink
Merge pull request #345 from TrevCraw/1366-server.xml-feature-removal
Browse files Browse the repository at this point in the history
1366 server.xml feature removal
  • Loading branch information
TrevCraw authored Feb 23, 2022
2 parents 66ea3a4 + fd3f788 commit 53d3199
Showing 1 changed file with 7 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -2450,14 +2450,16 @@ protected void setFeatureGeneration(boolean generateFeatures) {
/**
* Generate features using all classes and only user specified features.
*/
private void optimizeGenerateFeatures() {
private boolean optimizeGenerateFeatures() {
info("Generating optimized features list...");
// scan all class files and provide only user specified features
boolean generatedFeatures = libertyGenerateFeatures(null, true);
if (generatedFeatures) {
javaSourceClasses.clear();
} // do not need to log an error if generatedFeatures is false because that would
// have already been logged by libertyGenerateFeatures

return generatedFeatures;
}

/**
Expand Down Expand Up @@ -4016,7 +4018,7 @@ private void processFileChanges(
generateFeaturesSuccess = false;
// custom server.xml modified
// TODO: revisit scenarios in which we should skip install features
generateFeaturesSuccess = incrementGenerateFeatures();
generateFeaturesSuccess = optimizeGenerateFeatures();
}
// suppress install feature warning - property must be set before calling copyConfigFolder
System.setProperty(SKIP_BETA_INSTALL_WARNING, Boolean.TRUE.toString());
Expand All @@ -4039,7 +4041,7 @@ private void processFileChanges(
// custom server.xml is deleted
// TODO: test this scenario and decide if generating features is necessary
// if we generate, it may need to be optimized
incrementGenerateFeatures();
optimizeGenerateFeatures();
}
// Let this restart if needed for container mode. Otherwise, nothing else needs to be done for config file delete.
if (isDockerfileDirectoryChanged(serverDirectory, fileChanged)) {
Expand All @@ -4060,7 +4062,7 @@ private void processFileChanges(
generateFeaturesSuccess = false;
// server.xml modified
// TODO: revisit scenarios in which we should skip install features
generateFeaturesSuccess = incrementGenerateFeatures();
generateFeaturesSuccess = optimizeGenerateFeatures();
}
// suppress install feature warning - property must be set before calling copyConfigFolder
System.setProperty(SKIP_BETA_INSTALL_WARNING, Boolean.TRUE.toString());
Expand Down Expand Up @@ -4103,7 +4105,7 @@ private void processFileChanges(
// server.xml is deleted
// TODO: test this scenario and decide if generating features is necessary
// if we generate, it may need to be optimized
incrementGenerateFeatures();
optimizeGenerateFeatures();
}
if (isDockerfileDirectoryChanged(serverDirectory, fileChanged)) {
untrackDockerfileDirectoriesAndRestart();
Expand Down

0 comments on commit 53d3199

Please sign in to comment.