Skip to content

Commit

Permalink
Couple more fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
cherylking committed Sep 11, 2024
1 parent c9303be commit b6ad004
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 10 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -223,14 +223,10 @@ public class AbstractFeatureTask extends AbstractServerTask {
FeaturesPlatforms getServerFeaturesResult = new FeaturesPlatforms()
// if createNewInstallFeatureUtil failed to create a new InstallFeatureUtil instance, then features are installed via ant
if (installFeaturesFromAnt) {
Set<String> featuresInstalledFromAnt
if (server.features.name != null) {
featuresInstalledFromAnt = new HashSet<String>(server.features.name)
return new FeaturesPlatforms(featuresInstalledFromAnt, new HashSet<String>())
} else {
featuresInstalledFromAnt = new HashSet<String>()
return getServerFeaturesResult
getServerFeaturesResult.getFeatures().addAll(server.features.name)
}
return getServerFeaturesResult
}

def pluginListedFeatures = getPluginListedFeatures(false)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -175,8 +175,13 @@ class GenerateFeaturesTask extends AbstractFeatureTask {

servUtil.setLowerCaseFeatures(false);
// get set of user defined features so they can be omitted from the generated file that will be written
FeaturesPlatforms fp = optimize ? existingFeatures : servUtil.getServerFeatures(server.configDirectory, server.serverXmlFile, new HashMap<String, File>(), generatedFiles);
Set<String> userDefinedFeatures = fp == null ? new HashSet<String>() : fp.getFeatures();
Set<String> userDefinedFeatures = optimize ? existingFeatures : new HashSet<String>();
if (!optimize) {
FeaturesPlatforms fp = servUtil.getServerFeatures(server.configDirectory, server.serverXmlFile, new HashMap<String, File>(), generatedFiles);
if (fp != null) {
userDefinedFeatures = fp.getFeatures();
}
}
logger.debug("User defined features:" + userDefinedFeatures);
servUtil.setLowerCaseFeatures(true);
if (!userDefinedFeatures.isEmpty()) {
Expand Down Expand Up @@ -245,9 +250,9 @@ class GenerateFeaturesTask extends AbstractFeatureTask {
// returns the features specified in the generated-features.xml file
private Set<String> getGeneratedFeatures(ServerFeatureUtil servUtil, File generatedFeaturesFile) {
servUtil.setLowerCaseFeatures(false);
Set<String> genFeatSet = new HashSet<String>();
servUtil.getServerXmlFeatures(genFeatSet, server.configDirectory,
FeaturesPlatforms fp = servUtil.getServerXmlFeatures(new FeaturesPlatforms(), server.configDirectory,
generatedFeaturesFile, null, null);
Set<String> genFeatSet = fp == null ? new HashSet<String>() : fp.getFeatures();
servUtil.setLowerCaseFeatures(true);
return genFeatSet;
}
Expand Down

0 comments on commit b6ad004

Please sign in to comment.