/** * Returns containers for the deliverables of this project. The deliverables * is the project builder for this project if no -sub is specified. * Otherwise it contains all the sub bnd files. * * @return A collection of containers * * @throws Exception */ public Collection<Container> getDeliverables() throws Exception { List<Container> result = new ArrayList<Container>(); Collection<? extends Builder> builders = getSubBuilders(); for (Builder builder : builders) { Container c = new Container(this, builder.getBsn(), builder.getVersion(), Container.TYPE.PROJECT, getOutputFile(builder.getBsn()), null, null); result.add(c); } return result; }
/** * Answer the container associated with a given bsn. * * @param bndFile * A file pointing to a bnd file. * @return null or the builder for a sub file. * @throws Exception */ public Container getDeliverable(String bsn, Map<String, String> attrs) throws Exception { Collection<? extends Builder> builders = getSubBuilders(); for (Builder sub : builders) { if (sub.getBsn().equals(bsn)) return new Container(this, getOutputFile(bsn)); } return null; }
/** * Sign the jar file. * * -sign : <alias> [ ';' 'password:=' <password> ] [ ';' 'keystore:=' * <keystore> ] [ ';' 'sign-password:=' <pw> ] ( ',' ... )* * * @return */ void sign(Jar jar) throws Exception { String signing = getProperty("-sign"); if (signing == null) return; trace("Signing %s, with %s", getBsn(), signing); List<SignerPlugin> signers = getPlugins(SignerPlugin.class); Map<String, Map<String, String>> infos = parseHeader(signing); for (Map.Entry<String, Map<String, String>> entry : infos.entrySet()) { for (SignerPlugin signer : signers) { signer.sign(this, entry.getKey()); } } }
/** * Sign the jar file. * * -sign : <alias> [ ';' 'password:=' <password> ] [ ';' 'keystore:=' * <keystore> ] [ ';' 'sign-password:=' <pw> ] ( ',' ... )* * * @return */ void sign(Jar jar) throws Exception { String signing = getProperty("-sign"); if (signing == null) return; trace("Signing %s, with %s", getBsn(), signing); List<SignerPlugin> signers = getPlugins(SignerPlugin.class); Map<String, Map<String, String>> infos = parseHeader(signing); for (Map.Entry<String, Map<String, String>> entry : infos.entrySet()) { for (SignerPlugin signer : signers) { signer.sign(this, entry.getKey()); } } }
return; String name = builder.getBsn() + DEFAULT_JAR_EXTENSION;
String name = builder.getBsn() + ".jar";
String name = builder.getBsn() + ".jar";
jar.setName(builder.getBsn()); result.add(jar); } catch (Exception e) {
return; String name = builder.getBsn() + DEFAULT_JAR_EXTENSION;
File target = pb.getProject().getTarget(); target.mkdirs(); String bsn = bchild.getBsn(); File output = new File(target, bsn+".jar"); jar.write(output);
ProjectBuilder pb = (ProjectBuilder) builder; File target = pb.getProject().getTarget(); String bsn = bchild.getBsn(); File output = new File(target, bsn+".jar"); jar.write(output);
dot.setName(getBsn());
dot.setName(getBsn());