This is an automated email from the ASF dual-hosted git repository.

cdutz pushed a commit to branch develop
in repository https://gitbox.apache.org/repos/asf/plc4x-build-tools.git


The following commit(s) were added to refs/heads/develop by this push:
     new f975c75  feat: Added a 'skip' option to the code-generation goal.
f975c75 is described below

commit f975c7562f0079968d98578f550ecf4d53e44a38
Author: Christofer Dutz <[email protected]>
AuthorDate: Sat Oct 14 11:39:03 2023 +0200

    feat: Added a 'skip' option to the code-generation goal.
---
 .../org/apache/plc4x/plugins/codegenerator/GenerateMojo.java | 12 ++++++++++++
 1 file changed, 12 insertions(+)

diff --git 
a/code-generation/plc4x-maven-plugin/src/main/java/org/apache/plc4x/plugins/codegenerator/GenerateMojo.java
 
b/code-generation/plc4x-maven-plugin/src/main/java/org/apache/plc4x/plugins/codegenerator/GenerateMojo.java
index c2e7742..8b801ae 100644
--- 
a/code-generation/plc4x-maven-plugin/src/main/java/org/apache/plc4x/plugins/codegenerator/GenerateMojo.java
+++ 
b/code-generation/plc4x-maven-plugin/src/main/java/org/apache/plc4x/plugins/codegenerator/GenerateMojo.java
@@ -50,6 +50,13 @@ public class GenerateMojo extends AbstractMojo {
     @Parameter(defaultValue = "${project}", readonly = true, required = true)
     private MavenProject project;
 
+    /**
+     * Tells the plugin, if we should skip code-generation.
+     * (Required for reproducible builds)
+     */
+    @Parameter(defaultValue = "false", required = false)
+    private boolean skip;
+
     /**
      * Where to generate the code.
      */
@@ -90,6 +97,11 @@ public class GenerateMojo extends AbstractMojo {
     public void execute()
             throws MojoExecutionException {
 
+        if(skip) {
+            getLog().info("Skipping code-generation as 'skip' was set to 
'true'.");
+            return;
+        }
+
         // Make sure the output directory exists.
         if (!outputDir.exists()) {
             if (!outputDir.mkdirs()) {

Reply via email to