summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJan Srnicek <jsrnicek@cisco.com>2017-06-30 12:05:16 +0200
committerMarek Gradzki <mgradzki@cisco.com>2017-06-30 19:47:18 +0000
commit31f619b9e733bd3c88d77af1c0fc38258b8623de (patch)
tree587399839b6986b6c504cb0e22595d293ff1cab9
parent81bf9a87bbce001f20ba79bad10b40e918f79b4b (diff)
HONEYCOMB-358 - Generate guice to yang modules index
Generates two descriptor files yang-modules-binding/yang-modules - List of Yang modules by project(classpath + deps) yang-mapping/FULL_PROJECT_NAME-yang-modules-index - Index from Guice modules to Yang modules that are used by respective Guice module These files are included in jar files and distribution resources Change-Id: I44569b3bc8819a5facd7ba8424836f715012c04d Signed-off-by: Jan Srnicek <jsrnicek@cisco.com>
-rw-r--r--common/impl-parent/pom.xml78
-rw-r--r--common/minimal-distribution-parent/pom.xml32
2 files changed, 93 insertions, 17 deletions
diff --git a/common/impl-parent/pom.xml b/common/impl-parent/pom.xml
index f8141eef8..2d9984247 100644
--- a/common/impl-parent/pom.xml
+++ b/common/impl-parent/pom.xml
@@ -29,4 +29,82 @@
</dependency>
</dependencies>
</dependencyManagement>
+
+ <build>
+ <pluginManagement>
+ <plugins>
+ <!-- Must be done impl parent, to unpack jars for all projects that we generate yang module index for.
+ Extracted /lib folder is used while generating yang-module-index -->
+ <!-- Copy all dependencies -->
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-dependency-plugin</artifactId>
+ <version>2.10</version>
+ <executions>
+ <execution>
+ <id>copy-dependencies</id>
+ <phase>process-sources</phase>
+ <goals>
+ <goal>copy-dependencies</goal>
+ </goals>
+ <configuration>
+ <outputDirectory>${project.build.directory}/lib</outputDirectory>
+ <useBaseVersion>true</useBaseVersion>
+ <useRepositoryLayout>true</useRepositoryLayout>
+ <excludeArtifactIds>yang-jmx-generator,test-api</excludeArtifactIds>
+ </configuration>
+ </execution>
+ </executions>
+ </plugin>
+ <!-- Generate module to yang provider index -->
+ <plugin>
+ <groupId>org.codehaus.gmaven</groupId>
+ <artifactId>groovy-maven-plugin</artifactId>
+ <executions>
+ <execution>
+ <id>generate-yang-index</id>
+ <phase>generate-resources</phase>
+ <goals>
+ <goal>execute</goal>
+ </goals>
+ <configuration>
+ <source>
+ io.fd.honeycomb.common.scripts.ModuleYangIndexGenerator.generateIndexForPresentModules(project, log)
+ </source>
+ </configuration>
+ </execution>
+ </executions>
+ <dependencies>
+ <dependency>
+ <groupId>io.fd.honeycomb.common</groupId>
+ <artifactId>common-scripts</artifactId>
+ <version>${project.version}</version>
+ </dependency>
+ </dependencies>
+ </plugin>
+ </plugins>
+ </pluginManagement>
+
+ <plugins>
+ <plugin>
+ <groupId>org.codehaus.gmaven</groupId>
+ <artifactId>groovy-maven-plugin</artifactId>
+ </plugin>
+ </plugins>
+
+ <resources>
+ <resource>
+ <directory>src/main/resources</directory>
+ <includes>
+ <include>**/*</include>
+ </includes>
+ </resource>
+ <resource>
+ <directory>${project.build.outputDirectory}</directory>
+ <includes>
+ <include>**/yang-modules-binding/yang-modules</include>
+ </includes>
+ </resource>
+ </resources>
+ </build>
</project> \ No newline at end of file
diff --git a/common/minimal-distribution-parent/pom.xml b/common/minimal-distribution-parent/pom.xml
index 1f2a5add7..00aac6785 100644
--- a/common/minimal-distribution-parent/pom.xml
+++ b/common/minimal-distribution-parent/pom.xml
@@ -6,9 +6,9 @@
<parent>
<groupId>io.fd.hc2vpp.common</groupId>
- <artifactId>hc2vpp-parent</artifactId>
+ <artifactId>impl-parent</artifactId>
<version>1.17.07-SNAPSHOT</version>
- <relativePath>../hc2vpp-parent</relativePath>
+ <relativePath>../impl-parent</relativePath>
</parent>
<groupId>io.fd.hc2vpp.common</groupId>
@@ -55,32 +55,18 @@
<classpathMavenRepositoryLayout>true</classpathMavenRepositoryLayout>
</manifest>
<manifestEntries>
- <Class-Path>config/ cert/ modules/</Class-Path>
+ <Class-Path>config/ cert/ modules/ yang-mapping/</Class-Path>
</manifestEntries>
</archive>
</configuration>
</plugin>
- <!-- Copy all dependencies -->
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-dependency-plugin</artifactId>
<version>2.10</version>
<executions>
<execution>
- <id>copy-dependencies</id>
- <phase>package</phase>
- <goals>
- <goal>copy-dependencies</goal>
- </goals>
- <configuration>
- <outputDirectory>${project.build.directory}/lib</outputDirectory>
- <useBaseVersion>true</useBaseVersion>
- <useRepositoryLayout>true</useRepositoryLayout>
- <excludeArtifactIds>yang-jmx-generator</excludeArtifactIds>
- </configuration>
- </execution>
- <execution>
<id>unpack-configuration</id>
<phase>prepare-package</phase>
<goals>
@@ -126,6 +112,18 @@
</source>
</configuration>
</execution>
+ <execution>
+ <id>generate-module-to-yang-index</id>
+ <phase>prepare-package</phase>
+ <goals>
+ <goal>execute</goal>
+ </goals>
+ <configuration>
+ <source>
+ io.fd.honeycomb.common.scripts.ModuleYangIndexGenerator.pairDistributionModulesWithYangModules(project, log)
+ </source>
+ </configuration>
+ </execution>
</executions>
<dependencies>
<dependency>