Skip to content

Commit

Permalink
update readme
Browse files Browse the repository at this point in the history
  • Loading branch information
airlenet committed Aug 12, 2020
1 parent b2507f0 commit 2c71348
Showing 1 changed file with 43 additions and 54 deletions.
97 changes: 43 additions & 54 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,10 +1,14 @@
# play-yang
Play Yang based on JNC,and a plugin for pyang to generate Java classes from YANG models.
# yang-maven-plugin
Yang file is parsed by Java antlr4; Yang file is parsed by java code and JNC code is generated.
Its principle is based on JNC and onos-yang-tools


Reference
[JNC](https://github.com/tail-f-systems/JNC)
[pyang](https://github.com/mbj4668/pyang)
# play-jnc
[antlr](https://www.antlr.org/)
[onos-yang-tools](https://github.com/opennetworkinglab/onos-yang-tools)
# yang-jnc
Modify based on [JNC](https://github.com/tail-f-systems/JNC)

# yang-maven-plugin
Expand All @@ -20,10 +24,6 @@ Download [the latest JAR](https://search.maven.org/remote_content?g=com.airlenet
<version>LATEST</version>
</dependency>
```
or Gradle:
```groovy
compile 'com.airlenet.yang:yang-maven-plugin:LATEST'
```

Snapshots of the development version are available in [Sonatype's `snapshots` repository](https://oss.sonatype.org/content/repositories/snapshots/com/airlenet/yang/yang-maven-plugin).

Expand All @@ -37,68 +37,57 @@ Usage
<artifactId>yang-maven-plugin</artifactId>
<version>2.0.0-SNAPSHOT</version>
<configuration>
<skip>false</skip>
<showWarnings>false</showWarnings>
<errorAbort>false</errorAbort>
<excludes>
<exclude>tailf/*.yang</exclude>
<exclude>ietf/*.yang</exclude>
<exclude>iana/*.yang</exclude>
</excludes>
<yangFilesDir>src/main/yang</yangFilesDir>
<packageName>com.test.yang.model.gen</packageName>
<classFileDir>src/main/java</classFileDir>
</configuration>
<executions>
<execution>
<id>process</id>
<id>default</id>
<goals>
<goal>process</goal>
<goal>yang2java</goal>
</goals>
<configuration>
<outputDirectory>target/generated-sources/java</outputDirectory><!-- src/main/java -->
<packageName>com.airlenet.yang.model</packageName>
</configuration>
</execution>
</executions>
</plugin>
<!-- add source resource: java class & resource -->
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>build-helper-maven-plugin</artifactId>
<version>1.7</version>
<executions>
<execution>
<id>add-source</id>
<phase>generate-sources</phase>
<goals>
<goal>add-source</goal>
</goals>
<configuration>
<sources>
<source>target/generated-sources/java</source>
</sources>
</configuration>
</execution>
<execution>
<id>add-resource</id>
<phase>generate-resources</phase>
<goals>
<goal>add-resource</goal>
</goals>
<configuration>
<resources>
<resource>
<directory>target/generated-sources/java</directory>
</resource>
</resources>
</configuration>
</execution>
</executions>
<groupId>org.codehaus.mojo</groupId>
<artifactId>build-helper-maven-plugin</artifactId>
<version>1.7</version>
<executions>
<execution>
<id>add-source</id>
<phase>generate-sources</phase>
<goals>
<goal>add-source</goal>
</goals>
<configuration>
<sources>
<source>target/generated-sources/java</source>
</sources>
</configuration>
</execution>
<execution>
<id>add-resource</id>
<phase>generate-resources</phase>
<goals>
<goal>add-resource</goal>
</goals>
<configuration>
<resources>
<resource>
<directory>target/generated-sources/java</directory>
</resource>
</resources>
</configuration>
</execution>
</executions>
</plugin>
</plugins>
```
```
mvn package # generator java class from yang model,compile,package
mvn yang:validate # validate yang model
```
[yang-example](https://github.com/airshiplay/play-yang/tree/master/yang-example)

Expand Down

0 comments on commit 2c71348

Please sign in to comment.