Details
-
Bug
-
Status: Resolved
-
Resolution: Done
-
Helium
-
None
-
None
-
Operating System: Linux
Platform: PC
-
852
Description
The *Module and *ModuleFactory source files that are generated by the yang-maven-plugin are put under src/main/java. Normally, these files are meant to be permanent (unless manually deleted) but the ones in yang-test aren't because the intent is to re-generate them on each build for testing so there is a yang-test maven plugin that deletes the source files before building. They actually are checked into Git but probably by accident.
The yang-test maven plugin also inserts implementation code into the files after their generated. This should result in the files being the same on each build so git doesn't see them as changed but the code generator inserts a new time stamp into the files each time they're generated so git does see them as changed. This seems to be a recent change as it wasn't happening before.
Instead of generating the files under src/main/java we should generate them under the git-ignored src/main/yang-config. The yangtools CodeGeneratorImpl class allows you to specify a "persistentSourceDir" that overrides the default src/main/java for "persistent" files. We should add this to the JMXGenerator as well.
In addition, the ProcessSources class which rewrites the stub methods with implementation code needs to look in src/main/yang-config.