Update to upstream version 3.2.0

This commit is contained in:
Michael Simacek 2016-05-26 18:18:57 +02:00
parent 52825adc84
commit a05b85b593
9 changed files with 908 additions and 610 deletions

5
.gitignore vendored
View File

@ -3,3 +3,8 @@
/2.4.1.REL.tar.gz
/biz.aQute.bnd-2.4.1.pom
/biz.aQute.bndlib-2.4.1.pom
/3.2.0.REL.tar.gz
/aQute.libg-3.2.0.pom
/biz.aQute.bnd-3.2.0.pom
/biz.aQute.bndlib-3.2.0.pom
/biz.aQute.bnd.annotation-3.2.0.pom

View File

@ -1,25 +1,76 @@
From 8989181fa07ecd77e7e4383c692d5122f0114673 Mon Sep 17 00:00:00 2001
From 7b48ce7a5a1534d12598ddef711628824054f312 Mon Sep 17 00:00:00 2001
From: Michael Simacek <msimacek@redhat.com>
Date: Tue, 28 Apr 2015 16:45:08 +0200
Subject: [PATCH 1/3] Port to Java 8
Date: Thu, 26 May 2016 15:43:14 +0200
Subject: [PATCH 1/2] Port to Java 8
---
aQute.libg/src/aQute/lib/collections/MultiMap.java | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
aQute.libg/src/aQute/lib/collections/DoubleKeyMap.java | 14 --------------
aQute.libg/src/aQute/lib/collections/SortedList.java | 6 ++++++
biz.aQute.bnd/src/aQute/bnd/ant/BndTask.java | 2 +-
3 files changed, 7 insertions(+), 15 deletions(-)
diff --git a/aQute.libg/src/aQute/lib/collections/MultiMap.java b/aQute.libg/src/aQute/lib/collections/MultiMap.java
index bcfe354..2e91bdc 100644
--- a/aQute.libg/src/aQute/lib/collections/MultiMap.java
+++ b/aQute.libg/src/aQute/lib/collections/MultiMap.java
@@ -81,7 +81,7 @@ public class MultiMap<K, V> extends HashMap<K,List<V>> implements Map<K,List<V>>
return set.addAll(value);
diff --git a/aQute.libg/src/aQute/lib/collections/DoubleKeyMap.java b/aQute.libg/src/aQute/lib/collections/DoubleKeyMap.java
index 4107f31..40ecfdf 100644
--- a/aQute.libg/src/aQute/lib/collections/DoubleKeyMap.java
+++ b/aQute.libg/src/aQute/lib/collections/DoubleKeyMap.java
@@ -97,20 +97,6 @@ public class DoubleKeyMap<K1, K2, V> extends HashMap<K1,Map<K2,V>>implements Map
return result;
}
- public boolean remove(K key, V value) {
+ public boolean remove(Object key, Object value) {
assert keyClass.isInstance(key);
assert valueClass.isInstance(value);
- public V remove(K1 key1, K2 key2) {
- assert k1Class.isInstance(key1);
- assert k2Class.isInstance(key2);
-
- Map<K2,V> set = get(key1);
- if (set == null) {
- return null;
- }
- V result = set.remove(key2);
- if (set.isEmpty())
- remove(key1);
- return result;
- }
-
public Iterator<Map.Entry<K2,V>> iterate(K1 key) {
assert k1Class.isInstance(key);
Map<K2,V> set = get(key);
diff --git a/aQute.libg/src/aQute/lib/collections/SortedList.java b/aQute.libg/src/aQute/lib/collections/SortedList.java
index 493d7bc..8a48a72 100644
--- a/aQute.libg/src/aQute/lib/collections/SortedList.java
+++ b/aQute.libg/src/aQute/lib/collections/SortedList.java
@@ -9,6 +9,7 @@ import java.util.List;
import java.util.ListIterator;
import java.util.NoSuchElementException;
import java.util.SortedSet;
+import java.util.Spliterator;
/**
* An immutbale list that sorts objects by their natural order or through a
@@ -28,6 +29,11 @@ import java.util.SortedSet;
*/
@SuppressWarnings("unchecked")
public class SortedList<T> implements SortedSet<T>, List<T> {
+
+ @Override
+ public Spliterator<T> spliterator() {
+ return List.super.spliterator();
+ }
static SortedList< ? > empty = new SortedList<Object>();
final T[] list;
diff --git a/biz.aQute.bnd/src/aQute/bnd/ant/BndTask.java b/biz.aQute.bnd/src/aQute/bnd/ant/BndTask.java
index 6f5f107..b35d2e1 100644
--- a/biz.aQute.bnd/src/aQute/bnd/ant/BndTask.java
+++ b/biz.aQute.bnd/src/aQute/bnd/ant/BndTask.java
@@ -217,7 +217,7 @@ public class BndTask extends BaseTask {
if (inherit) {
Properties projectProperties = new UTF8Properties();
@SuppressWarnings("unchecked")
- Hashtable<Object,Object> antProps = getProject().getProperties();
+ Hashtable<String,Object> antProps = getProject().getProperties();
projectProperties.putAll(antProps);
projectProperties.putAll(builder.getProperties());
builder.setProperties(projectProperties);
--
2.1.0
2.5.5

View File

@ -1,145 +0,0 @@
From 60cd6ac1bf9e2ca9c2de1f33ed4fe3b7225f8f08 Mon Sep 17 00:00:00 2001
From: Michael Simacek <msimacek@redhat.com>
Date: Tue, 28 Apr 2015 17:02:29 +0200
Subject: [PATCH 2/3] Inline namespace constants
---
.../src/aQute/bnd/obr/OBRFragment.java | 22 ++++++++++------------
biz.aQute.bndlib/src/aQute/bnd/osgi/Contracts.java | 18 ++++++++----------
2 files changed, 18 insertions(+), 22 deletions(-)
diff --git a/biz.aQute.bndlib/src/aQute/bnd/obr/OBRFragment.java b/biz.aQute.bndlib/src/aQute/bnd/obr/OBRFragment.java
index 5311772..fb1c029 100644
--- a/biz.aQute.bndlib/src/aQute/bnd/obr/OBRFragment.java
+++ b/biz.aQute.bndlib/src/aQute/bnd/obr/OBRFragment.java
@@ -9,9 +9,7 @@ import java.util.regex.*;
import org.osgi.framework.Constants;
import org.osgi.framework.Version;
import org.osgi.framework.namespace.*;
-import org.osgi.namespace.service.*;
import org.osgi.resource.*;
-import org.osgi.service.repository.*;
import aQute.bnd.header.*;
import aQute.bnd.osgi.*;
@@ -206,10 +204,10 @@ public class OBRFragment {
//
for (Entry<String,Attrs> export : d.getParameters(Constants.EXPORT_SERVICE).entrySet()) {
- CapReqBuilder exportedService = new CapReqBuilder(ServiceNamespace.SERVICE_NAMESPACE);
+ CapReqBuilder exportedService = new CapReqBuilder("osgi.service");
String service = Processor.removeDuplicateMarker(export.getKey());
- exportedService.addAttribute(ServiceNamespace.SERVICE_NAMESPACE, service);
- exportedService.addAttribute(ServiceNamespace.CAPABILITY_OBJECTCLASS_ATTRIBUTE,
+ exportedService.addAttribute("osgi.service", service);
+ exportedService.addAttribute("objectClass",
export.getValue().get("objectclass"));
resource.addCapability(exportedService);
}
@@ -219,10 +217,10 @@ public class OBRFragment {
//
for (Entry<String,Attrs> imported : d.getParameters(Constants.IMPORT_SERVICE).entrySet()) {
- CapReqBuilder importedService = new CapReqBuilder(ServiceNamespace.SERVICE_NAMESPACE);
+ CapReqBuilder importedService = new CapReqBuilder("osgi.service");
String service = Processor.removeDuplicateMarker(imported.getKey());
importedService.addDirective(Namespace.REQUIREMENT_FILTER_DIRECTIVE,
- filter(ServiceNamespace.SERVICE_NAMESPACE, service, imported.getValue()));
+ filter("osgi.service", service, imported.getValue()));
resource.addRequirement(importedService);
}
@@ -266,16 +264,16 @@ public class OBRFragment {
if (!reporter.isOk())
return reporter;
- CapReqBuilder content = new CapReqBuilder(ContentNamespace.CONTENT_NAMESPACE);
+ CapReqBuilder content = new CapReqBuilder("osgi.content");
String sha = SHA1.digest(file).asHex();
- content.addAttribute(ContentNamespace.CONTENT_NAMESPACE, sha);
- content.addAttribute(ContentNamespace.CAPABILITY_SIZE_ATTRIBUTE, (long) file.length());
- content.addAttribute(ContentNamespace.CAPABILITY_MIME_ATTRIBUTE, MIME_TYPE_OSGI_BUNDLE);
+ content.addAttribute("osgi.content", sha);
+ content.addAttribute("size", (long) file.length());
+ content.addAttribute("mime", MIME_TYPE_OSGI_BUNDLE);
if (base != null) {
String path = file.getAbsolutePath();
if (base.startsWith(path)) {
- content.addAttribute(ContentNamespace.CAPABILITY_URL_ATTRIBUTE, path.substring(base.length())
+ content.addAttribute("url", path.substring(base.length())
.replace(File.separatorChar, '/'));
} else {
reporter.error("Base path %s is not parent of file path: %s", base, file.getAbsolutePath());
diff --git a/biz.aQute.bndlib/src/aQute/bnd/osgi/Contracts.java b/biz.aQute.bndlib/src/aQute/bnd/osgi/Contracts.java
index f32c5b0..887247b 100644
--- a/biz.aQute.bndlib/src/aQute/bnd/osgi/Contracts.java
+++ b/biz.aQute.bndlib/src/aQute/bnd/osgi/Contracts.java
@@ -3,8 +3,6 @@ package aQute.bnd.osgi;
import java.util.*;
import java.util.Map.Entry;
-import org.osgi.namespace.contract.*;
-
import aQute.bnd.header.*;
import aQute.bnd.osgi.Descriptors.PackageRef;
import aQute.bnd.version.*;
@@ -69,13 +67,13 @@ class Contracts {
contract: for (Entry<String,Attrs> p : pcs.entrySet()) {
String namespace = p.getKey();
- if (namespace.equals(ContractNamespace.CONTRACT_NAMESPACE)) {
+ if (namespace.equals("osgi.contract")) {
Attrs capabilityAttrs = p.getValue();
- String name = capabilityAttrs.get(ContractNamespace.CONTRACT_NAMESPACE);
+ String name = capabilityAttrs.get("osgi.contract");
if (name == null) {
analyzer.warning("No name (attr %s) defined in bundle %s from contract namespace: %s",
- ContractNamespace.CONTRACT_NAMESPACE, from, capabilityAttrs);
+ "osgi.contract", from, capabilityAttrs);
continue contract;
}
@@ -92,7 +90,7 @@ class Contracts {
Contract c = new Contract();
c.name = name;
- String list = capabilityAttrs.get(ContractNamespace.CAPABILITY_USES_DIRECTIVE + ":");
+ String list = capabilityAttrs.get("uses" + ":");
if (list == null || list.length() == 0) {
analyzer.warning("Contract %s has no uses: directive in %s.", name, from);
continue contract; // next contract
@@ -100,7 +98,7 @@ class Contracts {
c.uses = Processor.split(list);
- c.version = (Version) capabilityAttrs.getTyped(ContractNamespace.CAPABILITY_VERSION_ATTRIBUTE);
+ c.version = (Version) capabilityAttrs.getTyped("version");
c.from = from;
if (c.version == null) {
@@ -156,9 +154,9 @@ class Contracts {
void addToRequirements(Parameters requirements) {
for (Contract c : contracts) {
Attrs attrs = new Attrs(c.decorators);
- attrs.put(ContractNamespace.CONTRACT_NAMESPACE, c.name);
+ attrs.put("osgi.contract", c.name);
String range = analyzer.applyVersionPolicy(c.version.toString(), c.decorators.getVersion(), false);
- String name = ContractNamespace.CONTRACT_NAMESPACE;
+ String name = "osgi.contract";
while (requirements.containsKey(name))
name += "~";
@@ -166,7 +164,7 @@ class Contracts {
Formatter f = new Formatter();
try {
- f.format("(&(%s=%s)%s)", ContractNamespace.CONTRACT_NAMESPACE, c.name, r.toFilter());
+ f.format("(&(%s=%s)%s)", "osgi.contract", c.name, r.toFilter());
// TODO : shall we also assert the attributes?
--
2.1.0

View File

@ -0,0 +1,584 @@
From d8c6cbf2aa85fb742d6db307812ccff8ce483658 Mon Sep 17 00:00:00 2001
From: Michael Simacek <msimacek@redhat.com>
Date: Thu, 26 May 2016 16:57:46 +0200
Subject: [PATCH 2/2] Remove unavailable parts
---
biz.aQute.bnd/src/aQute/bnd/main/bnd.java | 30 -----------------
biz.aQute.bndlib/src/aQute/bnd/build/Project.java | 4 +--
.../src/aQute/bnd/component/AnnotationReader.java | 38 ++++++++--------------
.../src/aQute/bnd/component/ComponentDef.java | 1 -
.../src/aQute/bnd/component/FieldOption.java | 5 +++
.../src/aQute/bnd/component/HeaderReader.java | 1 -
.../src/aQute/bnd/component/ReferenceDef.java | 2 --
.../src/aQute/bnd/component/ReferenceScope.java | 13 ++++++++
.../src/aQute/bnd/component/ServiceScope.java | 14 ++++++++
.../src/aQute/bnd/http/HttpRequest.java | 23 -------------
.../src/aQute/bnd/obr/OBRFragment.java | 22 ++++++-------
biz.aQute.bndlib/src/aQute/bnd/osgi/Builder.java | 3 --
biz.aQute.bndlib/src/aQute/bnd/osgi/Contracts.java | 18 +++++-----
.../src/aQute/bnd/osgi/resource/CapReqBuilder.java | 12 +++----
.../src/aQute/bnd/osgi/resource/ResourceUtils.java | 18 ++++------
15 files changed, 76 insertions(+), 128 deletions(-)
create mode 100644 biz.aQute.bndlib/src/aQute/bnd/component/FieldOption.java
create mode 100644 biz.aQute.bndlib/src/aQute/bnd/component/ReferenceScope.java
create mode 100644 biz.aQute.bndlib/src/aQute/bnd/component/ServiceScope.java
diff --git a/biz.aQute.bnd/src/aQute/bnd/main/bnd.java b/biz.aQute.bnd/src/aQute/bnd/main/bnd.java
index 0a7affe..512d58f 100644
--- a/biz.aQute.bnd/src/aQute/bnd/main/bnd.java
+++ b/biz.aQute.bnd/src/aQute/bnd/main/bnd.java
@@ -4124,36 +4124,6 @@ public class bnd extends Processor {
}
/**
- * Resolve command
- *
- * @throws Exception
- */
-
- public void _resolve(ResolveCommand.ResolveOptions options) throws Exception {
- ResolveCommand rc = new ResolveCommand(this);
- String help = options._command().subCmd(options, rc);
- if (help != null)
- out.println(help);
- getInfo(rc);
- rc.close();
- }
-
- /**
- * Remote command
- *
- * @throws Exception
- */
-
- public void _remote(RemoteCommand.RemoteOptions options) throws Exception {
- RemoteCommand rc = new RemoteCommand(this, options);
- String help = options._command().subCmd(options, rc);
- if (help != null)
- out.println(help);
- getInfo(rc);
- rc.close();
- }
-
- /**
* Export a bndrun file
*/
diff --git a/biz.aQute.bndlib/src/aQute/bnd/build/Project.java b/biz.aQute.bndlib/src/aQute/bnd/build/Project.java
index b0740f1..8ad8831 100644
--- a/biz.aQute.bndlib/src/aQute/bnd/build/Project.java
+++ b/biz.aQute.bndlib/src/aQute/bnd/build/Project.java
@@ -43,8 +43,6 @@ import java.util.regex.Pattern;
import org.osgi.framework.namespace.IdentityNamespace;
import org.osgi.resource.Capability;
import org.osgi.resource.Requirement;
-import org.osgi.service.repository.ContentNamespace;
-import org.osgi.service.repository.Repository;
import aQute.bnd.build.Container.TYPE;
import aQute.bnd.header.Attrs;
@@ -1341,6 +1339,7 @@ public class Project extends Processor {
// If not, and if the repository implements the OSGi Repository
// Service, use a capability search on the osgi.content namespace.
+ /*
if (result == null && plugin instanceof Repository) {
Repository repo = (Repository) plugin;
@@ -1373,6 +1372,7 @@ public class Project extends Processor {
result = plugin.get(id, bndVersion, null, blocker);
}
}
+ */
if (result != null)
return toContainer(bsn, "hash", attrs, result, blocker);
diff --git a/biz.aQute.bndlib/src/aQute/bnd/component/AnnotationReader.java b/biz.aQute.bndlib/src/aQute/bnd/component/AnnotationReader.java
index 28d13ac..2a890fc 100644
--- a/biz.aQute.bndlib/src/aQute/bnd/component/AnnotationReader.java
+++ b/biz.aQute.bndlib/src/aQute/bnd/component/AnnotationReader.java
@@ -14,16 +14,11 @@ import java.util.regex.Pattern;
import org.osgi.service.component.annotations.Activate;
import org.osgi.service.component.annotations.Component;
-import org.osgi.service.component.annotations.ConfigurationPolicy;
import org.osgi.service.component.annotations.Deactivate;
-import org.osgi.service.component.annotations.FieldOption;
import org.osgi.service.component.annotations.Modified;
import org.osgi.service.component.annotations.Reference;
import org.osgi.service.component.annotations.ReferenceCardinality;
import org.osgi.service.component.annotations.ReferencePolicy;
-import org.osgi.service.component.annotations.ReferenceScope;
-import org.osgi.service.component.annotations.ServiceScope;
-import org.osgi.service.metatype.annotations.Designate;
import aQute.bnd.annotation.xml.XMLAttribute;
import aQute.bnd.component.DSAnnotations.Options;
@@ -232,8 +227,6 @@ public class AnnotationReader extends ClassDataCollector {
doModified();
else if (a instanceof Reference)
doReference((Reference) a, annotation);
- else if (a instanceof Designate)
- doDesignate((Designate) a);
else if (annotation.getName().getFQN().startsWith("aQute.bnd.annotation.component"))
handleMixedUsageError(annotation);
else {
@@ -290,11 +283,6 @@ public class AnnotationReader extends ClassDataCollector {
}
}
- protected void doDesignate(Designate a) {
- if (a.factory() && component.configurationPolicy == null)
- component.configurationPolicy = ConfigurationPolicy.REQUIRE;
- }
-
/**
*
*/
@@ -536,15 +524,15 @@ public class AnnotationReader extends ClassDataCollector {
}
def.className = className.getFQN();
def.name = reference.name();
- def.bind = reference.bind();
+ def.bind = "";
def.unbind = reference.unbind();
def.updated = reference.updated();
- def.field = reference.field();
- def.fieldOption = reference.fieldOption();
+ def.field = "";
+ def.fieldOption = FieldOption.REPLACE;
def.cardinality = reference.cardinality();
def.policy = reference.policy();
def.policyOption = reference.policyOption();
- def.scope = reference.scope();
+ def.scope = ReferenceScope.BUNDLE;
// Check if we have a target, this must be a filter
def.target = reference.target();
@@ -857,17 +845,17 @@ public class AnnotationReader extends ClassDataCollector {
component.factory = comp.factory();
if (annotation.get("immediate") != null)
component.immediate = comp.immediate();
- if (annotation.get("servicefactory") != null)
- component.scope = comp.servicefactory() ? ServiceScope.BUNDLE : ServiceScope.SINGLETON;
- if (annotation.get("scope") != null && comp.scope() != ServiceScope.DEFAULT) {
- component.scope = comp.scope();
- if (comp.scope() == ServiceScope.PROTOTYPE) {
- component.updateVersion(V1_3);
- }
- }
+// if (annotation.get("servicefactory") != null)
+// component.scope = comp.servicefactory() ? ServiceScope.BUNDLE : ServiceScope.SINGLETON;
+// if (annotation.get("scope") != null && comp.scope() != ServiceScope.DEFAULT) {
+// component.scope = comp.scope();
+// if (comp.scope() == ServiceScope.PROTOTYPE) {
+// component.updateVersion(V1_3);
+// }
+// }
if (annotation.get("configurationPid") != null) {
- component.configurationPid = comp.configurationPid();
+ component.configurationPid = new String[] {comp.configurationPid()};
if (component.configurationPid.length > 1) {
component.updateVersion(V1_3);
} else {
diff --git a/biz.aQute.bndlib/src/aQute/bnd/component/ComponentDef.java b/biz.aQute.bndlib/src/aQute/bnd/component/ComponentDef.java
index 38309fe..ba53142 100644
--- a/biz.aQute.bndlib/src/aQute/bnd/component/ComponentDef.java
+++ b/biz.aQute.bndlib/src/aQute/bnd/component/ComponentDef.java
@@ -9,7 +9,6 @@ import java.util.Map;
import java.util.TreeMap;
import org.osgi.service.component.annotations.ConfigurationPolicy;
-import org.osgi.service.component.annotations.ServiceScope;
import aQute.bnd.osgi.Analyzer;
import aQute.bnd.osgi.Descriptors.TypeRef;
diff --git a/biz.aQute.bndlib/src/aQute/bnd/component/FieldOption.java b/biz.aQute.bndlib/src/aQute/bnd/component/FieldOption.java
new file mode 100644
index 0000000..4b65c12
--- /dev/null
+++ b/biz.aQute.bndlib/src/aQute/bnd/component/FieldOption.java
@@ -0,0 +1,5 @@
+package aQute.bnd.component;
+enum FieldOption {
+ UPDATE,
+ REPLACE
+}
diff --git a/biz.aQute.bndlib/src/aQute/bnd/component/HeaderReader.java b/biz.aQute.bndlib/src/aQute/bnd/component/HeaderReader.java
index 2a64e20..b070fbd 100644
--- a/biz.aQute.bndlib/src/aQute/bnd/component/HeaderReader.java
+++ b/biz.aQute.bndlib/src/aQute/bnd/component/HeaderReader.java
@@ -16,7 +16,6 @@ import org.osgi.service.component.annotations.ConfigurationPolicy;
import org.osgi.service.component.annotations.ReferenceCardinality;
import org.osgi.service.component.annotations.ReferencePolicy;
import org.osgi.service.component.annotations.ReferencePolicyOption;
-import org.osgi.service.component.annotations.ServiceScope;
import aQute.bnd.component.error.DeclarativeServicesAnnotationError;
import aQute.bnd.component.error.DeclarativeServicesAnnotationError.ErrorType;
diff --git a/biz.aQute.bndlib/src/aQute/bnd/component/ReferenceDef.java b/biz.aQute.bndlib/src/aQute/bnd/component/ReferenceDef.java
index cc48f2d..d21d63b 100644
--- a/biz.aQute.bndlib/src/aQute/bnd/component/ReferenceDef.java
+++ b/biz.aQute.bndlib/src/aQute/bnd/component/ReferenceDef.java
@@ -1,10 +1,8 @@
package aQute.bnd.component;
-import org.osgi.service.component.annotations.FieldOption;
import org.osgi.service.component.annotations.ReferenceCardinality;
import org.osgi.service.component.annotations.ReferencePolicy;
import org.osgi.service.component.annotations.ReferencePolicyOption;
-import org.osgi.service.component.annotations.ReferenceScope;
import aQute.bnd.osgi.Analyzer;
import aQute.bnd.osgi.Verifier;
diff --git a/biz.aQute.bndlib/src/aQute/bnd/component/ReferenceScope.java b/biz.aQute.bndlib/src/aQute/bnd/component/ReferenceScope.java
new file mode 100644
index 0000000..70f2b78
--- /dev/null
+++ b/biz.aQute.bndlib/src/aQute/bnd/component/ReferenceScope.java
@@ -0,0 +1,13 @@
+package aQute.bnd.component;
+enum ReferenceScope {
+ BUNDLE("bundle"),
+ PROTOTYPE("prototype"),
+ PROTOTYPE_REQUIRED("prototype_required");
+ private final String value;
+ ReferenceScope(String value) {
+ this.value = value;
+ }
+ public String toString() {
+ return value;
+ }
+}
diff --git a/biz.aQute.bndlib/src/aQute/bnd/component/ServiceScope.java b/biz.aQute.bndlib/src/aQute/bnd/component/ServiceScope.java
new file mode 100644
index 0000000..aa49766
--- /dev/null
+++ b/biz.aQute.bndlib/src/aQute/bnd/component/ServiceScope.java
@@ -0,0 +1,14 @@
+package aQute.bnd.component;
+enum ServiceScope {
+ SINGLETON("singleton"),
+ BUNDLE("bundle"),
+ PROTOTYPE("prototype"),
+ DEFAULT("<<default>>");
+ private final String value;
+ ServiceScope(String value) {
+ this.value = value;
+ }
+ public String toString() {
+ return value;
+ }
+}
diff --git a/biz.aQute.bndlib/src/aQute/bnd/http/HttpRequest.java b/biz.aQute.bndlib/src/aQute/bnd/http/HttpRequest.java
index 8ab406f..2ed3278 100644
--- a/biz.aQute.bndlib/src/aQute/bnd/http/HttpRequest.java
+++ b/biz.aQute.bndlib/src/aQute/bnd/http/HttpRequest.java
@@ -9,9 +9,6 @@ import java.util.Map;
import java.util.concurrent.Executor;
import java.util.concurrent.TimeUnit;
-import org.osgi.util.promise.Deferred;
-import org.osgi.util.promise.Promise;
-
import aQute.bnd.osgi.Processor;
import aQute.bnd.service.url.TaggedData;
import aQute.lib.converter.TypeReference;
@@ -196,26 +193,6 @@ public class HttpRequest<T> {
return this;
}
- public Promise<T> async(final URL url) {
- this.url = url;
- final Deferred<T> deferred = new Deferred<>();
- Executor e = Processor.getExecutor();
- e.execute(new Runnable() {
-
- @Override
- public void run() {
- try {
- T result = (T) client.send(HttpRequest.this);
- deferred.resolve(result);
- } catch (Exception t) {
- deferred.fail(t);
- }
- }
-
- });
- return deferred.getPromise();
- }
-
@Override
public String toString() {
return "HttpRequest [verb=" + verb + ", upload=" + upload + ", download=" + download + ", headers=" + headers
diff --git a/biz.aQute.bndlib/src/aQute/bnd/obr/OBRFragment.java b/biz.aQute.bndlib/src/aQute/bnd/obr/OBRFragment.java
index 80cb5d2..ac0f70c 100644
--- a/biz.aQute.bndlib/src/aQute/bnd/obr/OBRFragment.java
+++ b/biz.aQute.bndlib/src/aQute/bnd/obr/OBRFragment.java
@@ -15,10 +15,8 @@ import org.osgi.framework.namespace.ExecutionEnvironmentNamespace;
import org.osgi.framework.namespace.HostNamespace;
import org.osgi.framework.namespace.IdentityNamespace;
import org.osgi.framework.namespace.PackageNamespace;
-import org.osgi.namespace.service.ServiceNamespace;
import org.osgi.resource.Capability;
import org.osgi.resource.Namespace;
-import org.osgi.service.repository.ContentNamespace;
import aQute.bnd.header.Attrs;
import aQute.bnd.header.Parameters;
@@ -217,10 +215,10 @@ public class OBRFragment {
//
for (Entry<String,Attrs> export : d.getParameters(Constants.EXPORT_SERVICE).entrySet()) {
- CapReqBuilder exportedService = new CapReqBuilder(ServiceNamespace.SERVICE_NAMESPACE);
+ CapReqBuilder exportedService = new CapReqBuilder("osgi.service");
String service = Processor.removeDuplicateMarker(export.getKey());
- exportedService.addAttribute(ServiceNamespace.SERVICE_NAMESPACE, service);
- exportedService.addAttribute(ServiceNamespace.CAPABILITY_OBJECTCLASS_ATTRIBUTE,
+ exportedService.addAttribute("osgi.service", service);
+ exportedService.addAttribute("objectClass",
export.getValue().get("objectclass"));
resource.addCapability(exportedService);
}
@@ -230,10 +228,10 @@ public class OBRFragment {
//
for (Entry<String,Attrs> imported : d.getParameters(Constants.IMPORT_SERVICE).entrySet()) {
- CapReqBuilder importedService = new CapReqBuilder(ServiceNamespace.SERVICE_NAMESPACE);
+ CapReqBuilder importedService = new CapReqBuilder("osgi.service");
String service = Processor.removeDuplicateMarker(imported.getKey());
importedService.addDirective(Namespace.REQUIREMENT_FILTER_DIRECTIVE,
- filter(ServiceNamespace.SERVICE_NAMESPACE, service, imported.getValue()));
+ filter("osgi.service", service, imported.getValue()));
resource.addRequirement(importedService);
}
@@ -276,16 +274,16 @@ public class OBRFragment {
if (!reporter.isOk())
return reporter;
- CapReqBuilder content = new CapReqBuilder(ContentNamespace.CONTENT_NAMESPACE);
+ CapReqBuilder content = new CapReqBuilder("osgi.content");
String sha = SHA1.digest(file).asHex();
- content.addAttribute(ContentNamespace.CONTENT_NAMESPACE, sha);
- content.addAttribute(ContentNamespace.CAPABILITY_SIZE_ATTRIBUTE, (long) file.length());
- content.addAttribute(ContentNamespace.CAPABILITY_MIME_ATTRIBUTE, MIME_TYPE_OSGI_BUNDLE);
+ content.addAttribute("osgi.content", sha);
+ content.addAttribute("size", (long) file.length());
+ content.addAttribute("mime", MIME_TYPE_OSGI_BUNDLE);
if (base != null) {
String path = file.getAbsolutePath();
if (base.startsWith(path)) {
- content.addAttribute(ContentNamespace.CAPABILITY_URL_ATTRIBUTE,
+ content.addAttribute("url",
path.substring(base.length()).replace(File.separatorChar, '/'));
} else {
reporter.error("Base path %s is not parent of file path: %s", base, file.getAbsolutePath());
diff --git a/biz.aQute.bndlib/src/aQute/bnd/osgi/Builder.java b/biz.aQute.bndlib/src/aQute/bnd/osgi/Builder.java
index c61ae1f..aa5f386 100644
--- a/biz.aQute.bndlib/src/aQute/bnd/osgi/Builder.java
+++ b/biz.aQute.bndlib/src/aQute/bnd/osgi/Builder.java
@@ -35,7 +35,6 @@ import aQute.bnd.make.component.ServiceComponent;
import aQute.bnd.make.metatype.MetatypePlugin;
import aQute.bnd.maven.PomPropertiesResource;
import aQute.bnd.maven.PomResource;
-import aQute.bnd.metatype.MetatypeAnnotations;
import aQute.bnd.osgi.Descriptors.PackageRef;
import aQute.bnd.osgi.Descriptors.TypeRef;
import aQute.bnd.service.SignerPlugin;
@@ -1569,7 +1568,6 @@ public class Builder extends Analyzer {
static ServiceComponent serviceComponent = new ServiceComponent();
static DSAnnotations dsAnnotations = new DSAnnotations();
static MetatypePlugin metatypePlugin = new MetatypePlugin();
- static MetatypeAnnotations metatypeAnnotations = new MetatypeAnnotations();
@Override
protected void setTypeSpecificPlugins(Set<Object> list) {
@@ -1578,7 +1576,6 @@ public class Builder extends Analyzer {
list.add(serviceComponent);
list.add(dsAnnotations);
list.add(metatypePlugin);
- list.add(metatypeAnnotations);
super.setTypeSpecificPlugins(list);
}
diff --git a/biz.aQute.bndlib/src/aQute/bnd/osgi/Contracts.java b/biz.aQute.bndlib/src/aQute/bnd/osgi/Contracts.java
index bf0c8e4..6fda472 100644
--- a/biz.aQute.bndlib/src/aQute/bnd/osgi/Contracts.java
+++ b/biz.aQute.bndlib/src/aQute/bnd/osgi/Contracts.java
@@ -7,8 +7,6 @@ import java.util.List;
import java.util.Map.Entry;
import java.util.Set;
-import org.osgi.namespace.contract.ContractNamespace;
-
import aQute.bnd.header.Attrs;
import aQute.bnd.header.Parameters;
import aQute.bnd.osgi.Descriptors.PackageRef;
@@ -73,13 +71,13 @@ class Contracts {
contract: for (Entry<String,Attrs> p : pcs.entrySet()) {
String namespace = p.getKey();
- if (namespace.equals(ContractNamespace.CONTRACT_NAMESPACE)) {
+ if (namespace.equals("osgi.contract")) {
Attrs capabilityAttrs = p.getValue();
- String name = capabilityAttrs.get(ContractNamespace.CONTRACT_NAMESPACE);
+ String name = capabilityAttrs.get("osgi.contract");
if (name == null) {
analyzer.warning("No name (attr %s) defined in bundle %s from contract namespace: %s",
- ContractNamespace.CONTRACT_NAMESPACE, from, capabilityAttrs);
+ "osgi.contract", from, capabilityAttrs);
continue contract;
}
@@ -96,7 +94,7 @@ class Contracts {
Contract c = new Contract();
c.name = name;
- String list = capabilityAttrs.get(ContractNamespace.CAPABILITY_USES_DIRECTIVE + ":");
+ String list = capabilityAttrs.get("uses" + ":");
if (list == null || list.length() == 0) {
analyzer.warning("Contract %s has no uses: directive in %s.", name, from);
continue contract; // next contract
@@ -104,7 +102,7 @@ class Contracts {
c.uses = Processor.split(list);
- c.version = (Version) capabilityAttrs.getTyped(ContractNamespace.CAPABILITY_VERSION_ATTRIBUTE);
+ c.version = (Version) capabilityAttrs.getTyped("version");
c.from = from;
if (c.version == null) {
@@ -159,14 +157,14 @@ class Contracts {
void addToRequirements(Parameters requirements) {
for (Contract c : contracts) {
Attrs attrs = new Attrs(c.decorators);
- attrs.put(ContractNamespace.CONTRACT_NAMESPACE, c.name);
- String name = ContractNamespace.CONTRACT_NAMESPACE;
+ attrs.put("osgi.contract", c.name);
+ String name = "osgi.contract";
while (requirements.containsKey(name))
name += "~";
Formatter f = new Formatter();
try {
- f.format("(&(%s=%s)(version=%s))", ContractNamespace.CONTRACT_NAMESPACE, c.name, c.version);
+ f.format("(&(%s=%s)(version=%s))", "osgi.contract", c.name, c.version);
// TODO : shall we also assert the attributes?
diff --git a/biz.aQute.bndlib/src/aQute/bnd/osgi/resource/CapReqBuilder.java b/biz.aQute.bndlib/src/aQute/bnd/osgi/resource/CapReqBuilder.java
index 251c762..bd9c7fb 100644
--- a/biz.aQute.bndlib/src/aQute/bnd/osgi/resource/CapReqBuilder.java
+++ b/biz.aQute.bndlib/src/aQute/bnd/osgi/resource/CapReqBuilder.java
@@ -17,14 +17,10 @@ import org.osgi.framework.namespace.ExecutionEnvironmentNamespace;
import org.osgi.framework.namespace.HostNamespace;
import org.osgi.framework.namespace.IdentityNamespace;
import org.osgi.framework.namespace.PackageNamespace;
-import org.osgi.namespace.contract.ContractNamespace;
-import org.osgi.namespace.extender.ExtenderNamespace;
-import org.osgi.namespace.service.ServiceNamespace;
import org.osgi.resource.Capability;
import org.osgi.resource.Namespace;
import org.osgi.resource.Requirement;
import org.osgi.resource.Resource;
-import org.osgi.service.repository.ContentNamespace;
import aQute.bnd.header.Attrs;
import aQute.bnd.header.Parameters;
@@ -412,11 +408,11 @@ public class CapReqBuilder {
}
public boolean isService() {
- return ServiceNamespace.SERVICE_NAMESPACE.equals(getNamespace());
+ return "osgi.service".equals(getNamespace());
}
public boolean isContract() {
- return ContractNamespace.CONTRACT_NAMESPACE.equals(getNamespace());
+ return "osgi.contract".equals(getNamespace());
}
public boolean isIdentity() {
@@ -424,7 +420,7 @@ public class CapReqBuilder {
}
public boolean isContent() {
- return ContentNamespace.CONTENT_NAMESPACE.equals(getNamespace());
+ return "osgi.content".equals(getNamespace());
}
public boolean isEE() {
@@ -432,7 +428,7 @@ public class CapReqBuilder {
}
public boolean isExtender() {
- return ExtenderNamespace.EXTENDER_NAMESPACE.equals(getNamespace());
+ return "osgi.extender".equals(getNamespace());
}
public Attrs toAttrs() {
diff --git a/biz.aQute.bndlib/src/aQute/bnd/osgi/resource/ResourceUtils.java b/biz.aQute.bndlib/src/aQute/bnd/osgi/resource/ResourceUtils.java
index 05d9023..c90b42e 100644
--- a/biz.aQute.bndlib/src/aQute/bnd/osgi/resource/ResourceUtils.java
+++ b/biz.aQute.bndlib/src/aQute/bnd/osgi/resource/ResourceUtils.java
@@ -23,14 +23,10 @@ import org.osgi.framework.namespace.ExecutionEnvironmentNamespace;
import org.osgi.framework.namespace.HostNamespace;
import org.osgi.framework.namespace.IdentityNamespace;
import org.osgi.framework.namespace.PackageNamespace;
-import org.osgi.namespace.contract.ContractNamespace;
-import org.osgi.namespace.extender.ExtenderNamespace;
-import org.osgi.namespace.service.ServiceNamespace;
import org.osgi.resource.Capability;
import org.osgi.resource.Namespace;
import org.osgi.resource.Requirement;
import org.osgi.resource.Resource;
-import org.osgi.service.repository.ContentNamespace;
import aQute.bnd.header.Attrs;
import aQute.bnd.version.Version;
@@ -182,7 +178,7 @@ public class ResourceUtils {
public static List<ContentCapability> getContentCapabilities(Resource resource) {
List<ContentCapability> result = new ArrayList<>();
- for (Capability c : resource.getCapabilities(ContentNamespace.CONTENT_NAMESPACE)) {
+ for (Capability c : resource.getCapabilities("osgi.content")) {
result.add(as(c, ContentCapability.class));
}
return result;
@@ -244,7 +240,7 @@ public class ResourceUtils {
}
public static URI getURI(Capability contentCapability) {
- Object uriObj = contentCapability.getAttributes().get(ContentNamespace.CAPABILITY_URL_ATTRIBUTE);
+ Object uriObj = contentCapability.getAttributes().get("url");
if (uriObj == null)
return null;
@@ -288,14 +284,14 @@ public class ResourceUtils {
name = HostNamespace.CAPABILITY_BUNDLE_VERSION_ATTRIBUTE;
else if (PackageNamespace.PACKAGE_NAMESPACE.equals(ns))
name = PackageNamespace.CAPABILITY_VERSION_ATTRIBUTE;
- else if (ServiceNamespace.SERVICE_NAMESPACE.equals(ns))
+ else if ("osgi.service".equals(ns))
name = null;
else if (ExecutionEnvironmentNamespace.EXECUTION_ENVIRONMENT_NAMESPACE.equals(ns))
name = ExecutionEnvironmentNamespace.CAPABILITY_VERSION_ATTRIBUTE;
- else if (ExtenderNamespace.EXTENDER_NAMESPACE.equals(ns))
- name = ExtenderNamespace.CAPABILITY_VERSION_ATTRIBUTE;
- else if (ContractNamespace.CONTRACT_NAMESPACE.equals(ns))
- name = ContractNamespace.CAPABILITY_VERSION_ATTRIBUTE;
+ else if ("osgi.extender".equals(ns))
+ name = "version";
+ else if ("osgi.contract".equals(ns))
+ name = "version";
else
name = null;
--
2.5.5

View File

@ -1,238 +0,0 @@
From 46db98329dc88e039948f58aa34d151c1aaa7a05 Mon Sep 17 00:00:00 2001
From: Michael Simacek <msimacek@redhat.com>
Date: Wed, 8 Jul 2015 13:46:30 +0200
Subject: [PATCH 3/3] Use equinox's annotations
---
.../src/aQute/bnd/component/AnnotationReader.java | 19 +++++--------------
.../src/aQute/bnd/component/ComponentDef.java | 13 ++++---------
.../src/aQute/bnd/component/HeaderReader.java | 1 -
.../src/aQute/bnd/component/ReferenceScope.java | 13 +++++++++++++
.../src/aQute/bnd/component/ServiceScope.java | 14 ++++++++++++++
.../src/aQute/bnd/metatype/DesignateReader.java | 13 +++----------
biz.aQute.bndlib/src/aQute/bnd/osgi/Builder.java | 3 ---
7 files changed, 39 insertions(+), 37 deletions(-)
create mode 100644 biz.aQute.bndlib/src/aQute/bnd/component/ReferenceScope.java
create mode 100644 biz.aQute.bndlib/src/aQute/bnd/component/ServiceScope.java
diff --git a/biz.aQute.bndlib/src/aQute/bnd/component/AnnotationReader.java b/biz.aQute.bndlib/src/aQute/bnd/component/AnnotationReader.java
index f979187..8505d8c 100644
--- a/biz.aQute.bndlib/src/aQute/bnd/component/AnnotationReader.java
+++ b/biz.aQute.bndlib/src/aQute/bnd/component/AnnotationReader.java
@@ -412,7 +412,7 @@ public class AnnotationReader extends ClassDataCollector {
String annoService = raw.get("service");
if (annoService != null)
annoService = Clazz.objectDescriptorToFQN(annoService);
- ReferenceScope scope = reference.scope();
+ ReferenceScope scope = ReferenceScope.BUNDLE;
String service = determineReferenceType(method.getDescriptor().toString(), def, annoService, scope);
@@ -446,7 +446,7 @@ public class AnnotationReader extends ClassDataCollector {
def.cardinality = reference.cardinality();
def.policy = reference.policy();
def.policyOption = reference.policyOption();
- def.scope = reference.scope();
+ def.scope = ReferenceScope.BUNDLE;
}
private String determineReferenceType(String methodDescriptor, ReferenceDef def, String annoService, ReferenceScope scope) {
@@ -545,20 +545,10 @@ public class AnnotationReader extends ClassDataCollector {
component.immediate = comp.immediate();
if (annotation.get("servicefactory") != null)
component.scope = comp.servicefactory()? ServiceScope.BUNDLE: ServiceScope.SINGLETON;
- if (annotation.get("scope") != null && comp.scope() != ServiceScope.DEFAULT) {
- component.scope = comp.scope();
- if (comp.scope() == ServiceScope.PROTOTYPE) {
- component.updateVersion(V1_3);
- }
- }
if (annotation.get("configurationPid") != null) {
component.configurationPid = comp.configurationPid();
- if (component.configurationPid.length > 1) {
- component.updateVersion(V1_3);
- } else {
component.updateVersion(V1_2);
- }
}
if (annotation.get("xmlns") != null)
@@ -601,6 +591,7 @@ public class AnnotationReader extends ClassDataCollector {
component.service[i] = ref;
}
}
+ /*
Object[] refAnnotations = annotation.get("reference");
if (refAnnotations != null) {
for (Object o: refAnnotations) {
@@ -613,11 +604,11 @@ public class AnnotationReader extends ClassDataCollector {
refdef.policy = ref.policy();
refdef.policyOption = ref.policyOption();
refdef.target = ref.target();
- refdef.scope = ref.scope();
+ refdef.scope = ReferenceScope.BUNDLE;
component.references.put(refdef.name, refdef);
}
}
-
+ */
}
/**
diff --git a/biz.aQute.bndlib/src/aQute/bnd/component/ComponentDef.java b/biz.aQute.bndlib/src/aQute/bnd/component/ComponentDef.java
index d5719c2..f975dda 100644
--- a/biz.aQute.bndlib/src/aQute/bnd/component/ComponentDef.java
+++ b/biz.aQute.bndlib/src/aQute/bnd/component/ComponentDef.java
@@ -39,7 +39,7 @@ class ComponentDef {
String modified;
Boolean enabled;
String xmlns;
- String[] configurationPid;
+ String configurationPid;
List<Tag> propertyTags = new ArrayList<Tag>();
/**
@@ -162,13 +162,8 @@ class ComponentDef {
if (configurationPid != null) {
StringBuilder b = new StringBuilder();
- String space = "";
- for (String pid: configurationPid) {
- if ("$".equals(pid))
- pid = name;
- b.append(space).append(pid);
- space = " ";
- }
+ if (configurationPid != null)
+ b.append("$".equals(configurationPid)?name:configurationPid);
component.addAttribute("configuration-pid", b.toString());
}
Tag impl = new Tag(component, "implementation");
@@ -252,4 +247,4 @@ class ComponentDef {
return b;
}
-}
\ No newline at end of file
+}
diff --git a/biz.aQute.bndlib/src/aQute/bnd/component/HeaderReader.java b/biz.aQute.bndlib/src/aQute/bnd/component/HeaderReader.java
index f2ed67f..17539d3 100644
--- a/biz.aQute.bndlib/src/aQute/bnd/component/HeaderReader.java
+++ b/biz.aQute.bndlib/src/aQute/bnd/component/HeaderReader.java
@@ -16,7 +16,6 @@ import org.osgi.service.component.annotations.ConfigurationPolicy;
import org.osgi.service.component.annotations.ReferenceCardinality;
import org.osgi.service.component.annotations.ReferencePolicy;
import org.osgi.service.component.annotations.ReferencePolicyOption;
-import org.osgi.service.component.annotations.ServiceScope;
import aQute.bnd.component.error.*;
import aQute.bnd.component.error.DeclarativeServicesAnnotationError.*;
diff --git a/biz.aQute.bndlib/src/aQute/bnd/component/ReferenceScope.java b/biz.aQute.bndlib/src/aQute/bnd/component/ReferenceScope.java
new file mode 100644
index 0000000..70f2b78
--- /dev/null
+++ b/biz.aQute.bndlib/src/aQute/bnd/component/ReferenceScope.java
@@ -0,0 +1,13 @@
+package aQute.bnd.component;
+enum ReferenceScope {
+ BUNDLE("bundle"),
+ PROTOTYPE("prototype"),
+ PROTOTYPE_REQUIRED("prototype_required");
+ private final String value;
+ ReferenceScope(String value) {
+ this.value = value;
+ }
+ public String toString() {
+ return value;
+ }
+}
diff --git a/biz.aQute.bndlib/src/aQute/bnd/component/ServiceScope.java b/biz.aQute.bndlib/src/aQute/bnd/component/ServiceScope.java
new file mode 100644
index 0000000..aa49766
--- /dev/null
+++ b/biz.aQute.bndlib/src/aQute/bnd/component/ServiceScope.java
@@ -0,0 +1,14 @@
+package aQute.bnd.component;
+enum ServiceScope {
+ SINGLETON("singleton"),
+ BUNDLE("bundle"),
+ PROTOTYPE("prototype"),
+ DEFAULT("<<default>>");
+ private final String value;
+ ServiceScope(String value) {
+ this.value = value;
+ }
+ public String toString() {
+ return value;
+ }
+}
diff --git a/biz.aQute.bndlib/src/aQute/bnd/metatype/DesignateReader.java b/biz.aQute.bndlib/src/aQute/bnd/metatype/DesignateReader.java
index 29ebbdb..f1dd9d4 100644
--- a/biz.aQute.bndlib/src/aQute/bnd/metatype/DesignateReader.java
+++ b/biz.aQute.bndlib/src/aQute/bnd/metatype/DesignateReader.java
@@ -13,7 +13,7 @@ public class DesignateReader extends ClassDataCollector {
private Clazz clazz;
private Map<String, OCDDef> classToOCDMap;
- private String[] pids;
+ private String pid;
private Annotation designate;
DesignateReader(Analyzer analyzer, Clazz clazz, Map<String, OCDDef> classToOCDMap) {
@@ -29,14 +29,7 @@ public class DesignateReader extends ClassDataCollector {
private DesignateDef getDef() throws Exception {
clazz.parseClassFileWithCollector(this);
- if (pids != null && designate != null) {
- if (pids.length != 1) {
- analyzer.error(
- "DS Component %s specifies multiple pids %s, and a Designate which requires exactly one pid",
- clazz.getClassName().getFQN(), Arrays.asList(pids));
- return null;
- }
- String pid = pids[0];
+ if (pid != null && designate != null) {
String ocdClass = ((String) designate.get("ocd"));
ocdClass = ocdClass.substring(1, ocdClass.length() - 1);
OCDDef ocd = classToOCDMap.get(ocdClass);
@@ -61,7 +54,7 @@ public class DesignateReader extends ClassDataCollector {
if (a instanceof Designate)
designate = annotation;
else if (a instanceof Component)
- pids = ((Component)a).configurationPid();
+ pid = ((Component)a).configurationPid();
}
catch (Exception e) {
e.printStackTrace();
diff --git a/biz.aQute.bndlib/src/aQute/bnd/osgi/Builder.java b/biz.aQute.bndlib/src/aQute/bnd/osgi/Builder.java
index b326c97..52d42c8 100755
--- a/biz.aQute.bndlib/src/aQute/bnd/osgi/Builder.java
+++ b/biz.aQute.bndlib/src/aQute/bnd/osgi/Builder.java
@@ -14,7 +14,6 @@ import aQute.bnd.make.*;
import aQute.bnd.make.component.*;
import aQute.bnd.make.metatype.*;
import aQute.bnd.maven.*;
-import aQute.bnd.metatype.*;
import aQute.bnd.osgi.Descriptors.PackageRef;
import aQute.bnd.osgi.Descriptors.TypeRef;
import aQute.bnd.service.*;
@@ -1548,7 +1547,6 @@ public class Builder extends Analyzer {
static ServiceComponent serviceComponent = new ServiceComponent();
static DSAnnotations dsAnnotations = new DSAnnotations();
static MetatypePlugin metatypePlugin = new MetatypePlugin();
- static MetatypeAnnotations metatypeAnnotations = new MetatypeAnnotations();
@Override
protected void setTypeSpecificPlugins(Set<Object> list) {
@@ -1557,7 +1555,6 @@ public class Builder extends Analyzer {
list.add(serviceComponent);
list.add(dsAnnotations);
list.add(metatypePlugin);
- list.add(metatypeAnnotations);
super.setTypeSpecificPlugins(list);
}
--
2.1.0

View File

@ -1,25 +1,32 @@
Name: aqute-bnd
Version: 2.4.1
Release: 3%{?dist}
Version: 3.2.0
Release: 1%{?dist}
Summary: BND Tool
License: ASL 2.0
URL: http://www.aqute.biz/Bnd/Bnd
BuildArch: noarch
Source0: https://github.com/bndtools/bnd/archive/%{version}.REL.tar.gz
# Auxiliary parent pom, packager-written
Source1: parent.pom
Source2: https://repo1.maven.org/maven2/biz/aQute/bnd/biz.aQute.bnd/%{version}/biz.aQute.bnd-%{version}.pom
Source3: https://repo1.maven.org/maven2/biz/aQute/bnd/biz.aQute.bndlib/%{version}/biz.aQute.bndlib-%{version}.pom
Source0: %{version}.REL.tar.gz
# removes bundled jars from upstream tarball
# run as:
# ./repack-tarball.sh
Source1: repack-tarball.sh
Source2: parent.pom
Source3: https://repo1.maven.org/maven2/biz/aQute/bnd/aQute.libg/%{version}/aQute.libg-%{version}.pom
Source4: https://repo1.maven.org/maven2/biz/aQute/bnd/biz.aQute.bnd/%{version}/biz.aQute.bnd-%{version}.pom
Source5: https://repo1.maven.org/maven2/biz/aQute/bnd/biz.aQute.bndlib/%{version}/biz.aQute.bndlib-%{version}.pom
Source6: https://repo1.maven.org/maven2/biz/aQute/bnd/biz.aQute.bnd.annotation/%{version}/biz.aQute.bnd.annotation-%{version}.pom
Patch0: 0001-Port-to-Java-8.patch
Patch1: 0002-Inline-namespace-constants.patch
Patch2: 0003-Use-equinox-s-annotations.patch
Patch1: 0002-Remove-unavailable-parts.patch
BuildRequires: maven-local
BuildRequires: mvn(ant:ant)
BuildRequires: mvn(org.eclipse.osgi:org.eclipse.osgi)
BuildRequires: mvn(org.eclipse.osgi:org.eclipse.osgi.services)
BuildRequires: mvn(org.osgi:org.osgi.annotation)
BuildRequires: mvn(org.slf4j:slf4j-api)
%description
The bnd tool helps you create and diagnose OSGi bundles.
@ -50,66 +57,63 @@ API documentation for %{name}.
%setup -q -n bnd-%{version}.REL
rm gradlew*
find -name '*.jar' -delete
find -name '*.class' -delete
%patch0 -p1
%patch1 -p1
%patch2 -p1
# unavailable dependencies
rm -r biz.aQute.bndlib/src/aQute/bnd/{metatype,service/message,osgi/repository}
rm biz.aQute.bnd/src/aQute/bnd/main/{RemoteCommand,ReporterLogger,ResolveCommand}.java
find -name package-info.java -delete
# reference to Base64 is ambiguous
find -name '*.java' -not -name 'Base64.java' | xargs sed -i 's/\<Base64\>/aQute.lib.base64.Base64/g'
#find -name '*.java' -not -name 'Base64.java' | xargs sed -i 's/\<Base64\>/aQute.lib.base64.Base64/g'
cp -p %{SOURCE1} pom.xml
sed 's/@VERSION@/%{version}/' %SOURCE2 > pom.xml
sed -i 's|${Bundle-Version}|%{version}|' biz.aQute.bndlib/src/aQute/bnd/osgi/bnd.info
build_section='
<build>
<sourceDirectory>src</sourceDirectory>
<resources>
<resource>
<directory>src/</directory>
<excludes>
<exclude>**/*.java</exclude>
<exclude>**/packageinfo</exclude>
</excludes>
</resource>
</resources>
</build>'
pushd biz.aQute.bnd
cp -p %{SOURCE2} pom.xml
# libg
pushd aQute.libg
cp -p %{SOURCE3} pom.xml
%pom_add_parent biz.aQute.bnd:parent:%{version}
popd
# bnd
pushd biz.aQute.bnd
cp -p %{SOURCE4} pom.xml
%pom_add_parent biz.aQute.bnd:parent:%{version}
%pom_xpath_inject /pom:project "$build_section"
%pom_add_dep ant:ant
%pom_add_dep biz.aQute.bnd:biz.aQute.bndlib:%{version}
%pom_add_dep org.eclipse.osgi:org.eclipse.osgi
%pom_add_dep org.eclipse.osgi:org.eclipse.osgi.services
# The common library is expected to be included in all artifacts
cp -r ../aQute.libg/src/* src/
popd
# bndlib
pushd biz.aQute.bndlib
cp -p %{SOURCE3} pom.xml
cp -p %{SOURCE5} pom.xml
%pom_add_parent biz.aQute.bnd:parent:%{version}
%pom_xpath_inject /pom:project "$build_section"
%pom_add_dep org.eclipse.osgi:org.eclipse.osgi
%pom_add_dep org.eclipse.osgi:org.eclipse.osgi.services
# The common library is expected to be included in all artifacts
cp -r ../aQute.libg/src/* src/
sed -i 's|${Bundle-Version}|%{version}|' src/aQute/bnd/osgi/bnd.info
# We don't have metatype-annotations and I haven't found any proper release of it
rm -r src/aQute/bnd/metatype
%pom_add_dep org.osgi:org.osgi.annotation
%pom_add_dep org.slf4j:slf4j-api
%pom_add_dep biz.aQute.bnd:aQute.libg:%{version}
%pom_add_dep biz.aQute.bnd:biz.aQute.bnd.annotation:%{version}
popd
# bndlib.annotations
pushd biz.aQute.bnd.annotation
cp -p %{SOURCE6} pom.xml
%pom_add_parent biz.aQute.bnd:parent:%{version}
popd
%mvn_alias biz.aQute.bnd:biz.aQute.bnd :bnd biz.aQute:bnd
%mvn_alias biz.aQute.bnd:biz.aQute.bndlib :bndlib biz.aQute:bndlib
%mvn_package biz.aQute.bnd:biz.aQute.bndlib bndlib
%mvn_package biz.aQute.bnd:biz.aQute.bnd.annotation bndlib
%mvn_package biz.aQute.bnd:aQute.libg bndlib
%mvn_package biz.aQute.bnd:parent __noinstall
%build
@ -118,19 +122,22 @@ popd
%install
%mvn_install
%jpackage_script bnd "" "" aqute-bnd bnd 1
%jpackage_script aQute.bnd.main.bnd "" "" aqute-bnd:slf4j/slf4j-api:slf4j/slf4j-simple bnd 1
%files -f .mfiles
%doc biz.aQute.bnd/LICENSE
%license LICENSE
%{_bindir}/bnd
%files -n aqute-bndlib -f .mfiles-bndlib
%doc biz.aQute.bnd/LICENSE
%license LICENSE
%files javadoc -f .mfiles-javadoc
%doc biz.aQute.bnd/LICENSE
%license LICENSE
%changelog
* Tue May 24 2016 Michael Simacek <msimacek@redhat.com> - 3.2.0-1
- Update to upstream version 3.2.0
* Wed Feb 03 2016 Fedora Release Engineering <releng@fedoraproject.org> - 2.4.1-3
- Rebuilt for https://fedoraproject.org/wiki/Fedora_24_Mass_Rebuild

View File

@ -1,171 +1,197 @@
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns='http://maven.apache.org/POM/4.0.0' xmlns:xsi='http://www.w3.org/2001/XMLSchema-instance'
xsi:schemaLocation='http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd'>
<modelVersion>4.0.0</modelVersion>
xsi:schemaLocation='http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd'>
<modelVersion>4.0.0</modelVersion>
<groupId>biz.aQute.bnd</groupId>
<artifactId>parent</artifactId>
<version>2.4.1</version>
<groupId>biz.aQute.bnd</groupId>
<artifactId>parent</artifactId>
<version>@VERSION@</version>
<packaging>pom</packaging>
<packaging>pom</packaging>
<name>Parent project for bnd tool suite</name>
<description>Project information for bnd.</description>
<url>http://www.aQute.biz/Code/Bnd</url>
<name>Parent project for bnd tool suite</name>
<description>Project information for bnd.</description>
<url>http://www.aQute.biz/Code/Bnd</url>
<organization>
<name>aQute SARL</name>
<url>http://www.aQute.biz</url>
</organization>
<organization>
<name>aQute SARL</name>
<url>http://www.aQute.biz</url>
</organization>
<licenses>
<license>
<name>Apache Software License 2.0</name>
<url>http://www.opensource.org/licenses/apache2.0.php</url>
<distribution>repo</distribution>
</license>
</licenses>
<licenses>
<license>
<name>Apache Software License 2.0</name>
<url>http://www.opensource.org/licenses/apache2.0.php</url>
<distribution>repo</distribution>
</license>
</licenses>
<developers>
<developer>
<id>bnd</id>
<name>Peter Kriens</name>
<organization>aQute SARL</organization>
<roles>
<role>Primary Developer</role>
</roles>
</developer>
<developer>
<id>bjhargrave</id>
<name>BJ Hargrave</name>
</developer>
<developer>
<id>mcculls</id>
<name>Stuart McCulloch</name>
</developer>
<developer>
<id>njbartlett</id>
<name>Neil Bartlett</name>
<organization>Paremus</organization>
</developer>
<developer>
<id>fhuberts</id>
<name>Ferry Huberts</name>
<organization>Pelagic</organization>
</developer>
<developer>
<id>psoreide</id>
<name>PK S&#248;reide</name>
<organization>Comactivity AB</organization>
</developer>
</developers>
<contributors>
<contributor>
<!--<id>derheld42</id>-->
<name>Carter Smithhart</name>
</contributor>
<contributor>
<!--<id>cchabanois</id>-->
<name>Chabanois Cédric</name>
<organization>Entropysoft</organization>
</contributor>
<contributor>
<!--<id>paulbakker</id>-->
<name>Paul Bakker</name>
<organization>Luminis Technologies</organization>
</contributor>
<contributor>
<!--<id>djencks</id>-->
<name>David Jencks</name>
</contributor>
<contributor>
<!--<id>rkrzewski</id>-->
<name>Rafa&#322; Krzewski</name>
<organization>Caltha - Krzewski, Mach, Potempski Sp. J.</organization>
</contributor>
<contributor>
<!--<id>xfournet</id>-->
<name>Xavier Fournet</name>
</contributor>
<contributor>
<!--<id>crabbkw</id>-->
<name>Casey Crabb</name>
</contributor>
<contributor>
<!--<id>david.bosschaert</id>-->
<name>David Bosschaert</name>
</contributor>
<contributor>
<!--<id>harald.wellmann</id>-->
<name>Harald Wellmann</name>
</contributor>
<contributor>
<!--<id>janwillem.janssen</id>-->
<name>Jan Willem Janssen</name>
</contributor>
<contributor>
<!--<id>marcel.offermans</id>-->
<name>Marcel Offermans</name>
</contributor>
<contributor>
<!--<id>marian.grigoras</id>-->
<name>Marian Grigoras</name>
</contributor>
<contributor>
<!--<id>markuswolf</id>-->
<name>Markus Wolf</name>
</contributor>
<contributor>
<!--<id>nicolas.lalevee</id>-->
<name>Nicolas Lalevée</name>
</contributor>
<contributor>
<!--<id>pierre.labiausse</id>-->
<name>Pierre Labiausse</name>
</contributor>
<contributor>
<!--<id>raymond.auge</id>-->
<name>Raymond Auge</name>
</contributor>
<contributor>
<!--<id>timothyjward</id>-->
<name>Tim Ward</name>
</contributor>
<contributor>
<!--<id>bramk</id>-->
<name>Bram de Kruijff</name>
</contributor>
<contributor>
<!--<id>tangyong</id>-->
<name>Tang Yong</name>
</contributor>
<contributor>
<!--<id>gamerson</id>-->
<name>Gregory Amerson</name>
</contributor>
<contributor>
<!--<id>gnodet</id>-->
<name>Guillaume Nodet</name>
</contributor>
<contributor>
<!--<id>marcdejonge</id>-->
<name>Marc de Jonge</name>
</contributor>
<contributor>
<!--<id>trespasserw</id>-->
<name>Roman Shevchenko</name>
</contributor>
</contributors>
<developers>
<developer>
<id>bnd</id>
<name>Peter Kriens</name>
<organization>aQute SARL</organization>
<roles>
<role>Primary Developer</role>
</roles>
</developer>
<developer>
<id>bjhargrave</id>
<name>BJ Hargrave</name>
</developer>
<developer>
<id>mcculls</id>
<name>Stuart McCulloch</name>
</developer>
<developer>
<id>njbartlett</id>
<name>Neil Bartlett</name>
<organization>Paremus</organization>
</developer>
<developer>
<id>fhuberts</id>
<name>Ferry Huberts</name>
<organization>Pelagic</organization>
</developer>
<developer>
<id>psoreide</id>
<name>PK S&#248;reide</name>
<organization>Comactivity AB</organization>
</developer>
</developers>
<contributors>
<contributor>
<!--<id>derheld42</id>-->
<name>Carter Smithhart</name>
</contributor>
<contributor>
<!--<id>cchabanois</id>-->
<name>Chabanois Cédric</name>
<organization>Entropysoft</organization>
</contributor>
<contributor>
<!--<id>paulbakker</id>-->
<name>Paul Bakker</name>
<organization>Luminis Technologies</organization>
</contributor>
<contributor>
<!--<id>djencks</id>-->
<name>David Jencks</name>
</contributor>
<contributor>
<!--<id>rkrzewski</id>-->
<name>Rafa&#322; Krzewski</name>
<organization>Caltha - Krzewski, Mach, Potempski Sp. J.</organization>
</contributor>
<contributor>
<!--<id>xfournet</id>-->
<name>Xavier Fournet</name>
</contributor>
<contributor>
<!--<id>crabbkw</id>-->
<name>Casey Crabb</name>
</contributor>
<contributor>
<!--<id>david.bosschaert</id>-->
<name>David Bosschaert</name>
</contributor>
<contributor>
<!--<id>harald.wellmann</id>-->
<name>Harald Wellmann</name>
</contributor>
<contributor>
<!--<id>janwillem.janssen</id>-->
<name>Jan Willem Janssen</name>
</contributor>
<contributor>
<!--<id>marcel.offermans</id>-->
<name>Marcel Offermans</name>
</contributor>
<contributor>
<!--<id>marian.grigoras</id>-->
<name>Marian Grigoras</name>
</contributor>
<contributor>
<!--<id>markuswolf</id>-->
<name>Markus Wolf</name>
</contributor>
<contributor>
<!--<id>nicolas.lalevee</id>-->
<name>Nicolas Lalevée</name>
</contributor>
<contributor>
<!--<id>pierre.labiausse</id>-->
<name>Pierre Labiausse</name>
</contributor>
<contributor>
<!--<id>raymond.auge</id>-->
<name>Raymond Auge</name>
</contributor>
<contributor>
<!--<id>timothyjward</id>-->
<name>Tim Ward</name>
</contributor>
<contributor>
<!--<id>bramk</id>-->
<name>Bram de Kruijff</name>
</contributor>
<contributor>
<!--<id>tangyong</id>-->
<name>Tang Yong</name>
</contributor>
<contributor>
<!--<id>gamerson</id>-->
<name>Gregory Amerson</name>
</contributor>
<contributor>
<!--<id>gnodet</id>-->
<name>Guillaume Nodet</name>
</contributor>
<contributor>
<!--<id>marcdejonge</id>-->
<name>Marc de Jonge</name>
</contributor>
<contributor>
<!--<id>trespasserw</id>-->
<name>Roman Shevchenko</name>
</contributor>
</contributors>
<scm>
<url>https://github.com/bndtools/bnd</url>
<connection>scm:git:git://github.com/bndtools/bnd.git</connection>
<developerConnection>scm:git:ssh://github.com/bndtools/bnd.git</developerConnection>
</scm>
<scm>
<url>https://github.com/bndtools/bnd</url>
<connection>scm:git:git://github.com/bndtools/bnd.git</connection>
<developerConnection>scm:git:ssh://github.com/bndtools/bnd.git</developerConnection>
</scm>
<modules>
<module>biz.aQute.bndlib</module>
<module>biz.aQute.bnd</module>
</modules>
<modules>
<module>aQute.libg</module>
<module>biz.aQute.bndlib</module>
<module>biz.aQute.bnd</module>
<module>biz.aQute.bnd.annotation</module>
</modules>
<build>
<sourceDirectory>src</sourceDirectory>
<resources>
<resource>
<directory>src/</directory>
<excludes>
<exclude>**/*.java</exclude>
<exclude>**/packageinfo</exclude>
</excludes>
</resource>
</resources>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<version>3.5.1</version>
<configuration>
<source>1.8</source>
<target>1.8</target>
</configuration>
</plugin>
</plugins>
</build>
</project>

6
repack-tarball.sh Executable file
View File

@ -0,0 +1,6 @@
#!/bin/bash
VERSION=`sed -rn 's/^Version:\s*([0-9.]+)/\1/p' aqute-bnd.spec`
wget https://github.com/bndtools/bnd/archive/$VERSION.REL.tar.gz
gunzip $VERSION.REL.tar.gz
tar tf $VERSION.REL.tar | grep '\.jar$' | xargs tar --delete --file $VERSION.REL.tar
gzip $VERSION.REL.tar

View File

@ -1,3 +1,5 @@
6892b9ab733b922210ce4a2f59cf3d85 2.4.1.REL.tar.gz
795114bdc17a6a74754cf5cb437a3e84 biz.aQute.bnd-2.4.1.pom
64884035472441607fff822e48d2dc41 biz.aQute.bndlib-2.4.1.pom
05575f8ee8d552de3ceb6c1fdf25c259 3.2.0.REL.tar.gz
d7a99d51ee84c15667cacab537e172d2 aQute.libg-3.2.0.pom
6b637063f05a20fe09ba1b34692a5be1 biz.aQute.bnd-3.2.0.pom
8a024cb3ab129989f1237d315d107fd9 biz.aQute.bndlib-3.2.0.pom
951a06549291cf4e140e83032bc15dbd biz.aQute.bnd.annotation-3.2.0.pom