dev-java/felix-utils: new package, add 1.11.8

Signed-off-by: Volkmar W. Pogatzki <gentoo@pogatzki.net>
Signed-off-by: Florian Schmaus <flow@gentoo.org>
This commit is contained in:
Volkmar W. Pogatzki 2022-09-17 20:05:16 +02:00 committed by Florian Schmaus
parent 1a6266324e
commit c1d62fce5c
No known key found for this signature in database
GPG Key ID: 2239A7E8F5852052
4 changed files with 194 additions and 0 deletions

View File

@ -0,0 +1 @@
DIST felix-utils-1.11.8.tar.gz 90519 BLAKE2B 2fe6ce8101e8e4d9533a2decacc581d35babd3a26747598a196ade7cea787d6e379968208619dc9c4d89c8f670ccb98124223828c852347f859c4ae3a7f284c8 SHA512 cef0f05754857a5863869145b3c465a1fea0d41767637df904b0b041579af18e5b5e3c8e09dc89f0e2e3d252585e0765b6b6e34bf932df1ebdc62a7127ac8cfd

View File

@ -0,0 +1,59 @@
# Copyright 1999-2022 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2
# Skeleton command:
# java-ebuilder --generate-ebuild --workdir . --pom pom.xml --download-uri mirror://apache/felix/org.apache.felix.utils-1.11.8-source-release.tar.gz --slot 0 --keywords "~amd64" --ebuild felix-utils-1.11.8.ebuild
EAPI=8
JAVA_PKG_IUSE="doc source test"
MAVEN_ID="org.apache.felix:org.apache.felix.utils:1.11.8"
JAVA_TESTING_FRAMEWORKS="junit-4"
inherit java-pkg-2 java-pkg-simple
DESCRIPTION="Utility classes for OSGi"
HOMEPAGE="https://felix.apache.org/documentation/index.html"
SRC_URI="mirror://apache/felix/org.apache.felix.utils-${PV}-source-release.tar.gz -> ${P}.tar.gz"
LICENSE="Apache-2.0"
SLOT="0"
KEYWORDS="~amd64"
# Compile dependencies
# POM: pom.xml
# org.osgi:osgi.cmpn:5.0.0 -> >=dev-java/osgi-cmpn-8.0.0:8
# org.osgi:osgi.core:5.0.0 -> >=dev-java/osgi-core-8.0.0:0
# POM: pom.xml
# test? junit:junit:4.12 -> >=dev-java/junit-4.13.2:4
# test? org.mockito:mockito-core:2.18.3 -> >=dev-java/mockito-4.7.0:4
DEPEND="
>=virtual/jdk-1.8:*
dev-java/osgi-cmpn:8
dev-java/osgi-core:0
test? (
dev-java/mockito:4
)
"
RDEPEND=">=virtual/jre-1.8:*"
PATCHES=(
"${FILESDIR}/felix-utils-1.11.8-Port-to-osgi-cmpn.patch"
)
DOCS=( DEPENDENCIES NOTICE doc/changelog.txt )
S="${WORKDIR}/org.apache.felix.utils-${PV}"
JAVA_CLASSPATH_EXTRA="osgi-cmpn-8,osgi-core"
JAVA_SRC_DIR="src/main/java"
JAVA_TEST_GENTOO_CLASSPATH="junit-4,mockito-4"
JAVA_TEST_SRC_DIR="src/test/java"
JAVA_TEST_RESOURCE_DIRS="src/test/resources"
src_prepare() {
default # https://bugs.gentoo.org/780585
}

View File

@ -0,0 +1,123 @@
From d7a2d969b55ab34a223ad1422b2e3ef7d95a347f Mon Sep 17 00:00:00 2001
From: Marian Koncek <mkoncek@redhat.com>
Date: Mon, 5 Nov 2018 09:59:04 +0100
Subject: [PATCH] Port to osgi-cmpn
---
.../utils/repository/AggregateRepository.java | 20 +++++++++++++++++++
.../utils/repository/BaseRepository.java | 19 ++++++++++++++++++
.../utils/properties/MockBundleContext.java | 10 ++++++++++
3 files changed, 49 insertions(+)
diff --git a/src/main/java/org/apache/felix/utils/repository/AggregateRepository.java b/src/main/java/org/apache/felix/utils/repository/AggregateRepository.java
index 50dceaf..4da3141 100644
--- a/src/main/java/org/apache/felix/utils/repository/AggregateRepository.java
+++ b/src/main/java/org/apache/felix/utils/repository/AggregateRepository.java
@@ -25,7 +25,12 @@ import java.util.Map;
import org.osgi.resource.Capability;
import org.osgi.resource.Requirement;
+import org.osgi.resource.Resource;
+import org.osgi.service.repository.ExpressionCombiner;
import org.osgi.service.repository.Repository;
+import org.osgi.service.repository.RequirementBuilder;
+import org.osgi.service.repository.RequirementExpression;
+import org.osgi.util.promise.Promise;
public class AggregateRepository implements Repository {
@@ -52,4 +57,19 @@ public class AggregateRepository implements Repository {
}
return result;
}
+
+ @Override
+ public Promise<Collection<Resource>> findProviders(RequirementExpression expression) {
+ throw new UnsupportedOperationException();
+ }
+
+ @Override
+ public ExpressionCombiner getExpressionCombiner() {
+ throw new UnsupportedOperationException();
+ }
+
+ @Override
+ public RequirementBuilder newRequirementBuilder(String namespace) {
+ throw new UnsupportedOperationException();
+ }
}
diff --git a/src/main/java/org/apache/felix/utils/repository/BaseRepository.java b/src/main/java/org/apache/felix/utils/repository/BaseRepository.java
index 95adadd..0998ab0 100644
--- a/src/main/java/org/apache/felix/utils/repository/BaseRepository.java
+++ b/src/main/java/org/apache/felix/utils/repository/BaseRepository.java
@@ -30,7 +30,11 @@ import org.osgi.framework.Constants;
import org.osgi.resource.Capability;
import org.osgi.resource.Requirement;
import org.osgi.resource.Resource;
+import org.osgi.service.repository.ExpressionCombiner;
import org.osgi.service.repository.Repository;
+import org.osgi.service.repository.RequirementBuilder;
+import org.osgi.service.repository.RequirementExpression;
+import org.osgi.util.promise.Promise;
/**
*/
@@ -90,4 +94,19 @@ public class BaseRepository implements Repository {
}
return result;
}
+
+ @Override
+ public Promise<Collection<Resource>> findProviders(RequirementExpression expression) {
+ throw new UnsupportedOperationException();
+ }
+
+ @Override
+ public ExpressionCombiner getExpressionCombiner() {
+ throw new UnsupportedOperationException();
+ }
+
+ @Override
+ public RequirementBuilder newRequirementBuilder(String namespace) {
+ throw new UnsupportedOperationException();
+ }
}
diff --git a/src/test/java/org/apache/felix/utils/properties/MockBundleContext.java b/src/test/java/org/apache/felix/utils/properties/MockBundleContext.java
index 3eab444..df94a6c 100644
--- a/src/test/java/org/apache/felix/utils/properties/MockBundleContext.java
+++ b/src/test/java/org/apache/felix/utils/properties/MockBundleContext.java
@@ -25,7 +25,9 @@ import org.osgi.framework.BundleListener;
import org.osgi.framework.Filter;
import org.osgi.framework.FrameworkListener;
import org.osgi.framework.InvalidSyntaxException;
+import org.osgi.framework.ServiceFactory;
import org.osgi.framework.ServiceListener;
+import org.osgi.framework.ServiceObjects;
import org.osgi.framework.ServiceReference;
import org.osgi.framework.ServiceRegistration;
@@ -105,6 +107,10 @@ public class MockBundleContext implements BundleContext {
throw new UnsupportedOperationException();
}
+ public <S> ServiceRegistration<S> registerService(Class<S> clazz, ServiceFactory<S> factory, Dictionary<String, ?> properties) {
+ throw new UnsupportedOperationException();
+ }
+
public ServiceReference[] getServiceReferences(String s, String s1) throws InvalidSyntaxException {
throw new UnsupportedOperationException();
}
@@ -125,6 +131,10 @@ public class MockBundleContext implements BundleContext {
throw new UnsupportedOperationException();
}
+ public <S> ServiceObjects<S> getServiceObjects(ServiceReference<S> reference) {
+ throw new UnsupportedOperationException();
+ }
+
public File getDataFile(String s) {
throw new UnsupportedOperationException();
}
--
2.17.2

View File

@ -0,0 +1,11 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE pkgmetadata SYSTEM "https://www.gentoo.org/dtd/metadata.dtd">
<pkgmetadata>
<maintainer type="project">
<email>java@gentoo.org</email>
</maintainer>
<upstream>
<doc>https://felix.apache.org/documentation/documentation.html</doc>
<remote-id type="github">apache/felix-dev</remote-id>
</upstream>
</pkgmetadata>