Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -560,7 +560,7 @@ public DevUtil(File buildDirectory, File serverDirectory, File sourceDirectory,
}
this.generateFeatures = generateFeatures;
this.generateToSrc = generateToSrc;
this.generateFeaturesTmpDir = new File(buildDirectory, BinaryScannerUtil.GENERATED_FEATURES_TEMP_DIR);
this.generateFeaturesTmpDir = new File(buildDirectory, FeatureGeneratorUtil.GENERATED_FEATURES_TEMP_DIR);
initGenerationContext();
this.compileArtifactPaths = compileArtifactPaths;
this.testArtifactPaths = testArtifactPaths;
Expand All @@ -577,7 +577,7 @@ public DevUtil(File buildDirectory, File serverDirectory, File sourceDirectory,

private void initGenerationContext() {
this.generateFeaturesOutputDir = generateToSrc ? configDirectory : generateFeaturesTmpDir;
this.generateFeaturesFile = new File(generateFeaturesOutputDir, BinaryScannerUtil.GENERATED_FEATURES_FILE_PATH);
this.generateFeaturesFile = new File(generateFeaturesOutputDir, FeatureGeneratorUtil.GENERATED_FEATURES_FILE_PATH);
}

public void copyGeneratedFeaturesFile(File destinationDir) throws IOException {
Expand Down Expand Up @@ -1950,8 +1950,8 @@ private void addUserId(List<String> commandElements) {
* @param classes class file paths features should be generated for (can be null if no modified classes)
* @param optimize if true, generate optimized feature list
* @param generateToSrc if true, generate feature list into file in src/main/liberty
* @param useTmpDirOut if true, generate feature file in a hidden directory named in BinaryScannerUtil
* @param useTmpDirIn if true, the hidden directory named in BinaryScannerUtil will be used as the
* @param useTmpDirOut if true, generate feature file in a hidden directory named in FeatureGeneratorUtil
* @param useTmpDirIn if true, the hidden directory named in FeatureGeneratorUtil will be used as the
* context or input values to generate features
* @return true if feature generation was successful
*/
Expand Down Expand Up @@ -2728,7 +2728,7 @@ private void toggleGenerateToSrc() {

private void deleteGenFeaturesFile(File dir) {
// N.B. processConfigFileChange() will be called upon deletion of generated features file, it should be ignored
File oldGenFeaturesFile = new File(dir, BinaryScannerUtil.GENERATED_FEATURES_FILE_PATH);
File oldGenFeaturesFile = new File(dir, FeatureGeneratorUtil.GENERATED_FEATURES_FILE_PATH);
if (oldGenFeaturesFile.exists()) {
if (!oldGenFeaturesFile.delete()) {
debug("Error trying to delete the generated features file:" + oldGenFeaturesFile.getAbsolutePath());
Expand All @@ -2743,9 +2743,9 @@ private void logGenerateToSrcStatus() {
private void infoSrcDirModified() {
String generatedFileCanonicalPath;
try {
generatedFileCanonicalPath = new File(configDirectory, BinaryScannerUtil.GENERATED_FEATURES_FILE_PATH).getCanonicalPath();
generatedFileCanonicalPath = new File(configDirectory, FeatureGeneratorUtil.GENERATED_FEATURES_FILE_PATH).getCanonicalPath();
} catch (IOException e) {
generatedFileCanonicalPath = new File(configDirectory, BinaryScannerUtil.GENERATED_FEATURES_FILE_PATH).toString();
generatedFileCanonicalPath = new File(configDirectory, FeatureGeneratorUtil.GENERATED_FEATURES_FILE_PATH).toString();
}
info("The source configuration directory will be modified. Features will automatically be generated in a new file: " + generatedFileCanonicalPath);
}
Expand Down Expand Up @@ -3090,7 +3090,7 @@ public void watchFiles(File outputDirectory, File testOutputDirectory, final Thr
}

// Always register the generated file in the temp dir. because generateToSrc can be toggled on and off in dev mode
File hiddenTempGenerateFeaturesFile = new File(generateFeaturesTmpDir, BinaryScannerUtil.GENERATED_FEATURES_FILE_PATH);
File hiddenTempGenerateFeaturesFile = new File(generateFeaturesTmpDir, FeatureGeneratorUtil.GENERATED_FEATURES_FILE_PATH);
hiddenTempGenerateFeaturesFile.getParentFile().mkdirs(); // must only mkdir on the directories
registerSingleFile(hiddenTempGenerateFeaturesFile, executor);

Expand Down Expand Up @@ -4265,7 +4265,7 @@ private void processFileChanges(
// TODO process ALL files in newly registered directory, not just the generated features file https://github.com/OpenLiberty/ci.maven/issues/1548
// check if the generated features file exists in any of the newly registered directories
Iterator<File> it = FileUtils.iterateFiles(fileChanged,
new NameFileFilter(BinaryScannerUtil.GENERATED_FEATURES_FILE_NAME),
new NameFileFilter(FeatureGeneratorUtil.GENERATED_FEATURES_FILE_NAME),
TrueFileFilter.INSTANCE);
if (it.hasNext()) {
File newlyRegisteredFile = it.next();
Expand Down
Loading