Convert yang-common to a JPMS module 19/84019/6
authorRobert Varga <robert.varga@pantheon.tech>
Tue, 27 Aug 2019 21:03:20 +0000 (23:03 +0200)
committerRobert Varga <nite@hq.sk>
Tue, 1 Oct 2019 19:55:53 +0000 (19:55 +0000)
This drops plugin configuration in favor of declaring a module. It
allows us to ditch metainf-services as ServiceLoader bindings are
now explicit.

Change-Id: Ie160bbf551f4bbca424978215400c78d4b305334
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
yang/yang-common/pom.xml
yang/yang-common/src/main/java/module-info.java [new file with mode: 0644]
yang/yang-common/src/main/java/org/opendaylight/yangtools/yang/common/Decimal64.java
yang/yang-common/src/main/java/org/opendaylight/yangtools/yang/common/Uint16.java
yang/yang-common/src/main/java/org/opendaylight/yangtools/yang/common/Uint32.java
yang/yang-common/src/main/java/org/opendaylight/yangtools/yang/common/Uint64.java
yang/yang-common/src/main/java/org/opendaylight/yangtools/yang/common/Uint8.java

index be9011634e96a8d79dc5a43b08c11ed84f9943c9..289efe6023a6e4bd49420b144eb80c23e13310ab 100644 (file)
             <groupId>org.opendaylight.yangtools</groupId>
             <artifactId>concepts</artifactId>
         </dependency>
-        <dependency>
-            <groupId>org.kohsuke.metainf-services</groupId>
-            <artifactId>metainf-services</artifactId>
-        </dependency>
     </dependencies>
-
-    <build>
-        <plugins>
-            <plugin>
-                <groupId>org.apache.felix</groupId>
-                <artifactId>maven-bundle-plugin</artifactId>
-                <extensions>true</extensions>
-                <configuration>
-                    <instructions>
-                        <Automatic-Module-Name>org.opendaylight.yangtools.yang.common</Automatic-Module-Name>
-                    </instructions>
-                </configuration>
-            </plugin>
-        </plugins>
-    </build>
-
 </project>
diff --git a/yang/yang-common/src/main/java/module-info.java b/yang/yang-common/src/main/java/module-info.java
new file mode 100644 (file)
index 0000000..4dc30b9
--- /dev/null
@@ -0,0 +1,32 @@
+/*
+ * Copyright (c) 2019 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.yangtools.yang.common.CanonicalValueSupport;
+import org.opendaylight.yangtools.yang.common.Decimal64;
+import org.opendaylight.yangtools.yang.common.Uint16;
+import org.opendaylight.yangtools.yang.common.Uint32;
+import org.opendaylight.yangtools.yang.common.Uint64;
+import org.opendaylight.yangtools.yang.common.Uint8;
+
+module org.opendaylight.yangtools.yang.common {
+    exports org.opendaylight.yangtools.yang.common;
+
+    provides CanonicalValueSupport with
+        Decimal64.Support,
+        Uint8.Support,
+        Uint16.Support,
+        Uint32.Support,
+        Uint64.Support;
+
+    requires transitive org.opendaylight.yangtools.concepts;
+    requires org.slf4j;
+
+    // Annotations
+    requires static com.github.spotbugs.annotations;
+    requires static org.eclipse.jdt.annotation;
+    requires static org.checkerframework.checker.qual;
+}
index db1a6b8bdd9f3ba07a0d7d56d35d977322d6941d..e3fceee38b3e89d2810228066a8595753bf7601e 100644 (file)
@@ -17,7 +17,6 @@ import java.math.BigDecimal;
 import java.util.Optional;
 import org.eclipse.jdt.annotation.NonNullByDefault;
 import org.eclipse.jdt.annotation.Nullable;
-import org.kohsuke.MetaInfServices;
 import org.opendaylight.yangtools.concepts.Variant;
 
 /**
@@ -29,7 +28,6 @@ import org.opendaylight.yangtools.concepts.Variant;
 @Beta
 @NonNullByDefault
 public class Decimal64 extends Number implements CanonicalValue<Decimal64> {
-    @MetaInfServices(value = CanonicalValueSupport.class)
     public static final class Support extends AbstractCanonicalValueSupport<Decimal64> {
         public Support() {
             super(Decimal64.class);
index 89e7590cbca1d1a696e8e573d4ed26198eed2bee..4af4172e5f6fc8b2e13bc30426cc8fc2df060314 100644 (file)
@@ -15,7 +15,6 @@ import com.google.common.collect.Interners;
 import org.eclipse.jdt.annotation.NonNull;
 import org.eclipse.jdt.annotation.NonNullByDefault;
 import org.eclipse.jdt.annotation.Nullable;
-import org.kohsuke.MetaInfServices;
 import org.opendaylight.yangtools.concepts.Variant;
 
 /**
@@ -26,7 +25,6 @@ import org.opendaylight.yangtools.concepts.Variant;
 @Beta
 @NonNullByDefault
 public class Uint16 extends Number implements CanonicalValue<Uint16> {
-    @MetaInfServices(value = CanonicalValueSupport.class)
     public static final class Support extends AbstractCanonicalValueSupport<Uint16> {
         public Support() {
             super(Uint16.class);
index d6da4641d1e4ae0d435a51dbd0273f4042915d03..cb881a8dc833b508c7376a80873cb7fc12cb1bc5 100644 (file)
@@ -16,7 +16,6 @@ import com.google.common.primitives.UnsignedInteger;
 import org.eclipse.jdt.annotation.NonNull;
 import org.eclipse.jdt.annotation.NonNullByDefault;
 import org.eclipse.jdt.annotation.Nullable;
-import org.kohsuke.MetaInfServices;
 import org.opendaylight.yangtools.concepts.Variant;
 
 /**
@@ -27,7 +26,6 @@ import org.opendaylight.yangtools.concepts.Variant;
 @Beta
 @NonNullByDefault
 public class Uint32 extends Number implements CanonicalValue<Uint32> {
-    @MetaInfServices(value = CanonicalValueSupport.class)
     public static final class Support extends AbstractCanonicalValueSupport<Uint32> {
         public Support() {
             super(Uint32.class);
index 271deaddaddd9e17ff590a21e544314d6918bd23..0b6797bd6617bc9ea7f0c60d6a61fb4db6a89e3f 100644 (file)
@@ -17,7 +17,6 @@ import java.math.BigInteger;
 import org.eclipse.jdt.annotation.NonNull;
 import org.eclipse.jdt.annotation.NonNullByDefault;
 import org.eclipse.jdt.annotation.Nullable;
-import org.kohsuke.MetaInfServices;
 import org.opendaylight.yangtools.concepts.Variant;
 
 /**
@@ -28,7 +27,6 @@ import org.opendaylight.yangtools.concepts.Variant;
 @Beta
 @NonNullByDefault
 public class Uint64 extends Number implements CanonicalValue<Uint64> {
-    @MetaInfServices(value = CanonicalValueSupport.class)
     public static final class Support extends AbstractCanonicalValueSupport<Uint64> {
         public Support() {
             super(Uint64.class);
index 84a00252c50f8c7f62270047f7681e414cdf11f9..e627168d5f165e10a2efdc7d04a6796e69b31ead 100644 (file)
@@ -13,7 +13,6 @@ import com.google.common.annotations.Beta;
 import org.eclipse.jdt.annotation.NonNull;
 import org.eclipse.jdt.annotation.NonNullByDefault;
 import org.eclipse.jdt.annotation.Nullable;
-import org.kohsuke.MetaInfServices;
 import org.opendaylight.yangtools.concepts.Variant;
 
 /**
@@ -24,7 +23,6 @@ import org.opendaylight.yangtools.concepts.Variant;
 @Beta
 @NonNullByDefault
 public class Uint8 extends Number implements CanonicalValue<Uint8> {
-    @MetaInfServices(value = CanonicalValueSupport.class)
     public static final class Support extends AbstractCanonicalValueSupport<Uint8> {
         public Support() {
             super(Uint8.class);