/** * 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); } }
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); } }
/** * 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; }
/** * 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; }
/** * 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; }
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); }
/** * 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; }
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); }
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); }
/** * 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. * * @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; }
/** * Intercept the call to analyze and cleanup versions after we have analyzed * the setup. We do not want to cleanup if we are going to verify. */ @Override public void analyze() throws Exception { super.analyze(); cleanupVersion(getImports(), null); cleanupVersion(getExports(), getVersion()); String version = getProperty(BUNDLE_VERSION); if (version != null) { version = cleanupVersion(version); if (version.endsWith(".SNAPSHOT")) { version = version.replaceAll("SNAPSHOT$", getProperty(SNAPSHOT, "SNAPSHOT")); } setProperty(BUNDLE_VERSION, version); } }
/** * Intercept the call to analyze and cleanup versions after we have analyzed * the setup. We do not want to cleanup if we are going to verify. */ @Override public void analyze() throws Exception { super.analyze(); cleanupVersion(getImports(), null); cleanupVersion(getExports(), getVersion()); String version = getProperty(BUNDLE_VERSION); if (version != null) { version = cleanupVersion(version); if (version.endsWith(".SNAPSHOT")) { version = version.replaceAll("SNAPSHOT$", getProperty(SNAPSHOT, "SNAPSHOT")); } setProperty(BUNDLE_VERSION, version); } }
/** * Intercept the call to analyze and cleanup versions after we have analyzed * the setup. We do not want to cleanup if we are going to verify. */ @Override public void analyze() throws Exception { super.analyze(); cleanupVersion(getImports(), null); cleanupVersion(getExports(), getVersion()); String version = getProperty(BUNDLE_VERSION); if (version != null) { version = cleanupVersion(version); if (version.endsWith(".SNAPSHOT")) { version = version.replaceAll("SNAPSHOT$", getProperty(SNAPSHOT, "SNAPSHOT")); } setProperty(BUNDLE_VERSION, version); } }
/** * Intercept the call to analyze and cleanup versions after we have analyzed * the setup. We do not want to cleanup if we are going to verify. */ @Override public void analyze() throws Exception { super.analyze(); cleanupVersion(getImports(), null); cleanupVersion(getExports(), getVersion()); String version = getProperty(BUNDLE_VERSION); if (version != null) { version = cleanupVersion(version); version = doSnapshot(version); setProperty(BUNDLE_VERSION, version); } }
/** * Intercept the call to analyze and cleanup versions after we have analyzed * the setup. We do not want to cleanup if we are going to verify. */ @Override public void analyze() throws Exception { super.analyze(); cleanupVersion(getImports(), null); cleanupVersion(getExports(), getVersion()); String version = getProperty(BUNDLE_VERSION); if (version != null) { version = cleanupVersion(version); version = doSnapshot(version); setProperty(BUNDLE_VERSION, version); } }
/** * Called when we're done with a builder. In this case we retrieve package * information from builder. */ @Override protected void doneBuild(Builder builder) throws Exception { project.exportedPackages.putAll(builder.getExports()); project.importedPackages.putAll(builder.getImports()); project.containedPackages.putAll(builder.getContained()); xrefClasspath(project.unreferencedClasspathEntries, builder.getImports()); xrefClasspath(project.unreferencedClasspathEntries, builder.getContained()); // // For the workspace repo, we maintain a map // of bsn -> version for this project. So here // we update this map. In the startBuild method // we cleared the map // Version version = new Version(cleanupVersion(builder.getVersion())); project.versionMap.put(builder.getBsn(), version); super.doneBuild(builder); }