Skip to content

Commit

Permalink
[zenwave-sdk-cli] adds ConfigurationProvider to support configuration…
Browse files Browse the repository at this point in the history
… from zdl files
  • Loading branch information
ivangsa committed Nov 22, 2024
1 parent 5a4d231 commit 91f101c
Show file tree
Hide file tree
Showing 7 changed files with 11 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ config {
title "ZenWave Playground Customer-Address MariaDB"
basePackage "io.zenwave360.example"
persistence jpa
databaseType mariadb
databaseType postgresql
// haltOnFailFormatting false

plugins {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
<spring-boot.version>${project.parent.version}</spring-boot.version>
<spring-cloud.version>2022.0.4</spring-cloud.version>

<zenwave.version>1.6.0</zenwave.version>
<zenwave.version>1.7.0-SNAPSHOT</zenwave.version>

<jakarta.validation-api.version>3.0.2</jakarta.validation-api.version>
<mapstruct.version>1.5.3.Final</mapstruct.version>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
<spring-boot.version>${project.parent.version}</spring-boot.version>
<spring-cloud.version>2022.0.4</spring-cloud.version>

<zenwave.version>1.6.0</zenwave.version>
<zenwave.version>1.7.0-SNAPSHOT</zenwave.version>

<jakarta.validation-api.version>3.0.2</jakarta.validation-api.version>
<mapstruct.version>1.5.3.Final</mapstruct.version>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
<spring-cloud.version>2022.0.4</spring-cloud.version>
<spring-modulith-bom.version>1.1.1</spring-modulith-bom.version>

<zenwave.version>1.6.0</zenwave.version>
<zenwave.version>1.7.0-SNAPSHOT</zenwave.version>

<jakarta.validation-api.version>3.0.2</jakarta.validation-api.version>
<mapstruct.version>1.5.3.Final</mapstruct.version>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
<spring-boot.version>${project.parent.version}</spring-boot.version>
<spring-cloud.version>2022.0.4</spring-cloud.version>

<zenwave.version>1.6.0</zenwave.version>
<zenwave.version>1.7.0-SNAPSHOT</zenwave.version>

<jakarta.validation-api.version>3.0.2</jakarta.validation-api.version>
<mapstruct.version>1.5.3.Final</mapstruct.version>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,9 @@ public void updateConfiguration(Plugin configuration, Map<String, Object> model)
var zdl = model.get(targetProperty);
var config = JSONPath.get(zdl, "$.config", Map.<String, Object>of());
for (var entry : config.entrySet()) {
configuration.withOption(entry.getKey(), entry.getValue());
if(!configuration.getOptions().containsKey(entry.getKey())) {
configuration.withOption(entry.getKey(), entry.getValue());
}
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -39,13 +39,13 @@ public class GeneratorMojo extends AbstractMojo {
/**
* Location of the ZDL model, as URL or file.
*/
@Parameter(name = "zdlFile", property = "zenwave.zdlFile", required = true)
@Parameter(name = "zdlFile", property = "zenwave.zdlFile")
private String zdlFile;

/**
* Location of the ZDL model, as URL or file.
*/
@Parameter(name = "zdlFiles", property = "zenwave.zdlFiles", required = true)
@Parameter(name = "zdlFiles", property = "zenwave.zdlFiles")
private String[] zdlFiles;


Expand Down Expand Up @@ -127,6 +127,7 @@ public void execute() throws MojoExecutionException {
}
if(apiFile.endsWith(".zdl") && !zdls.contains(apiFile)) {
zdls.add(apiFile);
apiFile = null;
}
if(zdlFiles != null) {
zdls.addAll(Arrays.asList(zdlFiles));
Expand Down

0 comments on commit 91f101c

Please sign in to comment.