public FeaturePackLocation replaceUniverse(UniverseSpec universe) { return new FeaturePackLocation(universe, producer, channel, frequency, build); }
public FeaturePackLocation replaceBuild(String build) { return new FeaturePackLocation(universeSpec, producer, channel, frequency, build); }
public FeaturePackLocation getResolvedLocation(Path installation, String location) throws ProvisioningException { if (location.endsWith("" + FeaturePackLocation.FREQUENCY_START) || location.endsWith("" + FeaturePackLocation.BUILD_START)) { location = location.substring(0, location.length() - 1); } // A producer spec without any universe nor channel. if (!location.contains("" + FeaturePackLocation.UNIVERSE_START) && !location.contains("" + FeaturePackLocation.CHANNEL_START)) { location = new FeaturePackLocation(universe.getDefaultUniverseSpec(installation), location, null, null, null).toString(); } FeaturePackLocation loc = FeaturePackLocation.fromString(location); return getResolvedLocation(installation, loc); }
public static FeaturePackLocation toFpl(String groupId, String artifactId, String version) { if(version == null) { return new FeaturePackLocation( new UniverseSpec(LegacyGalleon1UniverseFactory.ID, null), groupId + ':' + artifactId, null, null, version); } final int i = version.indexOf('.'); return new FeaturePackLocation( new UniverseSpec(LegacyGalleon1UniverseFactory.ID, null), groupId + ':' + artifactId, i > 0 ? version.substring(0, i) : version, null, version); }
public static FPID newFPID(String producer, String channel, String build) { return new FeaturePackLocation(getUniverseSpec(), producer, channel, null, build).getFPID(); }
private static List<String> getAllBuilds(UniverseSpec spec, Producer<?> producer, Channel channel) { FeaturePackLocation loc = new FeaturePackLocation(spec, producer.getName(), channel.getName(), null, null); List<String> build = Collections.emptyList(); try { build = channel.getAllBuilds(loc); } catch (ProvisioningException ex) { // OK, no build. } return build; }
private static String getBuild(UniverseSpec spec, Producer<?> producer, Channel channel, String freq) { FeaturePackLocation loc = new FeaturePackLocation(spec, producer.getName(), channel.getName(), freq, null); String build = null; try { build = channel.getLatestBuild(loc); } catch (ProvisioningException ex) { // OK, no build. } return build; }
return new FeaturePackLocation( producerEnd == universeEnd ? null : UniverseSpec.fromString(str.substring(producerEnd + 1, universeEnd)), str.substring(0, producerEnd),
public static ProducerSpec newProducer(String producer) { return new FeaturePackLocation(new UniverseSpec(LegacyGalleon1UniverseFactory.ID, null), producer, null, null, null).getProducer(); }
public FeaturePackLocation getUserConfiguredLocation(FeaturePackLocation fpl) { final UniverseSpec universeSource = fpl.getUniverse(); if(defaultUniverse != null && defaultUniverse.equals(universeSource)) { return new FeaturePackLocation(null, fpl.getProducerName(), fpl.getChannelName(), fpl.getFrequency(), fpl.getBuild()); } for (Map.Entry<String, UniverseSpec> entry : universeSpecs.entrySet()) { if (entry.getValue().equals(universeSource)) { return new FeaturePackLocation(new UniverseSpec(entry.getKey(), null), fpl.getProducerName(), fpl.getChannelName(), fpl.getFrequency(), fpl.getBuild()); } } return fpl; }
return; FeaturePackLocation ploc = new FeaturePackLocation(builtinUniverseSpec, p.getName(), c.getName(), null, null); deps.add(ploc);
private static void visit(UniverseVisitor visitor, Universe<?> universe, UniverseSpec universeSpec, boolean allBuilds) throws ProvisioningException { for (Producer<?> producer : universe.getProducers()) { for (Channel channel : producer.getChannels()) { if (allBuilds) { List<String> builds = getAllBuilds(universeSpec, producer, channel); if (builds != null && !builds.isEmpty()) { for (String build : builds) { visitor.visit(producer, new FeaturePackLocation(universeSpec, producer.getName(), channel.getName(), null, build)); } } } for (String freq : producer.getFrequencies()) { String build = getBuild(universeSpec, producer, channel, freq); // We have a latest build for the frequency. if (build != null) { FeaturePackLocation loc = new FeaturePackLocation(universeSpec, producer.getName(), channel.getName(), freq, build); visitor.visit(producer, loc); } } } } }
static FeaturePackLocation resolveUniverse(FeaturePackDepsConfigBuilder<?> builder, FeaturePackLocation location) throws XMLStreamException { if(location.getUniverse() == null) { if(!builder.hasDefaultUniverse()) { throw new XMLStreamException("Failed to parse feature-pack configuration for " + location + ": default universe was not configured"); } location = new FeaturePackLocation(builder.getDefaultUniverse(), location.getProducerName(), location.getChannelName(), location.getFrequency(), location.getBuild()); } else { final UniverseSpec resolvedConfig = builder.getUniverseSpec(location.getUniverse().toString()); if(resolvedConfig != null) { location = new FeaturePackLocation(resolvedConfig, location.getProducerName(), location.getChannelName(), location.getFrequency(), location.getBuild()); } } return location; }
static FeaturePackLocation resolveUniverse(FeaturePackDepsConfigBuilder<?> builder, FeaturePackLocation location) throws XMLStreamException { if(location.getUniverse() == null) { if(!builder.hasDefaultUniverse()) { throw new XMLStreamException("Failed to parse feature-pack configuration for " + location + ": default universe was not configured"); } location = new FeaturePackLocation(builder.getDefaultUniverse(), location.getProducerName(), location.getChannelName(), location.getFrequency(), location.getBuild()); } else { final UniverseSpec resolvedConfig = builder.getUniverseSpec(location.getUniverse().toString()); if(resolvedConfig != null) { location = new FeaturePackLocation(resolvedConfig, location.getProducerName(), location.getChannelName(), location.getFrequency(), location.getBuild()); } } return location; }
private FeaturePackLocation getResolvedLocation(Path installation, FeaturePackLocation fplocation) throws ProvisioningException { UniverseSpec spec = fplocation.getUniverse(); if (spec != null) { if (spec.getLocation() == null) { spec = universe.getUniverseSpec(installation, spec.getFactory()); if (spec == null) { throw new ProvisioningException("Unknown universe for " + fplocation); } } } else { spec = universe.getDefaultUniverseSpec(installation); } return new FeaturePackLocation(spec, fplocation.getProducerName(), fplocation.getChannelName(), fplocation.getFrequency(), fplocation.getBuild()); }
public FeaturePackLocation getExposedLocation(Path installation, FeaturePackLocation fplocation) { // Expose the default or name. UniverseSpec spec = fplocation.getUniverse(); boolean rewrite = false; String name = getUniverse().getUniverseName(installation, spec); if (name != null) { rewrite = true; spec = new UniverseSpec(name, null); } else if (getUniverse().getDefaultUniverseSpec(installation).equals(spec)) { rewrite = true; spec = null; } if (rewrite) { fplocation = new FeaturePackLocation(spec, fplocation.getProducerName(), fplocation.getChannelName(), fplocation.getFrequency(), fplocation.getBuild()); } return fplocation; } public void enableMavenTrace(boolean b) {
/** * Resolves latest available feature-pack ID * * @param fpl feature-pack location * @return latest available feature-pack id * @throws ProvisioningException in case of any error */ public FeaturePackLocation resolveLatestBuild(FeaturePackLocation fpl) throws ProvisioningException { Channel channel = getUniverse(fpl.getUniverse()) .getProducer(fpl.getProducerName()) .getChannel(fpl.getChannelName()); final String latestBuild = channel.getLatestBuild(fpl); FeaturePackLocation latestLocation = new FeaturePackLocation(fpl.getUniverse(), fpl.getProducerName(), fpl.getChannelName(), fpl.getFrequency(), latestBuild); channel.resolve(latestLocation); return latestLocation; }
FeaturePackLocation.FPID id = new FeaturePackLocation(spec, parsedLocation.getProducer(), parsedLocation.getChannel(), null, null).getFPID(); latestBuild = pmSession.getUniverse().getUniverse(spec). getProducer(parsedLocation.getProducer()).getChannel(parsedLocation.getChannel()).getLatestBuild(id); } else { FeaturePackLocation loc = new FeaturePackLocation(spec, parsedLocation.getProducer(), parsedLocation.getChannel(), parsedLocation.getFrequency(), null); latestBuild = pmSession.getUniverse().getUniverse(spec).