Enable binding-test-model build 41/112241/2
authorRobert Varga <robert.varga@pantheon.tech>
Thu, 20 Jun 2024 15:35:48 +0000 (17:35 +0200)
committerRobert Varga <robert.varga@pantheon.tech>
Thu, 20 Jun 2024 21:11:20 +0000 (23:11 +0200)
The test model requires yang-ext for now for the augment-identifier
extension. Add both to the build.

JIRA: YANGTOOLS-1576
Change-Id: I9d0aaa3a2792a1f0a07acfda334c6adae80e98f2
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
artifacts/pom.xml
binding/binding-test-model/pom.xml
binding/pom.xml
binding/yang-ext/pom.xml [new file with mode: 0644]
binding/yang-ext/src/main/yang/yang-ext.yang [new file with mode: 0644]

index b5c37e045ebdc14c0a70e85c6243864017ab3c4f..bbf85490a53b626163639bd17d928ae9358d683f 100644 (file)
                 <artifactId>binding-runtime-spi</artifactId>
                 <version>14.0.0-SNAPSHOT</version>
             </dependency-->
-            <!--dependency>
+            <dependency>
                 <groupId>org.opendaylight.yangtools</groupId>
                 <artifactId>binding-test-model</artifactId>
                 <version>14.0.0-SNAPSHOT</version>
-            </dependency-->
+                <scope>test</scope>
+            </dependency>
             <dependency>
                 <groupId>org.opendaylight.yangtools</groupId>
                 <artifactId>binding-util</artifactId>
                 <version>14.0.0-SNAPSHOT</version>
             </dependency>
+            <dependency>
+                <groupId>org.opendaylight.yangtools</groupId>
+                <artifactId>yang-ext</artifactId>
+                <version>14.0.0-SNAPSHOT</version>
+            </dependency>
 
             <!-- Test utilities, not packaged in features -->
             <dependency>
index 00c3c19daf865e50f3fc6883b335d3ed8bf5f482..325a1c5245cfccacb24770b6a7d16d02ce57d1df 100644 (file)
             <groupId>com.google.guava</groupId>
             <artifactId>guava</artifactId>
         </dependency>
+        <dependency>
+            <groupId>org.kohsuke.metainf-services</groupId>
+            <artifactId>metainf-services</artifactId>
+        </dependency>
         <dependency>
             <groupId>org.opendaylight.yangtools</groupId>
             <artifactId>yang-common</artifactId>
         </dependency>
         <dependency>
-            <groupId>org.opendaylight.yangtools.model</groupId>
+            <groupId>org.opendaylight.yangtools</groupId>
             <artifactId>yang-ext</artifactId>
         </dependency>
-        <dependency>
-            <groupId>org.kohsuke.metainf-services</groupId>
-            <artifactId>metainf-services</artifactId>
-        </dependency>
 
         <dependency>
             <groupId>org.junit.jupiter</groupId>
index beeb34c7a1baea462942126d78a43850fa4d8506..e915ff70bde53a8501d3f4b090766b92d428fa75 100644 (file)
@@ -43,7 +43,8 @@
         <module>binding-runtime-dynamic</module>
         <!--module>binding-runtime-osgi</module-->
         <!--module>binding-runtime-spi</module-->
-        <!--module>binding-test-model</module-->
+        <module>binding-test-model</module>
         <module>binding-util</module>
+        <module>yang-ext</module>
     </modules>
 </project>
diff --git a/binding/yang-ext/pom.xml b/binding/yang-ext/pom.xml
new file mode 100644 (file)
index 0000000..c061837
--- /dev/null
@@ -0,0 +1,38 @@
+<?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>binding-parent</artifactId>
+        <version>14.0.0-SNAPSHOT</version>
+        <relativePath>../binding-parent</relativePath>
+    </parent>
+
+    <groupId>org.opendaylight.yangtools</groupId>
+    <artifactId>yang-ext</artifactId>
+    <name>${project.artifactId}</name>
+    <packaging>bundle</packaging>
+    <description>Legacy MD-SAL YANG extensions</description>
+
+    <build>
+        <plugins>
+            <plugin>
+                <groupId>org.apache.felix</groupId>
+                <artifactId>maven-bundle-plugin</artifactId>
+                <configuration>
+                    <instructions>
+                        <Automatic-Module-Name>org.opendaylight.mdsal.model.yang.ext</Automatic-Module-Name>
+                    </instructions>
+                </configuration>
+            </plugin>
+        </plugins>
+    </build>
+</project>
diff --git a/binding/yang-ext/src/main/yang/yang-ext.yang b/binding/yang-ext/src/main/yang/yang-ext.yang
new file mode 100644 (file)
index 0000000..f53148a
--- /dev/null
@@ -0,0 +1,113 @@
+module yang-ext {
+    yang-version 1;
+    namespace "urn:opendaylight:yang:extension:yang-ext";
+    prefix "ext";
+
+    contact "Anton Tkacik <ttkacik@cisco.com>";
+
+    description
+            "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";
+
+    revision "2013-07-09" {
+        description "";
+    }
+
+    // Augmentation name
+
+    extension "augment-identifier" {
+        description
+           "YANG language extension which assigns an identifier to
+            augmentation. Augment identifier is used to identify
+            specific augment statement by name.
+
+            The identifier syntax is defined formally defined by the rule
+            'identifier' in Section 12 of RFC 6020.
+
+            All augment identifiers defined in a namespace MUST be unique.
+            The namespace of augment identifiers is shared by module and
+            its submodules.";
+
+            /*
+                Discussion:
+                This extension allows for ease of development / debug
+                of YANG modules and it is suitable for code generation,
+                where each augment statement is nicely identified by
+                unique name instead of combination of augment target
+                and when condition.
+            */
+        argument "identifier";
+    }
+
+    // Mount point marker
+
+    extension mount {
+        description
+           "YANG language extension which marks a place where a semantic mount
+            point can be present. This extension can only be used in a container or
+            a list statement, for example:
+
+              module foo {
+                container foo {
+                  leaf bar {
+                    type string;
+                  }
+
+                  ext:mount;
+                }
+              }
+
+            In this example, container foo can contain a local leaf bar and some
+            mounted data. From addressing perspective, the extension use acts as
+            a container with yang-ext's namespace, i.e. it looks as though as this
+            (yang-ext) module contained the following construct:
+
+              import foo { prefix foo; }
+
+              augment /foo:foo {
+                container mount;
+              }
+
+            From data lifecycle perspective, this container should never be
+            automatically included in the datastore content for 'container foo', unless
+            specifically explicitly requested.";
+    }
+
+    // Context-aware RPCs
+
+    grouping rpc-context-ref {
+        description
+           "A reference to RPC context.";
+        leaf context-instance {
+            type instance-identifier;
+            description "Pointer to the context. ";
+            mandatory true;
+        }
+    }
+
+    extension "rpc-context-instance" {
+        description
+           "YANG language extension which defines enclosing (parent)
+            schema node as referencable context for RPCs.
+
+            The argument is identity which is used to identify RPC context
+            type.";
+
+        argument "context-type";
+    }
+
+    extension "context-reference" {
+        argument "context-type";
+    }
+
+    extension "context-instance" {
+        argument "context-type";
+    }
+
+    extension "instance-target" {
+        argument "path";
+    }
+}