You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@plc4x.apache.org by cd...@apache.org on 2022/06/09 15:43:55 UTC
[plc4x-build-tools] branch develop updated: chore(code-gen): Added the "version" of the maven project to the code-generation context.
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 0f4aaa1 chore(code-gen): Added the "version" of the maven project to the code-generation context.
0f4aaa1 is described below
commit 0f4aaa10fac7f5eec74209717db25b1755160cae
Author: cdutz <ch...@c-ware.de>
AuthorDate: Thu Jun 9 17:43:36 2022 +0200
chore(code-gen): Added the "version" of the maven project to the code-generation context.
---
.../apache/plc4x/plugins/codegenerator/language/LanguageOutput.java | 2 +-
.../main/java/org/apache/plc4x/plugins/codegenerator/GenerateMojo.java | 3 +--
2 files changed, 2 insertions(+), 3 deletions(-)
diff --git a/code-generation/language-base/src/main/java/org/apache/plc4x/plugins/codegenerator/language/LanguageOutput.java b/code-generation/language-base/src/main/java/org/apache/plc4x/plugins/codegenerator/language/LanguageOutput.java
index 14fb2d0..1566d17 100644
--- a/code-generation/language-base/src/main/java/org/apache/plc4x/plugins/codegenerator/language/LanguageOutput.java
+++ b/code-generation/language-base/src/main/java/org/apache/plc4x/plugins/codegenerator/language/LanguageOutput.java
@@ -45,7 +45,7 @@ public interface LanguageOutput {
*/
Set<String> supportedOptions();
- void generate(File outputDir, String languageName, String protocolName, String outputFlavor, Map<String, TypeDefinition> types,
+ void generate(File outputDir, String version, String languageName, String protocolName, String outputFlavor, Map<String, TypeDefinition> types,
Map<String, String> options)
throws GenerationException;
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 0d06099..6005ce1 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
@@ -168,9 +168,8 @@ public class GenerateMojo extends AbstractMojo {
}
}
}
-
// Generate output for the type definitions.
- language.generate(outputDir, languageName, protocolName, outputFlavor, types, options == null ? Collections.emptyMap() : options);
+ language.generate(outputDir, project.getVersion(), languageName, protocolName, outputFlavor, types, options == null ? Collections.emptyMap() : options);
} catch (GenerationException e) {
throw new MojoExecutionException("Error generating sources", e);
}