-
Notifications
You must be signed in to change notification settings - Fork 33
Copy config and changed file to temp dir for feature generation #494
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: generate-features-update
Are you sure you want to change the base?
Copy config and changed file to temp dir for feature generation #494
Conversation
Signed-off-by: Paul Gooderham <turkeyonmarblerye@gmail.com>
| FileUtils.deleteDirectory(tempConfig); | ||
| debug("Successfully deleted liberty:dev temporary configuration folder"); | ||
| } catch (IOException e) { | ||
| warn("Could not delete liberty:dev temporary configuration folder: " + e.getMessage()); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Since this method is now handling different temp config folders, I'm wondering if the output messages should explicitly state what temp config folder is being deleted or was attempted to be deleted.
| } | ||
|
|
||
| private boolean optimizeGenerateFeatures(boolean useTmpDir) { | ||
| debug("Generating optimized features list...use temp directory (for output)=" + useTmpDir); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm wondering if this debug line is necessary since the next line calls a method that outputs the same information (plus more).
| // modified xml file in src dir. Copy them all to the gen. feat. temp dir to | ||
| // combine them for feature generation. | ||
| if (!generateToSrc) { | ||
| cleanUpTempConfig(generateFeaturesTmpDir.toPath()); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just thinking through this a bit... We delete the temp dir which would delete the temp generated-features.xml file. Since we are tracking this file, this would trigger dev mode action on deletion. We are still intending to do nothing on the deletion of the generated-features.xml, correct?
|
|
||
| FileUtils.copyDirectory(serverDirectory, tempConfig, new FileFilter() { | ||
| copyToTempDir(serverDirectory, tempConfig); | ||
| File parentDir = fileChanged.equals(generateFeaturesFile) ? generateFeaturesOutputDir : srcDir; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you remind me why we can't use the srcDir as the parentDir when the generated features file is the file changed? Maybe we should add a comment explaining why.
In this context, my understanding is the srcDir is the directory of the file changed, not "the source directory" of the project.
As a result of testing we found that changing server.xml does not immediately update the generated features when option generateToSrc=false.
Related to OpenLiberty/ci.maven#1959