本文整理了Java中aQute.bnd.osgi.Builder.getVersion()
方法的一些代码示例,展示了Builder.getVersion()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Builder.getVersion()
方法的具体详情如下:
包路径:aQute.bnd.osgi.Builder
类名称:Builder
方法名:getVersion
暂无
代码示例来源:origin: biz.aQute.bnd/biz.aQute.bndlib
/**
* 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;
}
}
代码示例来源:origin: biz.aQute.bnd/biz.aQute.bnd
/**
* 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;
}
}
代码示例来源:origin: biz.aQute.bnd/bnd
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);
}
}
代码示例来源:origin: biz.aQute.bnd/bndlib
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);
}
}
代码示例来源:origin: biz.aQute.bnd/bnd
/**
* 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;
}
代码示例来源:origin: biz.aQute.bnd/bndlib
/**
* 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;
}
代码示例来源:origin: biz.aQute/bndlib
/**
* 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;
}
代码示例来源:origin: biz.aQute.bnd/biz.aQute.bnd
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);
}
代码示例来源:origin: biz.aQute.bnd/bndlib
/**
* 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;
}
代码示例来源:origin: biz.aQute.bnd/biz.aQute.bndlib
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);
}
代码示例来源:origin: biz.aQute/bndlib
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);
}
代码示例来源:origin: biz.aQute.bnd/bnd
/**
* 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;
}
代码示例来源:origin: biz.aQute.bnd/biz.aQute.bndlib
/**
* 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;
}
代码示例来源:origin: biz.aQute.bnd/biz.aQute.bnd
/**
* 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;
}
代码示例来源:origin: biz.aQute.bnd/bnd
/**
* 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);
}
}
代码示例来源:origin: biz.aQute/bndlib
/**
* 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);
}
}
代码示例来源:origin: biz.aQute.bnd/bndlib
/**
* 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);
}
}
代码示例来源:origin: biz.aQute.bnd/biz.aQute.bndlib
/**
* 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);
}
}
代码示例来源:origin: biz.aQute.bnd/biz.aQute.bnd
/**
* 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);
}
}
代码示例来源:origin: biz.aQute.bnd/biz.aQute.bndlib
/**
* 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);
}
内容来源于网络,如有侵权,请联系作者删除!