@Override public Entry<String, Resource> export(String type, Project project, Map<String, String> options) throws Exception { Configuration configuration = Converter.cnv(Configuration.class, options); project.prepare(); try (ProjectLauncher launcher = project.getProjectLauncher()) { launcher.setKeep(configuration.keep()); Jar jar = launcher.executable(); project.getInfo(launcher); String name = jar.getName(); String[] baseext = Strings.extension(name); if (baseext != null && ("bnd".equals(baseext[1]) || "bndrun".equals(baseext[1]))) { name = baseext[0]; } name = name + Constants.DEFAULT_JAR_EXTENSION; return new SimpleEntry<>(name, new JarResource(jar, true)); } } }
@Override public Entry<String, Resource> export(String type, Project project, Map<String, String> options) throws Exception { project.prepare(); Collection<Container> runbundles = project.getRunbundles(); Jar jar = new Jar(project.getName()); jar.setDoNotTouchManifest(); for (Container container : runbundles) { File source = container.getFile(); String path = nonCollidingPath(jar, source.getName()); jar.putResource(path, new FileResource(source)); } return new SimpleEntry<>(jar.getName(), new JarResource(jar, true)); }
@Override public Entry<String, Resource> export(String type, Project project, Map<String, String> options) throws Exception { project.prepare(); Collection<Container> runbundles = project.getRunbundles(); Jar jar = new Jar(project.getName()); jar.setDoNotTouchManifest(); for (Container container : runbundles) { File source = container.getFile(); String path = nonCollidingPath(jar, source.getName()); jar.putResource(path, new FileResource(source)); } return new SimpleEntry<>(jar.getName(), new JarResource(jar, true)); }
@Override public Entry<String, Resource> export(String type, Project project, Map<String, String> options) throws Exception { Configuration configuration = Converter.cnv(Configuration.class, options); project.prepare(); try (ProjectLauncher launcher = project.getProjectLauncher()) { launcher.setKeep(configuration.keep()); Jar jar = launcher.executable(); project.getInfo(launcher); String name = jar.getName(); String[] baseext = Strings.extension(name); if (baseext != null && ("bnd".equals(baseext[1]) || "bndrun".equals(baseext[1]))) { name = baseext[0]; } name = name + Constants.DEFAULT_JAR_EXTENSION; return new SimpleEntry<>(name, new JarResource(jar, true)); } } }
public Bundle install() throws Exception { try { Jar jar = new Jar("x"); for (Entry<String, Resource> e : additionalResources.entrySet()) { jar.putResource(e.getKey(), e.getValue()); } setJar(jar); jar = build(); try (JarResource j = new JarResource(jar);) { return context.installBundle("generated " + jar.getBsn(), j.openInputStream()); } } finally { close(); } }
public Bundle install() throws Exception { try { Jar jar = new Jar("x"); for (Entry<String, Resource> e : additionalResources.entrySet()) { jar.putResource(e.getKey(), e.getValue()); } setJar(jar); jar = build(); try (JarResource j = new JarResource(jar);) { return context.installBundle("generated " + jar.getBsn(), j.openInputStream()); } } finally { close(); } }
dot.putResource(path, new JarResource(jar)); setProperty(BUNDLE_CLASSPATH, append(getProperty(BUNDLE_CLASSPATH), path));
addClose(jar); String path = "WEB-INF/lib/" + f.getName(); dot.putResource(path, new JarResource(jar)); setProperty(BUNDLE_CLASSPATH, append(getProperty(BUNDLE_CLASSPATH), path));
addClose(jar); String path = "WEB-INF/lib/" + f.getName(); dot.putResource(path, new JarResource(jar)); setProperty(BUNDLE_CLASSPATH, append(getProperty(BUNDLE_CLASSPATH), path));
dot.putResource(path, new JarResource(jar)); setProperty(BUNDLE_CLASSPATH, append(getProperty(BUNDLE_CLASSPATH), path));
addClose(jar); String path = "WEB-INF/lib/" + f.getName(); dot.putResource(path, new JarResource(jar)); setProperty(BUNDLE_CLASSPATH, append(getProperty(BUNDLE_CLASSPATH), path));
private void noSuchFile(Jar jar, String clause, Map<String, String> extra, String source, String destinationPath) throws Exception { List<Jar> src = getJarsFromName(source, Constants.INCLUDE_RESOURCE + " " + source); if (!src.isEmpty()) { for (Jar j : src) { String quoted = j.getSource() != null ? j.getSource() .getName() : j.getName(); // Do not touch the manifest so this also // works for signed files. j.setDoNotTouchManifest(); JarResource jarResource = new JarResource(j); String path = destinationPath.replace(source, quoted); logger.debug("copy d={} s={} path={}", jar, j, path); copy(jar, path, jarResource, extra); } } else { Resource lastChance = make.process(source); if (lastChance != null) { String x = extra.get("extra"); if (x != null) lastChance.setExtra(x); copy(jar, destinationPath, lastChance, extra); } else error("Input file does not exist: %s", source).header(source) .context(clause); } }
private void noSuchFile(Jar jar, @SuppressWarnings("unused") String clause, Map<String,String> extra, String source, String destinationPath) throws Exception { Jar src = getJarFromName(source, Constants.INCLUDE_RESOURCE + " " + source); if (src != null) { // Do not touch the manifest so this also // works for signed files. src.setDoNotTouchManifest(); JarResource jarResource = new JarResource(src); jar.putResource(destinationPath, jarResource); } else { Resource lastChance = make.process(source); if (lastChance != null) { String x = extra.get("extra"); if (x != null) lastChance.setExtra(x); jar.putResource(destinationPath, lastChance); } else error("Input file does not exist: " + source); } }
private void noSuchFile(Jar jar, String clause, Map<String, String> extra, String source, String destinationPath) throws Exception { List<Jar> src = getJarsFromName(source, Constants.INCLUDE_RESOURCE + " " + source); if (!src.isEmpty()) { for (Jar j : src) { String quoted = j.getSource() != null ? j.getSource() .getName() : j.getName(); // Do not touch the manifest so this also // works for signed files. j.setDoNotTouchManifest(); JarResource jarResource = new JarResource(j); String path = destinationPath.replace(source, quoted); logger.debug("copy d={} s={} path={}", jar, j, path); copy(jar, path, jarResource, extra); } } else { Resource lastChance = make.process(source); if (lastChance != null) { String x = extra.get("extra"); if (x != null) lastChance.setExtra(x); copy(jar, destinationPath, lastChance, extra); } else error("Input file does not exist: %s", source).header(source) .context(clause); } }
return new JarResource(jar);
private void noSuchFile(Jar jar, @SuppressWarnings("unused") String clause, Map<String,String> extra, String source, String destinationPath) throws Exception { Jar src = getJarFromName(source, "Include-Resource " + source); if (src != null) { // Do not touch the manifest so this also // works for signed files. src.setDoNotTouchManifest(); JarResource jarResource = new JarResource(src); jar.putResource(destinationPath, jarResource); } else { Resource lastChance = make.process(source); if (lastChance != null) { String x = extra.get("extra"); if (x != null) lastChance.setExtra(x); jar.putResource(destinationPath, lastChance); } else error("Input file does not exist: " + source); } }
private void noSuchFile(Jar jar, @SuppressWarnings("unused") String clause, Map<String,String> extra, String source, String destinationPath) throws Exception { Jar src = getJarFromName(source, Constants.INCLUDE_RESOURCE + " " + source); if (src != null) { // Do not touch the manifest so this also // works for signed files. src.setDoNotTouchManifest(); JarResource jarResource = new JarResource(src); jar.putResource(destinationPath, jarResource); } else { Resource lastChance = make.process(source); if (lastChance != null) { String x = extra.get("extra"); if (x != null) lastChance.setExtra(x); jar.putResource(destinationPath, lastChance); } else error("Input file does not exist: " + source); } }
return new JarResource(jar);
return new JarResource(jar);
return new JarResource(jar);