private boolean dependsOn(F f, ProducerSpec dep, Set<ProducerSpec> visitedFps) throws ProvisioningException { final FeaturePackSpec spec = f.getSpec(); if(!spec.hasFeaturePackDeps()) { return false; } if(spec.hasFeaturePackDep(dep) || spec.hasTransitiveDep(dep)) { return true; } for(FeaturePackConfig fpConfig : spec.getFeaturePackDeps()) { final ProducerSpec producer = fpConfig.getLocation().getProducer(); if(!visitedFps.add(producer)) { continue; } if(dependsOn(featurePacks.get(producer), dep, visitedFps)) { return true; } visitedFps.remove(producer); } return false; }
private static String buildDependencies(PmCommandInvocation invoc, ProvisioningLayout<FeaturePackLayout> layout) throws ProvisioningException { Map<FPID, FeaturePackConfig> configs = new HashMap<>(); List<FeaturePackLocation> dependencies = new ArrayList<>(); for (FeaturePackLayout fpLayout : layout.getOrderedFeaturePacks()) { boolean isProduct = true; for (FeaturePackLayout fpLayout2 : layout.getOrderedFeaturePacks()) { if (fpLayout2.getSpec().hasTransitiveDep(fpLayout.getFPID().getProducer()) || fpLayout2.getSpec().getFeaturePackDep(fpLayout.getFPID().getProducer()) != null) { isProduct = false; break; } } if (!isProduct) { FeaturePackLocation loc = invoc.getPmSession().getExposedLocation(null, fpLayout.getFPID().getLocation()); dependencies.add(loc); FeaturePackConfig transitiveConfig = layout.getConfig().getTransitiveDep(fpLayout.getFPID().getProducer()); configs.put(loc.getFPID(), transitiveConfig); } } return buildDependencies(dependencies, configs); }
boolean isProduct = true; for (FeaturePackLayout fpLayout2 : layout.getOrderedFeaturePacks()) { if (fpLayout2.getSpec().hasTransitiveDep(fpLayout.getFPID().getProducer()) || fpLayout2.getSpec().getFeaturePackDep(fpLayout.getFPID().getProducer()) != null) { isProduct = false;