Skip to content

Commit

Permalink
Adds Feature #1568 - [OSGi] Opting in to Service Loader Mediator
Browse files Browse the repository at this point in the history
  • Loading branch information
fipro78 committed Jun 11, 2024
1 parent 28a8842 commit 7dbbb32
Show file tree
Hide file tree
Showing 116 changed files with 254 additions and 374 deletions.
14 changes: 9 additions & 5 deletions .github/workflows/pull-request.yml
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ jobs:
distribution: 'zulu'
java-version: ${{ matrix.java-version }}
- name: Unit-Test
run: ./mvnw --color=always verify --projects '!p2-repository,!org.eclipse.collections:org.eclipse.collections'
run: ./mvnw --color=always verify
env:
MAVEN_OPTS: "-Xmx1g"

Expand All @@ -60,7 +60,7 @@ jobs:
- run: mvn --non-recursive wrapper:wrapper -Dmaven=3.9.6
- run: java --version
- name: Unit-Test
run: ./mvnw --color=always verify --projects '!p2-repository,!org.eclipse.collections:org.eclipse.collections'
run: ./mvnw --color=always verify
env:
MAVEN_OPTS: "-Xmx2g"

Expand Down Expand Up @@ -122,12 +122,14 @@ jobs:
with:
distribution: 'zulu'
java-version: 11
- name: Build Generator
run: ./mvnw --color=always -Dsurefire.useFile=false -DskipTests -Denforcer.skip=true clean install --projects 'eclipse-collections-code-generator,eclipse-collections-code-generator-maven-plugin'
- name: JavaDoc Aggregate
run: ./mvnw --color=always -Dsurefire.useFile=false -DskipTests -Denforcer.skip=true clean install javadoc:aggregate --projects '!unit-tests,!serialization-tests,!jcstress-tests,!junit-trait-runner,!unit-tests-java8,!test-coverage,!p2-repository,!org.eclipse.collections:org.eclipse.collections'
run: ./mvnw --color=always -Dsurefire.useFile=false -DskipTests -Denforcer.skip=true clean javadoc:aggregate install --projects '!unit-tests,!serialization-tests,!jcstress-tests,!junit-trait-runner,!unit-tests-java8,!test-coverage'
env:
MAVEN_OPTS: "-Xmx1g"
- name: JavaDoc Jar
run: ./mvnw --color=always -Dsurefire.useFile=false -DskipTests -Denforcer.skip=true clean install javadoc:jar --projects '!unit-tests,!serialization-tests,!jcstress-tests,!junit-trait-runner,!unit-tests-java8,!test-coverage,!p2-repository,!org.eclipse.collections:org.eclipse.collections'
run: ./mvnw --color=always -Dsurefire.useFile=false -DskipTests -Denforcer.skip=true clean install javadoc:jar --projects '!unit-tests,!serialization-tests,!jcstress-tests,!junit-trait-runner,!unit-tests-java8,!test-coverage'
env:
MAVEN_OPTS: "-Xmx1g"

Expand All @@ -150,7 +152,9 @@ jobs:
echo "steps.download-jdk.outputs.version = ${{ steps.download-jdk.outputs.version }}"
- run: mvn --non-recursive wrapper:wrapper -Dmaven=3.9.6
- run: java --version
- name: Build Generator
run: ./mvnw -Dsurefire.useFile=false -DskipTests -Denforcer.skip=true clean install --projects 'eclipse-collections-code-generator,eclipse-collections-code-generator-maven-plugin'
- name: Javadoc
run: ./mvnw --color=always -Dsurefire.useFile=false -DskipTests -Denforcer.skip=true clean install javadoc:aggregate --projects '!unit-tests,!serialization-tests,!jcstress-tests,!junit-trait-runner,!unit-tests-java8,!test-coverage,!p2-repository,!org.eclipse.collections:org.eclipse.collections'
run: ./mvnw --color=always -Dsurefire.useFile=false -DskipTests -Denforcer.skip=true clean javadoc:aggregate install --projects '!unit-tests,!serialization-tests,!jcstress-tests,!junit-trait-runner,!unit-tests-java8,!test-coverage'
env:
MAVEN_OPTS: "-Xmx2g"
6 changes: 3 additions & 3 deletions eclipse-collections-api/bnd.bnd
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
package-version=${version;===;${Bundle-Version}}
package-version=${versionmask;===;${Bundle-Version}}

Automatic-Module-Name: org.eclipse.collections.api
-jpms-module-info: org.eclipse.collections.api;version="${package-version}"
Bundle-SymbolicName: org.eclipse.collections.api
Export-Package: \
*;version="${package-version}"
org.eclipse.collections.api.*;version="${package-version}"
10 changes: 10 additions & 0 deletions eclipse-collections-api/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,16 @@
</sonar.jacoco.reportPaths>
</properties>

<dependencies>
<dependency>
<groupId>biz.aQute.bnd</groupId>
<artifactId>biz.aQute.bnd.annotation</artifactId>
<version>6.4.1</version>
<scope>provided</scope>
<optional>true</optional>
</dependency>
</dependencies>

<build>

<plugins>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,9 @@
*
*/
@SuppressWarnings("ConstantNamingConvention")
@aQute.bnd.annotation.spi.ServiceConsumer(value = ImmutableBagFactory.class)
@aQute.bnd.annotation.spi.ServiceConsumer(value = MutableBagFactory.class)
@aQute.bnd.annotation.spi.ServiceConsumer(value = MultiReaderBagFactory.class)
public final class Bags
{
public static final ImmutableBagFactory immutable = ServiceLoaderUtils.loadServiceClass(ImmutableBagFactory.class);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,8 @@
import org.eclipse.collections.api.factory.bimap.MutableBiMapFactory;

@SuppressWarnings("ConstantNamingConvention")
@aQute.bnd.annotation.spi.ServiceConsumer(value = ImmutableBiMapFactory.class)
@aQute.bnd.annotation.spi.ServiceConsumer(value = MutableBiMapFactory.class)
public final class BiMaps
{
public static final ImmutableBiMapFactory immutable = ServiceLoaderUtils.loadServiceClass(ImmutableBiMapFactory.class);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,10 @@
* </pre>
*/
@SuppressWarnings("ConstantNamingConvention")
@aQute.bnd.annotation.spi.ServiceConsumer(value = ImmutableListFactory.class)
@aQute.bnd.annotation.spi.ServiceConsumer(value = MutableListFactory.class)
@aQute.bnd.annotation.spi.ServiceConsumer(value = FixedSizeListFactory.class)
@aQute.bnd.annotation.spi.ServiceConsumer(value = MultiReaderListFactory.class)
public final class Lists
{
public static final ImmutableListFactory immutable =
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,9 @@
* </pre>
*/
@SuppressWarnings("ConstantNamingConvention")
@aQute.bnd.annotation.spi.ServiceConsumer(value = ImmutableMapFactory.class)
@aQute.bnd.annotation.spi.ServiceConsumer(value = FixedSizeMapFactory.class)
@aQute.bnd.annotation.spi.ServiceConsumer(value = MutableMapFactory.class)
public final class Maps
{
public static final ImmutableMapFactory immutable = ServiceLoaderUtils.loadServiceClass(ImmutableMapFactory.class);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,10 @@
* </pre>
*/
@SuppressWarnings("ConstantNamingConvention")
@aQute.bnd.annotation.spi.ServiceConsumer(value = ImmutableSetFactory.class)
@aQute.bnd.annotation.spi.ServiceConsumer(value = MutableSetFactory.class)
@aQute.bnd.annotation.spi.ServiceConsumer(value = FixedSizeSetFactory.class)
@aQute.bnd.annotation.spi.ServiceConsumer(value = MultiReaderSetFactory.class)
public final class Sets
{
public static final ImmutableSetFactory immutable =
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,8 @@
import org.eclipse.collections.api.factory.bag.sorted.MutableSortedBagFactory;

@SuppressWarnings("ConstantNamingConvention")
@aQute.bnd.annotation.spi.ServiceConsumer(value = MutableSortedBagFactory.class)
@aQute.bnd.annotation.spi.ServiceConsumer(value = ImmutableSortedBagFactory.class)
public final class SortedBags
{
public static final MutableSortedBagFactory mutable = ServiceLoaderUtils.loadServiceClass(MutableSortedBagFactory.class);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,8 @@
import org.eclipse.collections.api.factory.map.sorted.MutableSortedMapFactory;

@SuppressWarnings("ConstantNamingConvention")
@aQute.bnd.annotation.spi.ServiceConsumer(value = ImmutableSortedMapFactory.class)
@aQute.bnd.annotation.spi.ServiceConsumer(value = MutableSortedMapFactory.class)
public final class SortedMaps
{
public static final ImmutableSortedMapFactory immutable = ServiceLoaderUtils.loadServiceClass(ImmutableSortedMapFactory.class);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,8 @@
import org.eclipse.collections.api.factory.set.sorted.MutableSortedSetFactory;

@SuppressWarnings("ConstantNamingConvention")
@aQute.bnd.annotation.spi.ServiceConsumer(value = ImmutableSortedSetFactory.class)
@aQute.bnd.annotation.spi.ServiceConsumer(value = MutableSortedSetFactory.class)
public final class SortedSets
{
public static final ImmutableSortedSetFactory immutable = ServiceLoaderUtils.loadServiceClass(ImmutableSortedSetFactory.class);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,8 @@
import org.eclipse.collections.api.factory.stack.MutableStackFactory;

@SuppressWarnings("ConstantNamingConvention")
@aQute.bnd.annotation.spi.ServiceConsumer(value = ImmutableStackFactory.class)
@aQute.bnd.annotation.spi.ServiceConsumer(value = MutableStackFactory.class)
public final class Stacks
{
public static final ImmutableStackFactory immutable = ServiceLoaderUtils.loadServiceClass(ImmutableStackFactory.class);
Expand Down
7 changes: 0 additions & 7 deletions eclipse-collections-code-generator-maven-plugin/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -50,13 +50,6 @@
<scope>provided</scope>
</dependency>

<dependency>
<groupId>org.apache.maven</groupId>
<artifactId>maven-model</artifactId>
<version>3.9.0</version>
<scope>provided</scope>
</dependency>

<dependency>
<groupId>org.apache.maven.plugin-tools</groupId>
<artifactId>maven-plugin-annotations</artifactId>
Expand Down

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ import org.eclipse.collections.api.factory.map.primitive.MutableObject<name>Hash
* @since 11.1.
*/
@SuppressWarnings("ConstantNamingConvention")
@aQute.bnd.annotation.spi.ServiceConsumer(value = MutableObject<name>HashingStrategyMapFactory.class)
public final class Object<name>HashingStrategyMaps
{
public static final MutableObject<name>HashingStrategyMapFactory mutable =
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,8 @@ import org.eclipse.collections.api.factory.map.primitive.MutableObject<name>MapF
* @since 11.1.
*/
@SuppressWarnings("ConstantNamingConvention")
@aQute.bnd.annotation.spi.ServiceConsumer(value = ImmutableObject<name>MapFactory.class)
@aQute.bnd.annotation.spi.ServiceConsumer(value = MutableObject<name>MapFactory.class)
public final class Object<name>Maps
{
public static final ImmutableObject<name>MapFactory immutable =
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,8 @@ import org.eclipse.collections.api.factory.bag.primitive.Mutable<name>BagFactory
* @since 11.1.
*/
@SuppressWarnings("ConstantNamingConvention")
@aQute.bnd.annotation.spi.ServiceConsumer(value = Immutable<name>BagFactory.class)
@aQute.bnd.annotation.spi.ServiceConsumer(value = Mutable<name>BagFactory.class)
public final class <name>Bags
{
public static final Immutable<name>BagFactory immutable =
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,8 @@ import org.eclipse.collections.api.factory.list.primitive.Mutable<name>ListFacto
* @since 11.1.
*/
@SuppressWarnings("ConstantNamingConvention")
@aQute.bnd.annotation.spi.ServiceConsumer(value = Immutable<name>ListFactory.class)
@aQute.bnd.annotation.spi.ServiceConsumer(value = Mutable<name>ListFactory.class)
public final class <name>Lists
{
public static final Immutable<name>ListFactory immutable =
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,8 @@ import org.eclipse.collections.api.factory.map.primitive.Mutable<name>ObjectMapF
* @since 11.1.
*/
@SuppressWarnings("ConstantNamingConvention")
@aQute.bnd.annotation.spi.ServiceConsumer(value = Immutable<name>ObjectMapFactory.class)
@aQute.bnd.annotation.spi.ServiceConsumer(value = Mutable<name>ObjectMapFactory.class)
public final class <name>ObjectMaps
{
public static final Immutable<name>ObjectMapFactory immutable =
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,8 @@ import org.eclipse.collections.api.factory.map.primitive.Mutable<name1><name2>Ma
* @since 11.1.
*/
@SuppressWarnings("ConstantNamingConvention")
@aQute.bnd.annotation.spi.ServiceConsumer(value = Immutable<name1><name2>MapFactory.class)
@aQute.bnd.annotation.spi.ServiceConsumer(value = Mutable<name1><name2>MapFactory.class)
public final class <name1><name2>Maps
{
public static final Immutable<name1><name2>MapFactory immutable =
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,8 @@ import org.eclipse.collections.api.factory.set.primitive.Mutable<name>SetFactory
* @since 11.1.
*/
@SuppressWarnings("ConstantNamingConvention")
@aQute.bnd.annotation.spi.ServiceConsumer(value = Immutable<name>SetFactory.class)
@aQute.bnd.annotation.spi.ServiceConsumer(value = Mutable<name>SetFactory.class)
public final class <name>Sets
{
public static final Immutable<name>SetFactory immutable =
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,8 @@ import org.eclipse.collections.api.factory.stack.primitive.Mutable<name>StackFac
* @since 11.1.
*/
@SuppressWarnings("ConstantNamingConvention")
@aQute.bnd.annotation.spi.ServiceConsumer(value = Immutable<name>StackFactory.class)
@aQute.bnd.annotation.spi.ServiceConsumer(value = Mutable<name>StackFactory.class)
public final class <name>Stacks
{
public static final Immutable<name>StackFactory immutable =
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -186,7 +186,7 @@ public interface Mutable<name>ObjectMap\<V> extends <name>ObjectMap\<V>, Mutable
* Puts all of the key/value mappings from the specified pairs into this map. If this
* map already has a value associated with one of the keys in the pairs, it will be
* replaced with the value in the pair.
* @param iterable the pairs to put into this map
* @param keyValuePairs the pairs to put into this map
* @return this map
* @see #putPair(<name>ObjectPair)
*/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -204,7 +204,7 @@ public interface Mutable<name1><name2>Map extends <name1><name2>Map, Mutable<nam
* Puts all of the key/value mappings from the specified pairs into this map. If this
* map already has a value associated with one of the keys in the pairs, it will be
* replaced with the value in the pair.
* @param iterable the pairs to put into this map
* @param keyValuePairs the pairs to put into this map
* @return this map
* @see #putPair(<name1><name2>Pair)
*/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,7 @@ public interface Object<name>Map\<K> extends <name>Iterable

/**
* Implements the injectInto pattern with each key/value pair of the map.
* @param value to be injected into the map
* @param injectedValue value to be injected into the map
* @param function to apply to the injected value and key/value pairs
* @return result of injecting the injectedValue into the map
* @since 11.1
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ public interface <name>ObjectMap\<V> extends PrimitiveObjectMap\<V>

/**
* Implements the injectInto pattern with each key/value pair of the map.
* @param value to be injected into the map
* @param injectedValue value to be injected into the map
* @param function to apply to the injected value and key/value pairs
* @return result of injecting the injectedValue into the map
* @since 11.1
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ public interface <name1><name2>Map extends <name2>ValuesMap

/**
* Implements the injectInto pattern with each key/value pair of the map.
* @param value to be injected into the map
* @param injectedValue value to be injected into the map
* @param function to apply to the injected value and key/value pairs
* @return result of injecting the injectedValue into the map
* @since 11.1
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ import org.eclipse.collections.impl.factory.primitive.<name>Bags;
*
* @since 4.0.
*/
@aQute.bnd.annotation.spi.ServiceProvider(Immutable<name>BagFactory.class)
public class Immutable<name>BagFactoryImpl implements Immutable<name>BagFactory
{
public static final Immutable<name>BagFactory INSTANCE = new Immutable<name>BagFactoryImpl();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ import org.eclipse.collections.impl.utility.Iterate;
*
* @since 6.0.
*/
@aQute.bnd.annotation.spi.ServiceProvider(Mutable<name>BagFactory.class)
public class Mutable<name>BagFactoryImpl implements Mutable<name>BagFactory
{
public static final Mutable<name>BagFactory INSTANCE = new Mutable<name>BagFactoryImpl();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ import org.eclipse.collections.impl.factory.primitive.<name>Lists;
*
* @since 3.2.
*/
@aQute.bnd.annotation.spi.ServiceProvider(Immutable<name>ListFactory.class)
public class Immutable<name>ListFactoryImpl implements Immutable<name>ListFactory
{
public static final Immutable<name>ListFactory INSTANCE = new Immutable<name>ListFactoryImpl();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ import org.eclipse.collections.impl.utility.Iterate;
*
* @since 6.0.
*/
@aQute.bnd.annotation.spi.ServiceProvider(Mutable<name>ListFactory.class)
public class Mutable<name>ListFactoryImpl implements Mutable<name>ListFactory
{
public static final Mutable<name>ListFactory INSTANCE = new Mutable<name>ListFactoryImpl();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ import org.eclipse.collections.impl.factory.primitive.Object<name>Maps;
*
* @since 4.0.
*/
@aQute.bnd.annotation.spi.ServiceProvider(ImmutableObject<name>MapFactory.class)
public class ImmutableObject<name>MapFactoryImpl implements ImmutableObject<name>MapFactory
{
public static final ImmutableObject<name>MapFactory INSTANCE = new ImmutableObject<name>MapFactoryImpl();
Expand Down
Loading

0 comments on commit 7dbbb32

Please sign in to comment.