public PomResource(Manifest manifest) { this(new Processor(), manifest); }
public PomResource(Manifest manifest) { this(new Processor(), manifest); }
private static Processor asProcessor(Map<String, String> b) { Processor p = new Processor(); p.addProperties(b); return p; }
private static Processor asProcessor(Map<String, String> b) { Processor p = new Processor(); p.addProperties(b); return p; }
public static Map<String,String> getDefinition(Clazz c) throws Exception { return getDefinition(c, new Processor()); }
public static Map<String,String> getDefinition(Clazz c) throws Exception { return getDefinition(c, new Processor()); }
public static Map<String,String> getDefinition(Clazz c) throws Exception { return getDefinition(c, new Processor()); }
private PomResource createPomFromContextAndManifest(Manifest manifest, Processor context) throws Exception { try (Processor scoped = context == null ? new Processor() : new Processor(context)) { if (scoped.getProperty(Constants.GROUPID) == null) scoped.setProperty(Constants.GROUPID, "osgi-bundle"); return new PomResource(scoped, manifest); } }
private PomResource createPomFromContextAndManifest(Manifest manifest, Processor context) throws Exception { try (Processor scoped = context == null ? new Processor() : new Processor(context)) { if (scoped.getProperty(Constants.GROUPID) == null) scoped.setProperty(Constants.GROUPID, "osgi-bundle"); return new PomResource(scoped, manifest); } }
static synchronized public Processor getDefaults() { if (defaults != null) return defaults; UTF8Properties props = new UTF8Properties(); try (InputStream propStream = Workspace.class.getResourceAsStream("defaults.bnd")) { if (propStream != null) { props.load(propStream); } else { System.err.println("Cannot load defaults"); } } catch (IOException e) { throw new IllegalArgumentException("Unable to load bnd defaults.", e); } defaults = new Processor(props, false); return defaults; }
static synchronized public Processor getDefaults() { if (defaults != null) return defaults; UTF8Properties props = new UTF8Properties(); try (InputStream propStream = Workspace.class.getResourceAsStream("defaults.bnd")) { if (propStream != null) { props.load(propStream); } else { System.err.println("Cannot load defaults"); } } catch (IOException e) { throw new IllegalArgumentException("Unable to load bnd defaults.", e); } defaults = new Processor(props, false); return defaults; }
static synchronized public Processor getDefaults() { if (defaults != null) return defaults; Properties props = new UTF8Properties(); InputStream propStream = Workspace.class.getResourceAsStream("defaults.bnd"); if (propStream != null) { try { props.load(propStream); } catch (IOException e) { throw new IllegalArgumentException("Unable to load bnd defaults.", e); } finally { IO.close(propStream); } } else System.err.println("Cannot load defaults"); defaults = new Processor(props); return defaults; }
private Processor findRepositoryAugments(Collection<Repository> orderedRepositories) { Processor main = new Processor(); RequirementBuilder rb = new RequirementBuilder(BND_AUGMENT); rb.filter("(path=*)"); Requirement req = rb.buildSyntheticRequirement(); for (Repository r : orderedRepositories) { Map<Requirement, Collection<Capability>> found = r.findProviders(Collections.singleton(req)); Collection<Capability> capabilities = found.get(req); if (capabilities != null) { for (Capability capability : capabilities) { findAdditionalAugmentsFromResource(main, capability); } } } return main; }
private Processor findRepositoryAugments(Collection<Repository> orderedRepositories) { Processor main = new Processor(); RequirementBuilder rb = new RequirementBuilder(BND_AUGMENT); rb.filter("(path=*)"); Requirement req = rb.buildSyntheticRequirement(); for (Repository r : orderedRepositories) { Map<Requirement, Collection<Capability>> found = r.findProviders(Collections.singleton(req)); Collection<Capability> capabilities = found.get(req); if (capabilities != null) { for (Capability capability : capabilities) { findAdditionalAugmentsFromResource(main, capability); } } } return main; }
private void install(File f, RepositoryPlugin repo, Attrs value) throws Exception { try (Processor p = new Processor()) { p.getProperties() .putAll(value); PutOptions options = new PutOptions(); options.context = p; try (InputStream in = IO.stream(f)) { repo.put(in, options); } catch (Exception e) { exception(e, "Cannot install %s into %s because %s", f, repo.getName(), e); } } }
public List<Resolution> validate() throws Exception { try (OSGiRepository repository = new OSGiRepository(); HttpClient httpClient = new HttpClient()) { Map<String, String> map = new HashMap<>(); map.put("locations", Strings.join(repositories)); map.put("name", "ResolverValidator"); repository.setProperties(map); Processor registry = new Processor(); registry.addBasicPlugin(httpClient); repository.setRegistry(registry); repository.setReporter(this); Set<Resource> resources = getAllResources(repository); return validateResources(repository, resources); } }
private void install(File f, RepositoryPlugin repo, Attrs value) throws Exception { try (Processor p = new Processor()) { p.getProperties() .putAll(value); PutOptions options = new PutOptions(); options.context = p; try (InputStream in = IO.stream(f)) { repo.put(in, options); } catch (Exception e) { exception(e, "Cannot install %s into %s because %s", f, repo.getName(), e); } } }
public List<Resolution> validate() throws Exception { try (OSGiRepository repository = new OSGiRepository(); HttpClient httpClient = new HttpClient()) { Map<String, String> map = new HashMap<>(); map.put("locations", Strings.join(repositories)); map.put("name", "ResolverValidator"); repository.setProperties(map); Processor registry = new Processor(); registry.addBasicPlugin(httpClient); repository.setRegistry(registry); repository.setReporter(this); Set<Resource> resources = getAllResources(repository); return validateResources(repository, resources); } }
/** * Calculate the file for a JAR. The default name is bsn.jar, but this can * be overridden with an * * @throws Exception */ public File getOutputFile(String bsn, String version) throws Exception { if (version == null) version = "0"; try (Processor scoped = new Processor(this)) { scoped.setProperty("@bsn", bsn); scoped.setProperty("@version", version); String path = scoped.getProperty(OUTPUTMASK, bsn + ".jar"); return IO.getFile(getTarget(), path); } }
/** * Calculate the file for a JAR. The default name is bsn.jar, but this can * be overridden with an * * @throws Exception */ public File getOutputFile(String bsn, String version) throws Exception { if (version == null) version = "0"; try (Processor scoped = new Processor(this)) { scoped.setProperty("@bsn", bsn); scoped.setProperty("@version", version); String path = scoped.getProperty(OUTPUTMASK, bsn + ".jar"); return IO.getFile(getTarget(), path); } }