Bug 8739: Autogenerate date for yang in archetype
[controller.git] / opendaylight / archetypes / opendaylight-startup / src / main / resources / archetype-resources / api / src / main / yang / __artifactId__.yang
index e46446981c38089e62dc4707a04f1b2b534d5f95..a2e2108c3c1e5ddff69c8faccb91d6357983dbcb 100644 (file)
@@ -1,9 +1,12 @@
+#set( $ldt = $package.getClass().forName("java.time.LocalDateTime").getMethod("now").invoke(null) )
+#set( $dtf = $package.getClass().forName("java.time.format.DateTimeFormatter").getMethod("ofPattern", $package.getClass()).invoke(null, "yyyy-MM-dd") )
+#set( $date = $ldt.format($dtf) )
 module ${artifactId} {
     yang-version 1;
     namespace "urn:opendaylight:params:xml:ns:yang:${artifactId}";
     prefix "${artifactId}";
 
-    revision "2015-01-05" {
+    revision "${date}" {
         description "Initial revision of ${artifactId} model";
     }
 }