/** * Return a build that maps to the sub file. * * @param string * @throws Exception */ public ProjectBuilder getSubBuilder(String string) throws Exception { Collection< ? extends Builder> builders = getSubBuilders(); for (Builder b : builders) { if (b.getBsn().equals(string) || b.getBsn().endsWith("." + string)) return (ProjectBuilder) b; } return null; }
/** * Return a build that maps to the sub file. * * @param string * @throws Exception */ public ProjectBuilder getSubBuilder(String string) throws Exception { Collection< ? extends Builder> builders = getSubBuilders(); for (Builder b : builders) { if (b.getBsn().equals(string) || b.getBsn().endsWith("." + string)) return (ProjectBuilder) b; } return null; }
/** * 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, null); result.add(c); } return result; }
/** * 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, null); result.add(c); } return result; }
/** * 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, 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, @SuppressWarnings("unused") 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; }
/** * 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<>(); try (ProjectBuilder pb = getBuilder(null)) { for (Builder builder : pb.getSubBuilders()) { Container c = new Container(this, builder.getBsn(), builder.getVersion(), Container.TYPE.PROJECT, getOutputFile(builder.getBsn(), builder.getVersion()), null, null, null); result.add(c); } return result; } }
/** * 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<>(); try (ProjectBuilder pb = getBuilder(null)) { for (Builder builder : pb.getSubBuilders()) { Container c = new Container(this, builder.getBsn(), builder.getVersion(), Container.TYPE.PROJECT, getOutputFile(builder.getBsn(), builder.getVersion()), null, null, null); result.add(c); } return result; } }
public Map<String, Version> getVersions() throws Exception { synchronized (versionMap) { if (versionMap.isEmpty()) { for (Builder builder : getSubBuilders()) { String v = builder.getVersion(); if (v == null) v = "0"; else { v = Analyzer.cleanupVersion(v); if (!Verifier.isVersion(v)) continue; // skip } Version version = new Version(v); versionMap.put(builder.getBsn(), version); } } return new LinkedHashMap<String, Version>(versionMap); } }
/** * Sign the jar file. -sign : <alias> [ ';' 'password:=' <password> ] [ ';' * 'keystore:=' <keystore> ] [ ';' 'sign-password:=' <pw> ] ( ',' ... )* */ void sign(@SuppressWarnings("unused") Jar jar) throws Exception { String signing = getProperty(SIGN); if (signing == null) return; logger.debug("Signing {}, with {}", getBsn(), signing); List<SignerPlugin> signers = getPlugins(SignerPlugin.class); Parameters infos = parseHeader(signing); for (Entry<String, Attrs> entry : infos.entrySet()) { for (SignerPlugin signer : signers) { signer.sign(this, entry.getKey()); } } }
public Map<String, Version> getVersions() throws Exception { if (versionMap.isEmpty()) { try (ProjectBuilder pb = getBuilder(null)) { for (Builder builder : pb.getSubBuilders()) { String v = builder.getVersion(); if (v == null) v = "0"; else { v = Analyzer.cleanupVersion(v); if (!Verifier.isVersion(v)) continue; // skip } Version version = new Version(v); versionMap.put(builder.getBsn(), version); } } } return new LinkedHashMap<>(versionMap); }
/** * 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, @SuppressWarnings("unused") 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, sub.getVersion())); } return null; }
/** * Sign the jar file. -sign : <alias> [ ';' 'password:=' <password> ] [ ';' * 'keystore:=' <keystore> ] [ ';' 'sign-password:=' <pw> ] ( ',' ... )* */ void sign(@SuppressWarnings("unused") Jar jar) throws Exception { String signing = getProperty(SIGN); if (signing == null) return; logger.debug("Signing {}, with {}", getBsn(), signing); List<SignerPlugin> signers = getPlugins(SignerPlugin.class); Parameters infos = parseHeader(signing); for (Entry<String, Attrs> entry : infos.entrySet()) { for (SignerPlugin signer : signers) { signer.sign(this, entry.getKey()); } } }
public SortedSet<Version> versions(String bsn) throws Exception { List<Version> versions = new ArrayList<Version>(); Collection<Project> projects = workspace.getAllProjects(); for (Project project : projects) { for (Builder builder : project.getSubBuilders()) { if (bsn.equals(builder.getBsn())) { String v = builder.getVersion(); if (v == null) v = "0"; else if (!Verifier.isVersion(v)) continue; // skip versions.add(new Version(v)); } } } if ( versions.isEmpty()) return SortedList.empty(); return new SortedList<Version>(versions); }
/** * 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, @SuppressWarnings("unused") 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, sub.getVersion())); } return null; }
public Map<String, Version> getVersions() throws Exception { if (versionMap.isEmpty()) { try (ProjectBuilder pb = getBuilder(null)) { for (Builder builder : pb.getSubBuilders()) { String v = builder.getVersion(); if (v == null) v = "0"; else { v = Analyzer.cleanupVersion(v); if (!Verifier.isVersion(v)) continue; // skip } Version version = new Version(v); versionMap.put(builder.getBsn(), version); } } } return new LinkedHashMap<>(versionMap); }
/** * Answer the container associated with a given bsn. * * @throws Exception */ public Container getDeliverable(String bsn, Map<String, String> attrs) throws Exception { try (ProjectBuilder pb = getBuilder(null)) { for (Builder b : pb.getSubBuilders()) { if (b.getBsn() .equals(bsn)) return new Container(this, getOutputFile(bsn, b.getVersion()), attrs); } } return null; }
/** * Answer the container associated with a given bsn. * * @throws Exception */ public Container getDeliverable(String bsn, Map<String, String> attrs) throws Exception { try (ProjectBuilder pb = getBuilder(null)) { for (Builder b : pb.getSubBuilders()) { if (b.getBsn() .equals(bsn)) return new Container(this, getOutputFile(bsn, b.getVersion()), attrs); } } return null; }
/** * Sign the jar file. -sign : <alias> [ ';' 'password:=' <password> ] [ ';' * 'keystore:=' <keystore> ] [ ';' 'sign-password:=' <pw> ] ( ',' ... )* * * @return */ void sign(@SuppressWarnings("unused") 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); Parameters infos = parseHeader(signing); for (Entry<String,Attrs> 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(@SuppressWarnings("unused") 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); Parameters infos = parseHeader(signing); for (Entry<String,Attrs> entry : infos.entrySet()) { for (SignerPlugin signer : signers) { signer.sign(this, entry.getKey()); } } }