File 0003-Add-support-for-domAsXpp3-and-fail-if-the-old-Java5-.patch of Package modello

From c692c46aa1898e80c225aaf99724207bd98d5bf7 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Fridrich=20=C5=A0trba?= <fridrich.strba@bluewin.ch>
Date: Fri, 12 Apr 2024 09:37:47 +0200
Subject: [PATCH 3/3] Add support for domAsXpp3 and fail if the old Java5
 parameter is used

---
 .../java/org/codehaus/modello/ModelloCli.java     | 15 ++++++++++++++-
 1 file changed, 14 insertions(+), 1 deletion(-)

diff --git a/modello-core/src/main/java/org/codehaus/modello/ModelloCli.java b/modello-core/src/main/java/org/codehaus/modello/ModelloCli.java
index a75e4011..db40052c 100644
--- a/modello-core/src/main/java/org/codehaus/modello/ModelloCli.java
+++ b/modello-core/src/main/java/org/codehaus/modello/ModelloCli.java
@@ -106,11 +106,24 @@ public class ModelloCli {
             System.exit(1);
         }
 
+        if (StringUtils.equalsIgnoreCase(javaSource, "true") || StringUtils.equalsIgnoreCase(javaSource, "false")) {
+            // The old useJava5 parameter at this position
+            System.err.println("Missing required parameter: Java Source (replacing the old \"Use Java5\" parameter)");
+
+            usage();
+
+            System.exit(1);
+        }
+
         parameters.put(ModelloParameterConstants.OUTPUT_JAVA_SOURCE, javaSource);
 
         if (args.length > 6) {
             parameters.put(ModelloParameterConstants.ENCODING, args[6]);
         }
+
+        if (args.length > 7) {
+            parameters.put(ModelloParameterConstants.DOM_AS_XPP3, args[7]);
+        }
     }
 
     // ----------------------------------------------------------------------
@@ -119,6 +132,6 @@ public class ModelloCli {
 
     private static void usage() {
         System.err.println("Usage: modello <model> <outputType> <output directory> <modelVersion> <packageWithVersion>"
-                + "<javaSource> [<encoding>]");
+                + " <javaSource> [<encoding> [<domAsXpp3>]]");
     }
 }
-- 
2.45.1

openSUSE Build Service is sponsored by