Skip to content

Commit

Permalink
Add module descriptor to jctools-core
Browse files Browse the repository at this point in the history
This commit enables the automatic generation of a JPMS module
descriptor together with a matching OSGI manifest.
  • Loading branch information
ppkarwasz authored and nitsanw committed Aug 17, 2023
1 parent 3e54465 commit 463181b
Show file tree
Hide file tree
Showing 8 changed files with 124 additions and 8 deletions.
13 changes: 6 additions & 7 deletions jctools-core/pom.xml
Expand Up @@ -13,6 +13,12 @@
<packaging>bundle</packaging>

<dependencies>
<dependency>
<groupId>org.osgi</groupId>
<artifactId>osgi.annotation</artifactId>
<scope>provided</scope>
</dependency>

<dependency>
<groupId>org.hamcrest</groupId>
<artifactId>hamcrest-all</artifactId>
Expand Down Expand Up @@ -104,13 +110,6 @@
</goals>
</execution>
</executions>
<configuration>
<archive>
<manifestEntries>
<Automatic-Module-Name>org.jctools.core</Automatic-Module-Name>
</manifestEntries>
</archive>
</configuration>
</plugin>
<plugin>
<groupId>org.codehaus.mojo</groupId>
Expand Down
17 changes: 17 additions & 0 deletions jctools-core/src/main/java/org/jctools/counters/package-info.java
@@ -0,0 +1,17 @@
/*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
@Export
package org.jctools.counters;

import org.osgi.annotation.bundle.Export;
17 changes: 17 additions & 0 deletions jctools-core/src/main/java/org/jctools/maps/package-info.java
@@ -0,0 +1,17 @@
/*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
@Export
package org.jctools.maps;

import org.osgi.annotation.bundle.Export;
@@ -0,0 +1,17 @@
/*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
@Export
package org.jctools.queues.atomic;

import org.osgi.annotation.bundle.Export;
Expand Up @@ -95,4 +95,7 @@
*
* @author nitsanw
*/
@Export
package org.jctools.queues;

import org.osgi.annotation.bundle.Export;
@@ -0,0 +1,17 @@
/*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
@Export
package org.jctools.queues.unpadded;

import org.osgi.annotation.bundle.Export;
17 changes: 17 additions & 0 deletions jctools-core/src/main/java/org/jctools/util/package-info.java
@@ -0,0 +1,17 @@
/*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
@Export
package org.jctools.util;

import org.osgi.annotation.bundle.Export;
31 changes: 30 additions & 1 deletion pom.xml
Expand Up @@ -57,10 +57,13 @@
<maven.compiler.testSource>${java.test.version}</maven.compiler.testSource>
<maven.compiler.testTarget>${java.test.version}</maven.compiler.testTarget>

<bnd.version>6.3.1</bnd.version>
<bundle-plugin.version>5.1.8</bundle-plugin.version>
<hamcrest.version>1.3</hamcrest.version>
<junit.version>4.13.2</junit.version>
<guava-testlib.version>31.1-jre</guava-testlib.version>
<lincheck.version>2.14.1</lincheck.version>
<osgi.version>8.0.0</osgi.version>
</properties>

<modules>
Expand All @@ -72,6 +75,16 @@
<module>jctools-build</module>
</modules>

<dependencyManagement>
<dependencies>
<dependency>
<groupId>org.osgi</groupId>
<artifactId>osgi.annotation</artifactId>
<version>${osgi.version}</version>
</dependency>
</dependencies>
</dependencyManagement>

<build>
<pluginManagement>
<!-- Define versions for children -->
Expand Down Expand Up @@ -164,7 +177,23 @@
<plugin>
<groupId>org.apache.felix</groupId>
<artifactId>maven-bundle-plugin</artifactId>
<version>5.1.6</version>
<version>${bundle-plugin.version}</version>
<dependencies>
<!-- Same version as `biz.aQute.bnd.annotation` -->
<dependency>
<groupId>biz.aQute.bnd</groupId>
<artifactId>biz.aQute.bndlib</artifactId>
<version>${bnd.version}</version>
</dependency>
</dependencies>
<configuration>
<instructions>
<!-- Adds a module descriptor named as the OSGI bundle -->
<_jpms-module-info>$[maven-symbolicname];access=0</_jpms-module-info>
<!-- Exports only explicitly annotated packages -->
<_exportcontents>$[packages;ANNOTATED;org.osgi.annotation.bundle.Export]</_exportcontents>
</instructions>
</configuration>
</plugin>
<plugin>
<groupId>org.codehaus.mojo</groupId>
Expand Down

0 comments on commit 463181b

Please sign in to comment.