Skip to content

Commit

Permalink
Fix issue with resolvePath to take multiple resolver items (#496)
Browse files Browse the repository at this point in the history
* Fix issue with resolvePath to take multiple resolver items

* Fix issue with resolvePath to take multiple resolver items
  • Loading branch information
xiaoyu-yang-gh authored Jun 7, 2023
1 parent be25065 commit 314e6be
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -56,7 +55,8 @@ public static void main(String[] args) throws Exception {
.describedAs("dir");
OptionSpec<String> resolverPathOpt = parser.accepts("resolverPath", "Resolver path for dependent schemas")
.withOptionalArg()
.describedAs("file");
.describedAs("file")
.withValuesSeparatedBy(File.pathSeparatorChar);
OptionSpec<String> expandedSchemas = parser.accepts("expandedSchemas", "Directory for dumping expanded schemas")
.withOptionalArg()
.describedAs("dir");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand All @@ -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<Path> javaFiles = Files.find(outputFolder.toPath(), 5,
Expand Down
Binary file not shown.

0 comments on commit 314e6be

Please sign in to comment.