This commit is contained in:
parent
0354bc3b7e
commit
e7eacc8ca8
@ -1,7 +1,7 @@
|
||||
From 90352d3cd8de0382be73d5ce16b5f9d96469e39c Mon Sep 17 00:00:00 2001
|
||||
From cc800846da128d795c69142d4ae0c33c0677e943 Mon Sep 17 00:00:00 2001
|
||||
From: =?UTF-8?q?Fridrich=20=C5=A0trba?= <fridrich.strba@bluewin.ch>
|
||||
Date: Sat, 13 Apr 2024 15:14:24 +0200
|
||||
Subject: [PATCH] Fix ModelloCli after moving from Plexus to JSR330
|
||||
Subject: [PATCH 1/3] Fix ModelloCli after moving from Plexus to JSR330
|
||||
|
||||
---
|
||||
.../java/org/codehaus/modello/Modello.java | 26 ++++++++++++++-----
|
||||
@ -9,7 +9,7 @@ Subject: [PATCH] Fix ModelloCli after moving from Plexus to JSR330
|
||||
2 files changed, 21 insertions(+), 8 deletions(-)
|
||||
|
||||
diff --git a/modello-core/src/main/java/org/codehaus/modello/Modello.java b/modello-core/src/main/java/org/codehaus/modello/Modello.java
|
||||
index 2b73884f..9e3f8072 100644
|
||||
index 00fb7114..0572fce6 100644
|
||||
--- a/modello-core/src/main/java/org/codehaus/modello/Modello.java
|
||||
+++ b/modello-core/src/main/java/org/codehaus/modello/Modello.java
|
||||
@@ -22,8 +22,6 @@ package org.codehaus.modello;
|
||||
@ -20,8 +20,8 @@ index 2b73884f..9e3f8072 100644
|
||||
-
|
||||
import java.io.Reader;
|
||||
import java.io.Writer;
|
||||
import java.util.Properties;
|
||||
@@ -31,17 +29,33 @@ import java.util.Properties;
|
||||
import java.util.Map;
|
||||
@@ -31,17 +29,33 @@ import java.util.Map;
|
||||
import org.codehaus.modello.core.ModelloCore;
|
||||
import org.codehaus.modello.model.Model;
|
||||
import org.codehaus.modello.model.ModelValidationException;
|
||||
@ -58,21 +58,21 @@ index 2b73884f..9e3f8072 100644
|
||||
+ }
|
||||
}
|
||||
|
||||
public void generate(Reader modelReader, String outputType, Properties parameters)
|
||||
public void generate(Reader modelReader, String outputType, Map<String, Object> parameters)
|
||||
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 ba8f029f..e9c9e079 100644
|
||||
index 1b4cd974..a75e4011 100644
|
||||
--- a/modello-core/src/main/java/org/codehaus/modello/ModelloCli.java
|
||||
+++ b/modello-core/src/main/java/org/codehaus/modello/ModelloCli.java
|
||||
@@ -25,7 +25,6 @@ package org.codehaus.modello;
|
||||
import java.io.File;
|
||||
import java.util.Properties;
|
||||
@@ -26,7 +26,6 @@ import java.io.File;
|
||||
import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
|
||||
-import org.codehaus.plexus.DefaultPlexusContainer;
|
||||
import org.codehaus.plexus.util.StringUtils;
|
||||
import org.codehaus.plexus.util.xml.XmlStreamReader;
|
||||
|
||||
@@ -40,7 +39,7 @@ public class ModelloCli {
|
||||
private static Properties parameters;
|
||||
@@ -41,7 +40,7 @@ public class ModelloCli {
|
||||
private static Map<String, Object> parameters;
|
||||
|
||||
public static void main(String[] args) throws Exception {
|
||||
- Modello modello = new DefaultPlexusContainer().lookup(Modello.class);
|
||||
|
@ -1,4 +1,4 @@
|
||||
From fa4864cc12b705ce55f3a01a71096223e920dc21 Mon Sep 17 00:00:00 2001
|
||||
From 8e04db4d5602a985ef4c5fa72cb862e9b4d6daf4 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 2/3] Add support for domAsXpp3 and fail if the old Java5
|
||||
@ -9,10 +9,10 @@ Subject: [PATCH 2/3] Add support for domAsXpp3 and fail if the old Java5
|
||||
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 19144947..579f56e3 100644
|
||||
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
|
||||
@@ -121,11 +121,24 @@ public class ModelloCli {
|
||||
@@ -106,11 +106,24 @@ public class ModelloCli {
|
||||
System.exit(1);
|
||||
}
|
||||
|
||||
@ -25,19 +25,19 @@ index 19144947..579f56e3 100644
|
||||
+ System.exit(1);
|
||||
+ }
|
||||
+
|
||||
parameters.setProperty(ModelloParameterConstants.OUTPUT_JAVA_SOURCE, javaSource);
|
||||
parameters.put(ModelloParameterConstants.OUTPUT_JAVA_SOURCE, javaSource);
|
||||
|
||||
if (args.length > 6) {
|
||||
parameters.setProperty(ModelloParameterConstants.ENCODING, args[6]);
|
||||
parameters.put(ModelloParameterConstants.ENCODING, args[6]);
|
||||
}
|
||||
+
|
||||
+ if (args.length > 7) {
|
||||
+ parameters.setProperty(ModelloParameterConstants.DOM_AS_XPP3, args[7]);
|
||||
+ parameters.put(ModelloParameterConstants.DOM_AS_XPP3, args[7]);
|
||||
+ }
|
||||
}
|
||||
|
||||
// ----------------------------------------------------------------------
|
||||
@@ -134,6 +147,6 @@ public class ModelloCli {
|
||||
@@ -119,6 +132,6 @@ public class ModelloCli {
|
||||
|
||||
private static void usage() {
|
||||
System.err.println("Usage: modello <model> <outputType> <output directory> <modelVersion> <packageWithVersion>"
|
||||
|
@ -1,24 +1,28 @@
|
||||
From 7c7e9d2512c6c4a37cf3f7c95168b33e07f6655c Mon Sep 17 00:00:00 2001
|
||||
From 0321e3dfb5010eb4ea4dc59629e0b67cb673b16d Mon Sep 17 00:00:00 2001
|
||||
From: Tamas Cservenak <tamas@cservenak.net>
|
||||
Date: Tue, 30 Apr 2024 15:15:00 +0200
|
||||
Subject: [PATCH 3/3] Fix Snakeyaml
|
||||
|
||||
---
|
||||
.../modello-plugin-snakeyaml/pom.xml | 8 +
|
||||
.../modello-plugin-snakeyaml/pom.xml | 10 +-
|
||||
.../snakeyaml/SnakeYamlReaderGenerator.java | 16 +-
|
||||
.../snakeyaml/SnakeYamlWriterGenerator.java | 4 +-
|
||||
.../snakeyaml/SnakeYamlGeneratorTest.java | 50 +
|
||||
.../src/test/resources/models/maven.mdo | 1668 +++++++++++++++++
|
||||
5 files changed, 1743 insertions(+), 3 deletions(-)
|
||||
5 files changed, 1744 insertions(+), 4 deletions(-)
|
||||
create mode 100644 modello-plugins/modello-plugin-snakeyaml/src/test/java/org/codehaus/modello/plugin/snakeyaml/SnakeYamlGeneratorTest.java
|
||||
create mode 100644 modello-plugins/modello-plugin-snakeyaml/src/test/resources/models/maven.mdo
|
||||
|
||||
diff --git a/modello-plugins/modello-plugin-snakeyaml/pom.xml b/modello-plugins/modello-plugin-snakeyaml/pom.xml
|
||||
index 3d31a88d..80e6ae32 100644
|
||||
index 43d9a72c..c377175b 100644
|
||||
--- a/modello-plugins/modello-plugin-snakeyaml/pom.xml
|
||||
+++ b/modello-plugins/modello-plugin-snakeyaml/pom.xml
|
||||
@@ -27,4 +27,12 @@
|
||||
<version>2.2</version>
|
||||
@@ -24,7 +24,15 @@
|
||||
<dependency>
|
||||
<groupId>org.yaml</groupId>
|
||||
<artifactId>snakeyaml</artifactId>
|
||||
- <version>1.33</version>
|
||||
+ <version>2.2</version>
|
||||
</dependency>
|
||||
</dependencies>
|
||||
+
|
||||
@ -31,10 +35,10 @@ index 3d31a88d..80e6ae32 100644
|
||||
+ </build>
|
||||
</project>
|
||||
diff --git a/modello-plugins/modello-plugin-snakeyaml/src/main/java/org/codehaus/modello/plugin/snakeyaml/SnakeYamlReaderGenerator.java b/modello-plugins/modello-plugin-snakeyaml/src/main/java/org/codehaus/modello/plugin/snakeyaml/SnakeYamlReaderGenerator.java
|
||||
index 78f5c348..6bc43443 100644
|
||||
index d53a40a5..532afe6e 100644
|
||||
--- a/modello-plugins/modello-plugin-snakeyaml/src/main/java/org/codehaus/modello/plugin/snakeyaml/SnakeYamlReaderGenerator.java
|
||||
+++ b/modello-plugins/modello-plugin-snakeyaml/src/main/java/org/codehaus/modello/plugin/snakeyaml/SnakeYamlReaderGenerator.java
|
||||
@@ -209,7 +209,7 @@ public class SnakeYamlReaderGenerator extends AbstractSnakeYamlGenerator {
|
||||
@@ -210,7 +210,7 @@ public class SnakeYamlReaderGenerator extends AbstractSnakeYamlGenerator {
|
||||
|
||||
sc = unmarshall.getSourceCode();
|
||||
|
||||
@ -43,7 +47,7 @@ index 78f5c348..6bc43443 100644
|
||||
|
||||
sc.add("return " + readerMethodName + "( parser, strict );");
|
||||
|
||||
@@ -287,6 +287,7 @@ public class SnakeYamlReaderGenerator extends AbstractSnakeYamlGenerator {
|
||||
@@ -288,6 +288,7 @@ public class SnakeYamlReaderGenerator extends AbstractSnakeYamlGenerator {
|
||||
jClass.addImport("org.yaml.snakeyaml.parser.ParserException");
|
||||
jClass.addImport("org.yaml.snakeyaml.parser.ParserImpl");
|
||||
jClass.addImport("org.yaml.snakeyaml.reader.StreamReader");
|
||||
@ -89,10 +93,10 @@ index 78f5c348..6bc43443 100644
|
||||
constr += " )";
|
||||
|
||||
diff --git a/modello-plugins/modello-plugin-snakeyaml/src/main/java/org/codehaus/modello/plugin/snakeyaml/SnakeYamlWriterGenerator.java b/modello-plugins/modello-plugin-snakeyaml/src/main/java/org/codehaus/modello/plugin/snakeyaml/SnakeYamlWriterGenerator.java
|
||||
index 33e2112c..538fa6ec 100644
|
||||
index cd1a5f9d..00da62ff 100644
|
||||
--- a/modello-plugins/modello-plugin-snakeyaml/src/main/java/org/codehaus/modello/plugin/snakeyaml/SnakeYamlWriterGenerator.java
|
||||
+++ b/modello-plugins/modello-plugin-snakeyaml/src/main/java/org/codehaus/modello/plugin/snakeyaml/SnakeYamlWriterGenerator.java
|
||||
@@ -73,6 +73,7 @@ public class SnakeYamlWriterGenerator extends AbstractSnakeYamlGenerator {
|
||||
@@ -74,6 +74,7 @@ public class SnakeYamlWriterGenerator extends AbstractSnakeYamlGenerator {
|
||||
|
||||
JClass jClass = new JClass(packageName + '.' + marshallerName);
|
||||
initHeader(jClass);
|
||||
@ -100,7 +104,7 @@ index 33e2112c..538fa6ec 100644
|
||||
|
||||
jClass.addImport("org.yaml.snakeyaml.DumperOptions");
|
||||
jClass.addImport("org.yaml.snakeyaml.DumperOptions.Version");
|
||||
@@ -291,7 +292,8 @@ public class SnakeYamlWriterGenerator extends AbstractSnakeYamlGenerator {
|
||||
@@ -290,7 +291,8 @@ public class SnakeYamlWriterGenerator extends AbstractSnakeYamlGenerator {
|
||||
sc.indent();
|
||||
|
||||
writeScalarKey(sc, fieldTagName);
|
||||
@ -108,11 +112,11 @@ index 33e2112c..538fa6ec 100644
|
||||
+ sc.add(
|
||||
+ "generator.emit( new SequenceStartEvent( null, null, true, null, null, FlowStyle.AUTO ) );");
|
||||
|
||||
if (useJava5) {
|
||||
sc.add("for ( " + toType + " o : " + value + " )");
|
||||
|
||||
diff --git a/modello-plugins/modello-plugin-snakeyaml/src/test/java/org/codehaus/modello/plugin/snakeyaml/SnakeYamlGeneratorTest.java b/modello-plugins/modello-plugin-snakeyaml/src/test/java/org/codehaus/modello/plugin/snakeyaml/SnakeYamlGeneratorTest.java
|
||||
new file mode 100644
|
||||
index 00000000..4b479020
|
||||
index 00000000..a9bb50fb
|
||||
--- /dev/null
|
||||
+++ b/modello-plugins/modello-plugin-snakeyaml/src/test/java/org/codehaus/modello/plugin/snakeyaml/SnakeYamlGeneratorTest.java
|
||||
@@ -0,0 +1,50 @@
|
||||
@ -140,7 +144,7 @@ index 00000000..4b479020
|
||||
+ * SOFTWARE.
|
||||
+ */
|
||||
+
|
||||
+import java.util.Properties;
|
||||
+import java.util.Map;
|
||||
+
|
||||
+import org.codehaus.modello.AbstractModelloJavaGeneratorTest;
|
||||
+import org.codehaus.modello.core.ModelloCore;
|
||||
@ -156,7 +160,7 @@ index 00000000..4b479020
|
||||
+
|
||||
+ Model model = modello.loadModel(getXmlResourceReader("/models/maven.mdo"));
|
||||
+
|
||||
+ Properties parameters = getModelloParameters("4.0.0");
|
||||
+ Map<String, Object> parameters = getModelloParameters("4.0.0");
|
||||
+
|
||||
+ modello.generate(model, "java", parameters);
|
||||
+ modello.generate(model, "snakeyaml-writer", parameters);
|
||||
|
@ -1,3 +0,0 @@
|
||||
version https://git-lfs.github.com/spec/v1
|
||||
oid sha256:79de0d691f8115ad5e2de36389ca8d739c8c25c08279e98f76b0642439acfbfa
|
||||
size 1082568
|
BIN
modello-2.4.0-source-release.zip
(Stored with Git LFS)
Normal file
BIN
modello-2.4.0-source-release.zip
(Stored with Git LFS)
Normal file
Binary file not shown.
BIN
modello-build.tar.xz
(Stored with Git LFS)
BIN
modello-build.tar.xz
(Stored with Git LFS)
Binary file not shown.
@ -1,3 +1,22 @@
|
||||
-------------------------------------------------------------------
|
||||
Sat May 4 12:02:36 UTC 2024 - Fridrich Strba <fstrba@suse.com>
|
||||
|
||||
- Upgrade to upstream version 2.4.0
|
||||
* New features and improvements
|
||||
+ Keep license structure
|
||||
+ Support addition of license header to generated files
|
||||
+ Make generated code - Java 8 based by default
|
||||
+ threadsafety
|
||||
* Bug Fixes
|
||||
+ Revert snakeyaml to 1.33 (as 2.x is not fully compatible with
|
||||
1.x). This change is reverted and SnakeYaml fixed by the
|
||||
0003-Fix-Snakeyaml.patch
|
||||
- Modified patches:
|
||||
* 0001-Fix-ModelloCli-after-moving-from-Plexus-to-JSR330.patch
|
||||
* 0002-Add-support-for-domAsXpp3-and-fail-if-the-old-Java5-.patch
|
||||
* 0003-Fix-Snakeyaml.patch
|
||||
+ rediff to changed context
|
||||
|
||||
-------------------------------------------------------------------
|
||||
Fri May 3 16:50:54 UTC 2024 - Fridrich Strba <fstrba@suse.com>
|
||||
|
||||
|
@ -19,7 +19,7 @@
|
||||
%global parent modello
|
||||
%global subname maven-plugin
|
||||
Name: %{parent}-%{subname}
|
||||
Version: 2.3.0
|
||||
Version: 2.4.0
|
||||
Release: 0
|
||||
Summary: Modello Maven Plugin
|
||||
License: Apache-2.0 AND MIT
|
||||
|
@ -1,3 +1,22 @@
|
||||
-------------------------------------------------------------------
|
||||
Sat May 4 12:02:36 UTC 2024 - Fridrich Strba <fstrba@suse.com>
|
||||
|
||||
- Upgrade to upstream version 2.4.0
|
||||
* New features and improvements
|
||||
+ Keep license structure
|
||||
+ Support addition of license header to generated files
|
||||
+ Make generated code - Java 8 based by default
|
||||
+ threadsafety
|
||||
* Bug Fixes
|
||||
+ Revert snakeyaml to 1.33 (as 2.x is not fully compatible with
|
||||
1.x). This change is reverted and SnakeYaml fixed by the
|
||||
0003-Fix-Snakeyaml.patch
|
||||
- Modified patches:
|
||||
* 0001-Fix-ModelloCli-after-moving-from-Plexus-to-JSR330.patch
|
||||
* 0002-Add-support-for-domAsXpp3-and-fail-if-the-old-Java5-.patch
|
||||
* 0003-Fix-Snakeyaml.patch
|
||||
+ rediff to changed context
|
||||
|
||||
-------------------------------------------------------------------
|
||||
Fri May 3 16:50:54 UTC 2024 - Fridrich Strba <fstrba@suse.com>
|
||||
|
||||
@ -22,7 +41,7 @@ Tue Apr 16 13:04:04 UTC 2024 - Fridrich Strba <fstrba@suse.com>
|
||||
-------------------------------------------------------------------
|
||||
Sun Apr 14 06:13:08 UTC 2024 - Fridrich Strba <fstrba@suse.com>
|
||||
|
||||
- Upgrade to upstrem version 2.3.0
|
||||
- Upgrade to upstream version 2.3.0
|
||||
* Changes of version 2.3.0
|
||||
+ Kill off dead Plexus
|
||||
+ Fix for #366
|
||||
|
@ -17,7 +17,7 @@
|
||||
|
||||
|
||||
Name: modello
|
||||
Version: 2.3.0
|
||||
Version: 2.4.0
|
||||
Release: 0
|
||||
Summary: Modello Data Model toolkit
|
||||
License: Apache-2.0 AND MIT
|
||||
|
Loading…
Reference in New Issue
Block a user