2025-06-04 15:19:35 +00:00
|
|
|
From bd8485edf7adec243890deaaeb20f45bd539e8b9 Mon Sep 17 00:00:00 2001
|
2025-03-16 20:24:53 +00:00
|
|
|
From: =?UTF-8?q?Fridrich=20=C5=A0trba?= <fridrich.strba@bluewin.ch>
|
|
|
|
Date: Sat, 15 Mar 2025 08:04:34 +0100
|
2025-06-04 15:19:35 +00:00
|
|
|
Subject: [PATCH 2/2] Handle also the velocity stuff in ModelloCli
|
2025-03-16 20:24:53 +00:00
|
|
|
|
|
|
|
---
|
|
|
|
.../java/org/codehaus/modello/ModelloCli.java | 22 +++++++++++++++++--
|
|
|
|
1 file changed, 20 insertions(+), 2 deletions(-)
|
|
|
|
|
|
|
|
diff --git a/modello-core/src/main/java/org/codehaus/modello/ModelloCli.java b/modello-core/src/main/java/org/codehaus/modello/ModelloCli.java
|
2025-06-04 15:19:35 +00:00
|
|
|
index db40052ce..7bed3863a 100644
|
2025-03-16 20:24:53 +00:00
|
|
|
--- a/modello-core/src/main/java/org/codehaus/modello/ModelloCli.java
|
|
|
|
+++ b/modello-core/src/main/java/org/codehaus/modello/ModelloCli.java
|
|
|
|
@@ -23,8 +23,10 @@ package org.codehaus.modello;
|
|
|
|
*/
|
|
|
|
|
|
|
|
import java.io.File;
|
|
|
|
+import java.util.Arrays;
|
|
|
|
import java.util.HashMap;
|
|
|
|
import java.util.Map;
|
|
|
|
+import java.util.stream.Collectors;
|
|
|
|
|
|
|
|
import org.codehaus.plexus.util.StringUtils;
|
|
|
|
import org.codehaus.plexus.util.xml.XmlStreamReader;
|
|
|
|
@@ -124,6 +126,21 @@ public class ModelloCli {
|
|
|
|
if (args.length > 7) {
|
|
|
|
parameters.put(ModelloParameterConstants.DOM_AS_XPP3, args[7]);
|
|
|
|
}
|
|
|
|
+
|
2025-06-06 19:34:29 +00:00
|
|
|
+ if (args.length > 8 && StringUtils.equalsIgnoreCase(outputType, "velocity")) {
|
2025-03-16 20:24:53 +00:00
|
|
|
+ parameters.put("modello.velocity.basedir", args[8]);
|
|
|
|
+ }
|
|
|
|
+
|
2025-06-06 19:34:29 +00:00
|
|
|
+ if (args.length > 9 && StringUtils.equalsIgnoreCase(outputType, "velocity")) {
|
2025-03-16 20:24:53 +00:00
|
|
|
+ parameters.put("modello.velocity.templates", args[9]);
|
|
|
|
+ }
|
|
|
|
+
|
2025-06-06 19:34:29 +00:00
|
|
|
+ if (args.length > 10 && StringUtils.equalsIgnoreCase(outputType, "velocity")) {
|
2025-03-16 20:24:53 +00:00
|
|
|
+ parameters.put(
|
|
|
|
+ "modello.velocity.parameters", (HashMap<String, String>) Arrays.asList(args[10].split(",")).stream()
|
|
|
|
+ .map(s -> s.split("="))
|
|
|
|
+ .collect(Collectors.toMap(e -> e[0], e -> e[1])));
|
|
|
|
+ }
|
|
|
|
}
|
|
|
|
|
|
|
|
// ----------------------------------------------------------------------
|
|
|
|
@@ -131,7 +148,8 @@ public class ModelloCli {
|
|
|
|
// ----------------------------------------------------------------------
|
|
|
|
|
|
|
|
private static void usage() {
|
|
|
|
- System.err.println("Usage: modello <model> <outputType> <output directory> <modelVersion> <packageWithVersion>"
|
|
|
|
- + " <javaSource> [<encoding> [<domAsXpp3>]]");
|
|
|
|
+ System.err.println(
|
|
|
|
+ "Usage: modello <model> <outputType> <output directory> <modelVersion> <packageWithVersion>"
|
|
|
|
+ + " <javaSource> [<encoding> [<domAsXpp3> [<velocityBaseDir> <velocityTemplates> <velocityParameters>]]] ");
|
|
|
|
}
|
|
|
|
}
|
|
|
|
--
|
2025-06-04 15:19:35 +00:00
|
|
|
2.49.0
|
2025-03-16 20:24:53 +00:00
|
|
|
|