Add property "yang.skip"
[yangtools.git] / yang / yang-maven-plugin / src / main / java / org / opendaylight / yangtools / yang2sources / plugin / YangToSourcesProcessor.java
index 4140e01173499df86fe8b6d74df828a236c33113..c1a1cbea9860cf446c35cf95c932f94080d119fb 100644 (file)
@@ -97,6 +97,14 @@ class YangToSourcesProcessor {
         }
     }
 
+    void conditionalExecute(boolean skip) throws MojoExecutionException, MojoFailureException {
+        if (skip) {
+            LOG.info("Skipping YANG code generation because property yang.skip is true");
+        } else {
+            execute();
+        }
+    }
+
     private ContextHolder processYang() throws MojoExecutionException {
         final CrossSourceStatementReactor.BuildAction reactor = YangInferencePipeline.RFC6020_REACTOR.newBuild();
         SchemaContext resolveSchemaContext;