alfhv commented on code in PR #2292:
URL: https://github.com/apache/avro/pull/2292#discussion_r1293047013
##########
lang/csharp/src/apache/codegen/AvroGen.cs:
##########
@@ -201,5 +220,102 @@ static void Usage()
return 0;
}
+
+ static int GenSchema(List<string> infiles, string outdir,
IEnumerable<KeyValuePair<string, string>> namespaceMapping)
+ {
+ try
+ {
+ var sn = new SchemaNames();
+ CodeGen codegen = new CodeGen();
+ var targetNs = new List<string>();
+
+ if (infiles.Count == 1)
+ {
+ FileAttributes attr =
System.IO.File.GetAttributes(infiles.First());
+ if (attr.HasFlag(FileAttributes.Directory))
+ {
+ var dirInfo = new DirectoryInfo(infiles.First());
+ infiles = dirInfo.GetFiles("*.*",
SearchOption.TopDirectoryOnly)
+ .OrderBy(f => f.Name)
+ .Select(f => f.FullName)
+ .ToList();
+ }
+ }
+
+ var toRetry = new List<string>();
+ foreach (var infile in infiles)
+ {
+ FileAttributes attr = System.IO.File.GetAttributes(infile);
+ if (attr.HasFlag(FileAttributes.Directory))
+ continue;
+
+ Console.WriteLine($"Loading Schema from: [{infile}]");
+ string text = System.IO.File.ReadAllText(infile);
+
+ //try
Review Comment:
just to keep the thread updated: a working version is available in my fork
with the retry logic.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]