diff --git a/avro-builder/builder/src/main/java/com/linkedin/avroutil1/builder/SchemaBuilder.java b/avro-builder/builder/src/main/java/com/linkedin/avroutil1/builder/SchemaBuilder.java index 886c5e68e..8840e7059 100644 --- a/avro-builder/builder/src/main/java/com/linkedin/avroutil1/builder/SchemaBuilder.java +++ b/avro-builder/builder/src/main/java/com/linkedin/avroutil1/builder/SchemaBuilder.java @@ -22,7 +22,6 @@ import java.util.List; import java.util.ServiceLoader; import java.util.Set; - import joptsimple.OptionException; import joptsimple.OptionParser; import joptsimple.OptionSet; @@ -56,7 +55,8 @@ public static void main(String[] args) throws Exception { .describedAs("dir"); OptionSpec resolverPathOpt = parser.accepts("resolverPath", "Resolver path for dependent schemas") .withOptionalArg() - .describedAs("file"); + .describedAs("file") + .withValuesSeparatedBy(File.pathSeparatorChar); OptionSpec expandedSchemas = parser.accepts("expandedSchemas", "Directory for dumping expanded schemas") .withOptionalArg() .describedAs("dir"); diff --git a/avro-builder/builder/src/test/java/com/linkedin/avroutil1/builder/SchemaBuilderTest.java b/avro-builder/builder/src/test/java/com/linkedin/avroutil1/builder/SchemaBuilderTest.java index a4abb8844..a7b5f5b1e 100644 --- a/avro-builder/builder/src/test/java/com/linkedin/avroutil1/builder/SchemaBuilderTest.java +++ b/avro-builder/builder/src/test/java/com/linkedin/avroutil1/builder/SchemaBuilderTest.java @@ -128,6 +128,7 @@ public void testWithImportsFromResolverPath() throws Exception { File simpleProjectRoot = new File(locateTestProjectsRoot(), "resolverpath-project"); File inputFolder = new File(simpleProjectRoot, "input"); File resolverFolder = new File(simpleProjectRoot, "resolverPath"); + File resolverZip = new File(simpleProjectRoot, "avro_zip.zip"); File outputFolder = new File(simpleProjectRoot, "output"); if (outputFolder.exists()) { //clear output FileUtils.deleteDirectory(outputFolder); @@ -137,7 +138,7 @@ public void testWithImportsFromResolverPath() throws Exception { "--input", inputFolder.getAbsolutePath(), "--output", outputFolder.getAbsolutePath(), "--generator", CodeGenerator.AVRO_UTIL.name(), - "--resolverPath", resolverFolder.getAbsolutePath() + "--resolverPath", String.join(File.pathSeparator, resolverFolder.getAbsolutePath(), resolverZip.getAbsolutePath()) }); //see output was generated List javaFiles = Files.find(outputFolder.toPath(), 5, diff --git a/avro-builder/builder/src/test/resources/test-projects/resolverpath-project/avro_zip.zip b/avro-builder/builder/src/test/resources/test-projects/resolverpath-project/avro_zip.zip new file mode 100644 index 000000000..2757ddd73 Binary files /dev/null and b/avro-builder/builder/src/test/resources/test-projects/resolverpath-project/avro_zip.zip differ