use of org.jboss.galleon.universe.FeaturePackLocation.ProducerSpec in project galleon by wildfly.
the class FpStack method isRelevant.
private boolean isRelevant(FeaturePackConfig fpConfig) {
if (isEmpty()) {
return true;
}
final ProducerSpec producer = fpConfig.getLocation().getProducer();
final int inheritPkgs = isInheritPackages(producer);
if (inheritPkgs == INHERIT_PKGS_NOT_FOUND || inheritPkgs == INHERIT_PKGS_TRANSITIVE && !fpConfig.isTransitive()) {
return true;
}
if (inheritPkgs > 0) {
if (fpConfig.hasExcludedPackages()) {
for (String excluded : fpConfig.getExcludedPackages()) {
if (!isPackageExcluded(producer, excluded) && !isPackageIncluded(producer, excluded)) {
return true;
}
}
}
if (fpConfig.hasIncludedPackages()) {
for (String included : fpConfig.getIncludedPackages()) {
if (!isPackageIncluded(producer, included) && !isPackageExcluded(producer, included)) {
return true;
}
}
}
}
if (fpConfig.hasDefinedConfigs()) {
boolean configsInherited = true;
for (int i = levels.size() - 1; i >= 0; --i) {
if (!levels.get(i).isInheritConfigs()) {
configsInherited = false;
break;
}
}
if (configsInherited) {
return true;
}
}
if (fpConfig.hasModelOnlyConfigs()) {
boolean configsInherited = true;
for (int i = levels.size() - 1; i >= 0; --i) {
if (!levels.get(i).isInheritModelOnlyConfigs()) {
configsInherited = false;
break;
}
}
if (configsInherited) {
return true;
}
}
return false;
}
use of org.jboss.galleon.universe.FeaturePackLocation.ProducerSpec in project galleon by wildfly.
the class FpStack method isIncludedInTransitiveDeps.
boolean isIncludedInTransitiveDeps(ProducerSpec producer, ConfigId configId) {
final int end = levels.size() - 1;
int i = 0;
while (i < end) {
final Level level = levels.get(i++);
final ProducerSpec levelProducer = level.getCurrentConfig().getLocation().getProducer();
for (int j = 0; j <= i; ++j) {
final Boolean included = levels.get(j).isIncludedInTransitive(levelProducer, configId);
if (included != null) {
return included;
}
}
}
return false;
}
use of org.jboss.galleon.universe.FeaturePackLocation.ProducerSpec in project galleon by wildfly.
the class ProvisioningRuntimeBuilder method resolveFeatureGroupConfig.
ResolvedFeatureGroupConfig resolveFeatureGroupConfig(ConfigModelStack configStack, FeatureGroupSupport fg) throws ProvisioningException {
ProducerSpec fgOrigin = null;
if (!(fg.isConfig() || fg.isLayer())) {
final FeaturePackRuntimeBuilder originalOrigin = currentOrigin;
getFeatureGroupSpec(fg.getName());
fgOrigin = currentOrigin.producer;
currentOrigin = originalOrigin;
}
final ResolvedFeatureGroupConfig resolvedFgc = new ResolvedFeatureGroupConfig(configStack, fg, fgOrigin);
resolvedFgc.inheritFeatures = fg.isInheritFeatures();
if (fg.hasExcludedSpecs()) {
resolvedFgc.excludedSpecs = resolveSpecIds(resolvedFgc.excludedSpecs, fg.getExcludedSpecs());
}
if (fg.hasIncludedSpecs()) {
resolvedFgc.includedSpecs = resolveSpecIds(resolvedFgc.includedSpecs, fg.getIncludedSpecs());
}
if (fg.hasExcludedFeatures()) {
resolvedFgc.excludedFeatures = resolveExcludedIds(resolvedFgc.excludedFeatures, fg.getExcludedFeatures());
}
if (fg.hasIncludedFeatures()) {
resolvedFgc.includedFeatures = resolveIncludedIds(resolvedFgc.includedFeatures, fg.getIncludedFeatures());
}
if (fg.hasExternalFeatureGroups()) {
final FeaturePackRuntimeBuilder originalOrigin = currentOrigin;
for (Map.Entry<String, FeatureGroup> entry : fg.getExternalFeatureGroups().entrySet()) {
final FeatureGroup extFg = entry.getValue();
setOrigin(entry.getKey());
try {
if (extFg.hasExcludedSpecs()) {
resolvedFgc.excludedSpecs = resolveSpecIds(resolvedFgc.excludedSpecs, extFg.getExcludedSpecs());
}
if (extFg.hasIncludedSpecs()) {
resolvedFgc.includedSpecs = resolveSpecIds(resolvedFgc.includedSpecs, extFg.getIncludedSpecs());
}
if (extFg.hasExcludedFeatures()) {
resolvedFgc.excludedFeatures = resolveExcludedIds(resolvedFgc.excludedFeatures, extFg.getExcludedFeatures());
}
if (extFg.hasIncludedFeatures()) {
resolvedFgc.includedFeatures = resolveIncludedIds(resolvedFgc.includedFeatures, extFg.getIncludedFeatures());
}
} finally {
setOrigin(originalOrigin);
}
}
}
return resolvedFgc;
}
use of org.jboss.galleon.universe.FeaturePackLocation.ProducerSpec in project galleon by wildfly.
the class ProvisioningLayout method addFpDeps.
protected void addFpDeps(final ProvisioningConfig.Builder builder, Collection<FeaturePackConfig> deps) throws ProvisioningDescriptionException {
for (FeaturePackConfig fpConfig : deps) {
final ProducerSpec producer = fpConfig.getLocation().getProducer();
final FeaturePackLocation resolvedFpl = resolvedVersions.remove(producer);
if (resolvedFpl != null) {
builder.addFeaturePackDep(config.originOf(producer), FeaturePackConfig.builder(resolvedFpl).init(fpConfig).build());
} else {
builder.addFeaturePackDep(config.originOf(producer), fpConfig);
}
}
}
use of org.jboss.galleon.universe.FeaturePackLocation.ProducerSpec in project galleon by wildfly.
the class ProvisioningLayout method getUpdatesInternal.
private ProvisioningPlan getUpdatesInternal(Collection<ProducerSpec> producers) throws ProvisioningException {
final ProvisioningPlan plan = ProvisioningPlan.builder();
updatesTracker = getUpdatesTracker();
updatesTracker.starting(producers.size());
for (ProducerSpec producer : producers) {
updatesTracker.processing(producer);
final FeaturePackUpdatePlan fpPlan = getFeaturePackUpdate(producer);
if (!fpPlan.isEmpty()) {
plan.update(fpPlan);
}
updatesTracker.processed(producer);
}
updatesTracker.complete();
return plan;
}
Aggregations