Capture effective configuration 11/104611/1
authorRobert Varga <robert.varga@pantheon.tech>
Sun, 26 Feb 2023 19:53:53 +0000 (20:53 +0100)
committerRobert Varga <robert.varga@pantheon.tech>
Sun, 26 Feb 2023 19:55:53 +0000 (20:55 +0100)
We are filling in missing and ignoring unreferenced configurations,
make sure we capture the effective configuration.

JIRA: YANGTOOLS-1490
Change-Id: I24c14cecb4c19b9948b03d4b7ced485bd14b4e70
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
plugin/yang-maven-plugin/src/main/java/org/opendaylight/yangtools/yang2sources/plugin/GeneratorTaskFactory.java
plugin/yang-maven-plugin/src/main/java/org/opendaylight/yangtools/yang2sources/plugin/YangToSourcesProcessor.java

index ea5eed89a7e584d130a16ef82a4e631f37c53373..a14af78a9cdaa64d02edff072abf27073927b4c0 100644 (file)
@@ -47,6 +47,10 @@ final class GeneratorTaskFactory extends ParserConfigAware implements Identifiab
         return parserConfig;
     }
 
+    FileGeneratorArg arg() {
+        return arg;
+    }
+
     FileGenerator generator() {
         return gen;
     }
index 1863cc53965c51118f3f677ea3fec6d6125fe3fd..b0f7be018a969df8013028a4831b9550159d2e04 100644 (file)
@@ -245,7 +245,9 @@ class YangToSourcesProcessor {
         }
 
         // FIXME: store these files into state, so that we can verify/clean up
-        final var outputState = new YangToSourcesState(fileGeneratorArgs,
+        final var outputState = new YangToSourcesState(
+            codeGenerators.stream()
+                .collect(ImmutableMap.toImmutableMap(GeneratorTaskFactory::getIdentifier, GeneratorTaskFactory::arg)),
             new FileStateSet(ImmutableMap.copyOf(uniqueOutputFiles)));
         buildContext.setValue(BUILD_CONTEXT_STATE_NAME, outputState);
         if (buildContext.getValue(BUILD_CONTEXT_STATE_NAME) == null) {