private void prebuild(List<String> set, List<String> order, List<Builder> builders, String s) throws IOException { if (order.contains(s)) // Already done return; if (set.contains(s)) error("Cyclic -prebuild dependency %s from %s", s, set); Builder b = new Builder(this); b.setProperties(getFile(s)); String prebuild = b.get("prebuild"); if (prebuild != null) { set.add(s); try { Collection<String> parts = split(prebuild); for (String p : parts) { prebuild(set, order, builders, p); } } finally { set.remove(s); } } order.add(s); builders.add(b); }
public Builder getSubBuilder() throws Exception { Builder builder = new Builder(this); builder.setBase(getBase()); for (Jar file : getClasspath()) { builder.addClasspath(file); } return builder; }
public Builder getSubBuilder() throws Exception { Builder builder = new Builder(this); builder.setBase(getBase()); for (Jar file : getClasspath()) { builder.addClasspath(file); } return builder; }
public Builder getSubBuilder() throws Exception { Builder builder = new Builder(this); builder.setBase(getBase()); for (Jar file : getClasspath()) { builder.addClasspath(file); } return builder; }
CachedPom pom = maven.getPom(group, artifact, version, urls2); Builder a = new Builder(); a.setProperty("Private-Package", "*"); Set<Pom> dependencies = pom.getDependencies(Scope.compile, urls2);
CachedPom pom = maven.getPom(group, artifact, version, urls2); Builder a = new Builder(); a.setProperty(Constants.PRIVATEPACKAGE, "*"); Set<Pom> dependencies = pom.getDependencies(Scope.compile, urls2);
CachedPom pom = maven.getPom(group, artifact, version, urls2); Builder a = new Builder(); a.setProperty(Constants.PRIVATEPACKAGE, "*"); Set<Pom> dependencies = pom.getDependencies(Scope.compile, urls2);
CachedPom pom = maven.getPom(group, artifact, version, urls2); try (Builder a = new Builder()) { a.setProperty(Constants.PRIVATEPACKAGE, "*"); Set<Pom> dependencies = pom.getDependencies(Scope.compile, urls2);
public Builder getSubBuilder() throws Exception { Builder builder = new Builder(this); builder.setBase(getBase()); builder.use(this); for (Jar file : getClasspath()) { builder.addClasspath(file); } return builder; }
public Builder getSubBuilder() throws Exception { Builder builder = new Builder(this); builder.setBase(getBase()); builder.use(this); for (Jar file : getClasspath()) { builder.addClasspath(file); } return builder; }
CachedPom pom = maven.getPom(group, artifact, version, urls2); try (Builder a = new Builder()) { a.setProperty(Constants.PRIVATEPACKAGE, "*"); Set<Pom> dependencies = pom.getDependencies(Scope.compile, urls2);
if (manifest == null) { logger.debug("Wrapping with all defaults"); Builder b = new Builder(this); this.addClose(b); b.addClasspath(jar); .getValue(Constants.BUNDLE_MANIFESTVERSION) == null) { logger.debug("Not a release 4 bundle, wrapping with manifest as source"); Builder b = new Builder(this); this.addClose(b); b.addClasspath(jar);
if (manifest == null) { logger.debug("Wrapping with all defaults"); Builder b = new Builder(this); this.addClose(b); b.addClasspath(jar); .getValue(Constants.BUNDLE_MANIFESTVERSION) == null) { logger.debug("Not a release 4 bundle, wrapping with manifest as source"); Builder b = new Builder(this); this.addClose(b); b.addClasspath(jar);
public Jar getValidJar(Jar jar, String id) throws Exception { Manifest manifest = jar.getManifest(); if (manifest == null) { trace("Wrapping with all defaults"); Builder b = new Builder(this); b.addClasspath(jar); b.setProperty("Bnd-Message", "Wrapped from " + id + "because lacked manifest"); b.setProperty(Constants.EXPORT_PACKAGE, "*"); b.setProperty(Constants.IMPORT_PACKAGE, "*;resolution:=optional"); jar = b.build(); } else if (manifest.getMainAttributes().getValue(Constants.BUNDLE_MANIFESTVERSION) == null) { trace("Not a release 4 bundle, wrapping with manifest as source"); Builder b = new Builder(this); b.addClasspath(jar); b.setProperty(Constants.PRIVATE_PACKAGE, "*"); b.mergeManifest(manifest); String imprts = manifest.getMainAttributes().getValue(Constants.IMPORT_PACKAGE); if (imprts == null) imprts = ""; else imprts += ","; imprts += "*;resolution=optional"; b.setProperty(Constants.IMPORT_PACKAGE, imprts); b.setProperty("Bnd-Message", "Wrapped from " + id + "because had incomplete manifest"); jar = b.build(); } return jar; }
public Jar getValidJar(Jar jar, String id) throws Exception { Manifest manifest = jar.getManifest(); if (manifest == null) { trace("Wrapping with all defaults"); Builder b = new Builder(this); this.addClose(b); b.addClasspath(jar); b.setProperty("Bnd-Message", "Wrapped from " + id + "because lacked manifest"); b.setProperty(Constants.EXPORT_PACKAGE, "*"); b.setProperty(Constants.IMPORT_PACKAGE, "*;resolution:=optional"); jar = b.build(); } else if (manifest.getMainAttributes().getValue(Constants.BUNDLE_MANIFESTVERSION) == null) { trace("Not a release 4 bundle, wrapping with manifest as source"); Builder b = new Builder(this); this.addClose(b); b.addClasspath(jar); b.setProperty(Constants.PRIVATE_PACKAGE, "*"); b.mergeManifest(manifest); String imprts = manifest.getMainAttributes().getValue(Constants.IMPORT_PACKAGE); if (imprts == null) imprts = ""; else imprts += ","; imprts += "*;resolution=optional"; b.setProperty(Constants.IMPORT_PACKAGE, imprts); b.setProperty("Bnd-Message", "Wrapped from " + id + "because had incomplete manifest"); jar = b.build(); } return jar; }
private static Builder getOSGiBuilder(File basedir, Properties properties, Jar[] classpath) { Builder builder = new Builder(); synchronized (BundlePackager.class) { builder.setBase(basedir); } // Add the range fixer plugin final ImportedPackageRangeFixer plugin = new ImportedPackageRangeFixer(); plugin.setReporter(builder); plugin.setProperties(Collections.<String, String>emptyMap()); builder.addBasicPlugin(plugin); builder.setProperties(Instructions.sanitize(properties)); if (classpath != null) { builder.setClasspath(classpath); } return builder; }
public Jar getValidJar(Jar jar, String id) throws Exception { Manifest manifest = jar.getManifest(); if (manifest == null) { trace("Wrapping with all defaults"); Builder b = new Builder(this); this.addClose(b); b.addClasspath(jar); b.setProperty("Bnd-Message", "Wrapped from " + id + "because lacked manifest"); b.setProperty(Constants.EXPORT_PACKAGE, "*"); b.setProperty(Constants.IMPORT_PACKAGE, "*;resolution:=optional"); jar = b.build(); } else if (manifest.getMainAttributes().getValue(Constants.BUNDLE_MANIFESTVERSION) == null) { trace("Not a release 4 bundle, wrapping with manifest as source"); Builder b = new Builder(this); this.addClose(b); b.addClasspath(jar); b.setProperty(Constants.PRIVATE_PACKAGE, "*"); b.mergeManifest(manifest); String imprts = manifest.getMainAttributes().getValue(Constants.IMPORT_PACKAGE); if (imprts == null) imprts = ""; else imprts += ","; imprts += "*;resolution=optional"; b.setProperty(Constants.IMPORT_PACKAGE, imprts); b.setProperty("Bnd-Message", "Wrapped from " + id + "because had incomplete manifest"); jar = b.build(); } return jar; }
try (Builder builder = new Builder()) {
properties.putAll( instructions ); final Builder analyzer = new Builder(); analyzer.setJar( jar ); analyzer.setProperties( properties );
public void build(String dest, boolean force, String path) throws IOException, Exception { Builder b = new Builder(); try { File f = getFile(path); if (!f.isFile()) { error("No such file %s", f); return; } b.setTrace(isTrace()); b.setPedantic(isPedantic()); b.setProperties(f); List<Builder> subs = b.getSubBuilders(); for (Builder bb : subs) { trace("building %s", bb.getPropertiesFile()); bb.build(); File out = bb.getOutputFile(dest); getInfo(bb, bb.getBsn() + ": "); if (isOk()) { bb.save(out, force); } getInfo(bb, bb.getBsn() + ": "); // pickup any save errors if (!isOk()) { out.delete(); } } } finally { b.close(); } }