From 5b39288d60f0605205a1556ba1d86518f46a5c36 Mon Sep 17 00:00:00 2001 From: Andrea Cavalli Date: Thu, 26 Sep 2024 19:28:10 +0200 Subject: [PATCH] Add binary strings --- .../src/main/java/it/cavallium/datagen/plugin/DataModel.java | 2 +- .../main/java/it/cavallium/datagen/plugin/MavenPlugin.java | 5 ++++- .../main/java/it/cavallium/datagen/plugin/Standalone.java | 3 ++- 3 files changed, 7 insertions(+), 3 deletions(-) diff --git a/datagen-plugin/src/main/java/it/cavallium/datagen/plugin/DataModel.java b/datagen-plugin/src/main/java/it/cavallium/datagen/plugin/DataModel.java index ecef64f..550f69e 100644 --- a/datagen-plugin/src/main/java/it/cavallium/datagen/plugin/DataModel.java +++ b/datagen-plugin/src/main/java/it/cavallium/datagen/plugin/DataModel.java @@ -390,7 +390,7 @@ public class DataModel { arrayRawTypes.stream() .filter(NATIVE_TYPES::contains) .map(baseType -> - new ComputedTypeArrayNative(baseType, computedTypeSupplier)) + new ComputedTypeArrayNative(baseType, computedTypeSupplier, binaryStrings)) .forEach(versionBaseTypes::add); } // Compute native types diff --git a/datagen-plugin/src/main/java/it/cavallium/datagen/plugin/MavenPlugin.java b/datagen-plugin/src/main/java/it/cavallium/datagen/plugin/MavenPlugin.java index ea5ab06..f2b8528 100644 --- a/datagen-plugin/src/main/java/it/cavallium/datagen/plugin/MavenPlugin.java +++ b/datagen-plugin/src/main/java/it/cavallium/datagen/plugin/MavenPlugin.java @@ -32,6 +32,9 @@ public class MavenPlugin extends AbstractMojo { @Parameter(defaultValue = "false") private String generateTestResources; + @Parameter(defaultValue = "false") + private String binaryStrings; + /** * @parameter default-value="${project}" * @required @@ -50,7 +53,7 @@ public class MavenPlugin extends AbstractMojo { Path outPath = genRecordsPath.resolve("java"); this.project.addCompileSourceRoot(outPath.toString()); sourcesGenerator.generateSources(basePackageName, outPath, Boolean.parseBoolean(useRecordBuilder), false, Boolean.parseBoolean(deepCheckBeforeCreatingNewEqualInstances), - Boolean.parseBoolean(generateOldSerializers)); + Boolean.parseBoolean(generateOldSerializers), Boolean.parseBoolean(binaryStrings)); } catch (IOException e) { throw new MojoExecutionException("Exception while generating classes", e); } diff --git a/datagen-plugin/src/main/java/it/cavallium/datagen/plugin/Standalone.java b/datagen-plugin/src/main/java/it/cavallium/datagen/plugin/Standalone.java index 064d637..47e2ba4 100644 --- a/datagen-plugin/src/main/java/it/cavallium/datagen/plugin/Standalone.java +++ b/datagen-plugin/src/main/java/it/cavallium/datagen/plugin/Standalone.java @@ -19,7 +19,8 @@ public class Standalone { parseBoolean(args[3]), parseBoolean(args[4]), parseBoolean(args[5]), - parseBoolean(args[6]) + parseBoolean(args[6]), + parseBoolean(args[7]) ); } }