Skip to content

Conversation

@turkeylurkey
Copy link
Member

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

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());
Copy link
Contributor

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);
Copy link
Contributor

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());
Copy link
Contributor

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;
Copy link
Contributor

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants