Remove yang-xpath-antlr 56/99656/3
authorRobert Varga <robert.varga@pantheon.tech>
Tue, 8 Feb 2022 15:13:49 +0000 (16:13 +0100)
committerRobert Varga <robert.varga@pantheon.tech>
Tue, 8 Feb 2022 15:29:28 +0000 (16:29 +0100)
The antlr grammar is an implementation-internal detail which we broke
out to keep spotbugs happy. It turns out we can keep it happy with a
simple suppression.

Move the grammar and eliminate its artifact, making things a bit
smoother.

JIRA: YANGTOOLS-1395
Change-Id: I3632549f9039a28866895ffaa7ffd7d9774c06a1
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
12 files changed:
artifacts/pom.xml
docs/pom.xml
xpath/pom.xml
xpath/yang-xpath-antlr/pom.xml [deleted file]
xpath/yang-xpath-antlr/src/main/java/module-info.java [deleted file]
xpath/yang-xpath-impl/pom.xml
xpath/yang-xpath-impl/src/main/antlr4/org/opendaylight/yangtools/yang/xpath/antlr/instanceIdentifier.g4 [moved from xpath/yang-xpath-antlr/src/main/antlr4/org/opendaylight/yangtools/yang/xpath/antlr/instanceIdentifier.g4 with 100% similarity]
xpath/yang-xpath-impl/src/main/antlr4/org/opendaylight/yangtools/yang/xpath/antlr/xpath.g4 [moved from xpath/yang-xpath-antlr/src/main/antlr4/org/opendaylight/yangtools/yang/xpath/antlr/xpath.g4 with 100% similarity]
xpath/yang-xpath-impl/src/main/java/module-info.java
xpath/yang-xpath-impl/src/main/java/org/opendaylight/yangtools/yang/xpath/antlr/package-info.java [moved from xpath/yang-xpath-antlr/src/main/java/org/opendaylight/yangtools/yang/xpath/antlr/package-info.java with 79% similarity]
xpath/yang-xpath-impl/src/main/java/org/opendaylight/yangtools/yang/xpath/impl/di/package-info.java
xpath/yang-xpath-impl/src/main/java/org/opendaylight/yangtools/yang/xpath/impl/package-info.java

index 6e48c790064784015a069c83d9dcb22d70ca517e..3230ad88550dedd2c1a663b375e87af562d60774 100644 (file)
                 <artifactId>yang-xpath-api</artifactId>
                 <version>8.0.0-SNAPSHOT</version>
             </dependency>
-            <dependency>
-                <groupId>org.opendaylight.yangtools</groupId>
-                <artifactId>yang-xpath-antlr</artifactId>
-                <version>8.0.0-SNAPSHOT</version>
-            </dependency>
             <dependency>
                 <groupId>org.opendaylight.yangtools</groupId>
                 <artifactId>yang-xpath-impl</artifactId>
index 6602e559da988789b67f62bbb87490db6f5d9c15..da90607813abee67102a8e7fa5e6fe177dca1943 100644 (file)
             <groupId>org.opendaylight.yangtools</groupId>
             <artifactId>yang-xpath-api</artifactId>
         </dependency>
-        <dependency>
-            <groupId>org.opendaylight.yangtools</groupId>
-            <artifactId>yang-xpath-antlr</artifactId>
-        </dependency>
         <dependency>
             <groupId>org.opendaylight.yangtools</groupId>
             <artifactId>yang-xpath-impl</artifactId>
index aecbb708cfa7d4275d5818fcee1c3e0d1eb89e3e..d3314a3e4b02a605bb1ce6a0490bd1b29555d888 100644 (file)
@@ -30,7 +30,6 @@
     <modules>
         <!-- YANG XPath API and implementation -->
         <module>yang-xpath-api</module>
-        <module>yang-xpath-antlr</module>
         <!-- FIXME: rename to yang-xpath-ri -->
         <module>yang-xpath-impl</module>
     </modules>
diff --git a/xpath/yang-xpath-antlr/pom.xml b/xpath/yang-xpath-antlr/pom.xml
deleted file mode 100644 (file)
index 0ed933f..0000000
+++ /dev/null
@@ -1,56 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!-- vi: set et smarttab sw=4 tabstop=4: -->
-<!--
- Copyright (c) 2013 Cisco Systems, Inc. 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
--->
-<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
-    <modelVersion>4.0.0</modelVersion>
-    <parent>
-        <groupId>org.opendaylight.yangtools</groupId>
-        <artifactId>bnd-parent</artifactId>
-        <version>8.0.0-SNAPSHOT</version>
-        <relativePath>../../bnd-parent</relativePath>
-    </parent>
-
-    <artifactId>yang-xpath-antlr</artifactId>
-    <version>8.0.0-SNAPSHOT</version>
-    <packaging>jar</packaging>
-    <name>${project.artifactId}</name>
-    <description>YANG XPath ANTLR grammars</description>
-
-    <properties>
-        <!-- antlr-generated code does not pass SB -->
-        <odlparent.spotbugs.skip>true</odlparent.spotbugs.skip>
-    </properties>
-
-    <dependencies>
-        <dependency>
-            <groupId>org.antlr</groupId>
-            <artifactId>antlr4-runtime</artifactId>
-        </dependency>
-    </dependencies>
-
-    <build>
-        <plugins>
-            <plugin>
-                <groupId>org.antlr</groupId>
-                <artifactId>antlr4-maven-plugin</artifactId>
-                <executions>
-                    <execution>
-                        <goals>
-                            <goal>antlr4</goal>
-                        </goals>
-                    </execution>
-                </executions>
-                <configuration>
-                    <listener>false</listener>
-                </configuration>
-            </plugin>
-        </plugins>
-    </build>
-
-</project>
diff --git a/xpath/yang-xpath-antlr/src/main/java/module-info.java b/xpath/yang-xpath-antlr/src/main/java/module-info.java
deleted file mode 100644 (file)
index 5d25431..0000000
+++ /dev/null
@@ -1,15 +0,0 @@
-/*
- * 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
- */
-module org.opendaylight.yangtools.yang.xpath.antlr {
-    exports org.opendaylight.yangtools.yang.xpath.antlr;
-
-    requires transitive org.antlr.antlr4.runtime;
-
-    // Annotations
-    requires static org.osgi.annotation.bundle;
-}
index 9bd5e5618e74225e1defa525711adcf3c4e33963..bff1f03e2d5577881781cac20c8de9ee8f9f8a38 100644 (file)
             <groupId>org.opendaylight.yangtools</groupId>
             <artifactId>yang-xpath-api</artifactId>
         </dependency>
-        <dependency>
-            <groupId>org.opendaylight.yangtools</groupId>
-            <artifactId>yang-xpath-antlr</artifactId>
-        </dependency>
 
         <dependency>
             <groupId>org.kohsuke.metainf-services</groupId>
             <artifactId>org.osgi.service.component.annotations</artifactId>
         </dependency>
     </dependencies>
+
+    <build>
+        <plugins>
+            <plugin>
+                <groupId>org.antlr</groupId>
+                <artifactId>antlr4-maven-plugin</artifactId>
+                <executions>
+                    <execution>
+                        <goals>
+                            <goal>antlr4</goal>
+                        </goals>
+                    </execution>
+                </executions>
+                <configuration>
+                    <listener>false</listener>
+                </configuration>
+            </plugin>
+        </plugins>
+    </build>
 </project>
index c23c9bf0bc0a952de3172cae49149d26a1160d4c..8ecdf8eec53303feb7f95c85549c21c013fe10c8 100644 (file)
@@ -14,9 +14,9 @@ module org.opendaylight.yangtools.yang.xpath.impl {
     provides YangXPathParserFactory with AntlrXPathParserFactory;
 
     requires java.xml;
+    requires org.antlr.antlr4.runtime;
     requires org.opendaylight.yangtools.yang.common;
     requires org.opendaylight.yangtools.yang.xpath.api;
-    requires org.opendaylight.yangtools.yang.xpath.antlr;
     requires org.slf4j;
 
     // Annotations
similarity index 79%
rename from xpath/yang-xpath-antlr/src/main/java/org/opendaylight/yangtools/yang/xpath/antlr/package-info.java
rename to xpath/yang-xpath-impl/src/main/java/org/opendaylight/yangtools/yang/xpath/antlr/package-info.java
index e2e71db807f1e1995641daa890f07fdaf0cf74bc..e010c430d9de4ecd14a9c274372332c5c75c3113 100644 (file)
@@ -9,7 +9,7 @@
  * ANTLR grammars for parsing RFC7950 XPpath constructs. This package is considered an implementation detail and does
  * not fall under API stability contract. Use at your own risk.
  */
-@Export
+@SuppressFBWarnings(justification = "Code generated by ANTLR does not pass SpotBugs")
 package org.opendaylight.yangtools.yang.xpath.antlr;
 
-import org.osgi.annotation.bundle.Export;
+import edu.umd.cs.findbugs.annotations.SuppressFBWarnings;
index 76f9ddae31816ce04b7c30bb9bf001aef31d7d9f..5b57145170b826eb81674315f4f8c7083731c71c 100644 (file)
@@ -7,6 +7,6 @@
  */
 /**
  * Package exposing {@link org.opendaylight.yangtools.yang.xpath.api.YangXPathParserFactory} component to various
- * dependency injection frameworks, so they can locate them.
+ * dependency injection frameworks, so they can locate them. This package is not exposed to OSGi runtime.
  */
 package org.opendaylight.yangtools.yang.xpath.impl.di;
\ No newline at end of file
index 4acc17c57dbded24a99aa51e6ace5aeb81140e98..7ba94d61cb8e1fea89aa06065fa02f2f0e733790 100644 (file)
@@ -9,6 +9,9 @@
  * XPath parsing which results in a {@link org.opendaylight.yangtools.yang.xpath.api.YangExpr}. This is based
  * on the XPath grammar from <a href="https://github.com/antlr/grammars-v4/blob/master/xpath/xpath.g4">grammars-v4</a>.
  */
-@org.eclipse.jdt.annotation.NonNullByDefault
-@org.osgi.service.component.annotations.RequireServiceComponentRuntime
-package org.opendaylight.yangtools.yang.xpath.impl;
\ No newline at end of file
+@NonNullByDefault
+@RequireServiceComponentRuntime
+package org.opendaylight.yangtools.yang.xpath.impl;
+
+import org.eclipse.jdt.annotation.NonNullByDefault;
+import org.osgi.service.component.annotations.RequireServiceComponentRuntime;
\ No newline at end of file