Skip to content

Commit de7373a

Browse files
committed
Refactor some feature gen variables
Co-authored-by-AI: IBM Bob 1.0.2 Signed-off-by: Paul Gooderham <turkeyonmarblerye@gmail.com>
1 parent 2bdc3b8 commit de7373a

2 files changed

Lines changed: 155 additions & 155 deletions

File tree

src/main/java/io/openliberty/tools/common/plugins/util/DevUtil.java

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -560,7 +560,7 @@ public DevUtil(File buildDirectory, File serverDirectory, File sourceDirectory,
560560
}
561561
this.generateFeatures = generateFeatures;
562562
this.generateToSrc = generateToSrc;
563-
this.generateFeaturesTmpDir = new File(buildDirectory, BinaryScannerUtil.GENERATED_FEATURES_TEMP_DIR);
563+
this.generateFeaturesTmpDir = new File(buildDirectory, FeatureGenUtil.GENERATED_FEATURES_TEMP_DIR);
564564
initGenerationContext();
565565
this.compileArtifactPaths = compileArtifactPaths;
566566
this.testArtifactPaths = testArtifactPaths;
@@ -577,7 +577,7 @@ public DevUtil(File buildDirectory, File serverDirectory, File sourceDirectory,
577577

578578
private void initGenerationContext() {
579579
this.generateFeaturesOutputDir = generateToSrc ? configDirectory : generateFeaturesTmpDir;
580-
this.generateFeaturesFile = new File(generateFeaturesOutputDir, BinaryScannerUtil.GENERATED_FEATURES_FILE_PATH);
580+
this.generateFeaturesFile = new File(generateFeaturesOutputDir, FeatureGenUtil.GENERATED_FEATURES_FILE_PATH);
581581
}
582582

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

27292729
private void deleteGenFeaturesFile(File dir) {
27302730
// N.B. processConfigFileChange() will be called upon deletion of generated features file, it should be ignored
2731-
File oldGenFeaturesFile = new File(dir, BinaryScannerUtil.GENERATED_FEATURES_FILE_PATH);
2731+
File oldGenFeaturesFile = new File(dir, FeatureGenUtil.GENERATED_FEATURES_FILE_PATH);
27322732
if (oldGenFeaturesFile.exists()) {
27332733
if (!oldGenFeaturesFile.delete()) {
27342734
debug("Error trying to delete the generated features file:" + oldGenFeaturesFile.getAbsolutePath());
@@ -2743,9 +2743,9 @@ private void logGenerateToSrcStatus() {
27432743
private void infoSrcDirModified() {
27442744
String generatedFileCanonicalPath;
27452745
try {
2746-
generatedFileCanonicalPath = new File(configDirectory, BinaryScannerUtil.GENERATED_FEATURES_FILE_PATH).getCanonicalPath();
2746+
generatedFileCanonicalPath = new File(configDirectory, FeatureGenUtil.GENERATED_FEATURES_FILE_PATH).getCanonicalPath();
27472747
} catch (IOException e) {
2748-
generatedFileCanonicalPath = new File(configDirectory, BinaryScannerUtil.GENERATED_FEATURES_FILE_PATH).toString();
2748+
generatedFileCanonicalPath = new File(configDirectory, FeatureGenUtil.GENERATED_FEATURES_FILE_PATH).toString();
27492749
}
27502750
info("The source configuration directory will be modified. Features will automatically be generated in a new file: " + generatedFileCanonicalPath);
27512751
}
@@ -3090,7 +3090,7 @@ public void watchFiles(File outputDirectory, File testOutputDirectory, final Thr
30903090
}
30913091

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

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

0 commit comments

Comments
 (0)