Convert mdsal-yanglib-rfc8525 to a JPMS module 03/106503/1
authorRobert Varga <robert.varga@pantheon.tech>
Fri, 16 Jun 2023 10:21:42 +0000 (12:21 +0200)
committerRobert Varga <robert.varga@pantheon.tech>
Fri, 16 Jun 2023 10:22:07 +0000 (12:22 +0200)
This is a simplistic module, convert it.

JIRA: MDSAL-619
Change-Id: I84ab4664d0c4441b9d250b6b876d16860b396ed0
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
yanglib/mdsal-yanglib-rfc8525/pom.xml
yanglib/mdsal-yanglib-rfc8525/src/main/java/module-info.java [new file with mode: 0644]
yanglib/mdsal-yanglib-rfc8525/src/main/java/org/opendaylight/mdsal/yanglib/rfc8525/YangLibrarySupport.java

index 2bb9781bef84bff70fd7e68d358f0ecd904f6740..304db1f856d56c60769ef5328a44ae52a54d116c 100644 (file)
     <packaging>bundle</packaging>
 
     <dependencies>
+        <dependency>
+            <groupId>com.github.spotbugs</groupId>
+            <artifactId>spotbugs-annotations</artifactId>
+            <optional>true</optional>
+        </dependency>
         <dependency>
             <groupId>org.opendaylight.mdsal</groupId>
             <artifactId>mdsal-yanglib-api</artifactId>
         </dependency>
     </dependencies>
 
-    <build>
-        <plugins>
-            <plugin>
-                <groupId>org.apache.felix</groupId>
-                <artifactId>maven-bundle-plugin</artifactId>
-                <configuration>
-                    <instructions>
-                        <Automatic-Module-Name>org.opendaylight.mdsal.yanglib.rfc8525</Automatic-Module-Name>
-                    </instructions>
-                </configuration>
-            </plugin>
-        </plugins>
-    </build>
     <scm>
         <connection>scm:git:ssh://git.opendaylight.org:29418/mdsal.git</connection>
         <developerConnection>scm:git:ssh://git.opendaylight.org:29418/mdsal.git</developerConnection>
diff --git a/yanglib/mdsal-yanglib-rfc8525/src/main/java/module-info.java b/yanglib/mdsal-yanglib-rfc8525/src/main/java/module-info.java
new file mode 100644 (file)
index 0000000..7503121
--- /dev/null
@@ -0,0 +1,44 @@
+/*
+ * Copyright (c) 2023 PANTHEON.tech, s.r.o. and others.  All rights reserved.
+ *
+ * This program and the accompanying materials are made available under the
+ * terms of the Eclipse Public License v1.0 which accompanies this distribution,
+ * and is available at http://www.eclipse.org/legal/epl-v10.html
+ */
+import org.opendaylight.mdsal.binding.dom.codec.api.BindingCodecTreeFactory;
+import org.opendaylight.mdsal.binding.runtime.api.BindingRuntimeGenerator;
+import org.opendaylight.mdsal.yanglib.api.YangLibSupportFactory;
+import org.opendaylight.mdsal.yanglib.rfc8525.YangLibrarySupportFactory;
+import org.opendaylight.yangtools.yang.parser.api.YangParserFactory;
+
+module org.opendaylight.mdsal.yanglib.rfc8525 {
+    // FIXME: just the DI bits
+    exports org.opendaylight.mdsal.yanglib.rfc8525;
+
+    provides YangLibSupportFactory with YangLibrarySupportFactory;
+
+    uses BindingCodecTreeFactory;
+    uses BindingRuntimeGenerator;
+    uses YangParserFactory;
+
+    requires transitive org.opendaylight.yangtools.yang.parser.api;
+    requires transitive org.opendaylight.mdsal.binding.dom.codec.api;
+    requires transitive org.opendaylight.mdsal.yanglib.api;
+
+    requires com.google.common;
+    requires org.opendaylight.mdsal.binding.runtime.spi;
+    requires org.opendaylight.yangtools.yang.binding;
+    requires org.opendaylight.yangtools.yang.data.api;
+    requires org.opendaylight.yangtools.yang.data.util;
+    requires org.opendaylight.yang.gen.ietf.datastores.rfc8342;
+    requires org.opendaylight.yang.gen.ietf.inet.types.rfc6991;
+    requires org.opendaylight.yang.gen.ietf.yang.library.rfc8525;
+    requires org.opendaylight.yang.gen.ietf.yang.types.rfc6991;
+    requires org.slf4j;
+
+    // Annotations
+    requires static com.github.spotbugs.annotations;
+    requires static javax.inject;
+    requires static org.kohsuke.metainf_services;
+    requires static org.osgi.service.component.annotations;
+}
index b62f1f95f4e7dfd71a912edc9794caaec6a7763d..015d4cdf8c7467884c8be5bf7c04907dbb324aaa 100644 (file)
@@ -34,13 +34,11 @@ import org.opendaylight.yangtools.yang.parser.api.YangParserFactory;
 import org.osgi.service.component.annotations.Activate;
 import org.osgi.service.component.annotations.Component;
 import org.osgi.service.component.annotations.Reference;
-import org.osgi.service.component.annotations.RequireServiceComponentRuntime;
 
 @Beta
 @NonNullByDefault
 @Singleton
 @Component
-@RequireServiceComponentRuntime
 public final class YangLibrarySupport implements YangLibSupport {
     private static final Revision REVISION = YangLibrary.QNAME.getRevision().orElseThrow();