You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@avro.apache.org by GitBox <gi...@apache.org> on 2022/04/06 17:20:37 UTC

[GitHub] [avro] KyleSchoonover commented on a diff in pull request #1605: AVRO-3453: Add GeneratedCodeAttribute to generated code by avrogen

KyleSchoonover commented on code in PR #1605:
URL: https://github.com/apache/avro/pull/1605#discussion_r844197949


##########
lang/csharp/src/apache/test/AvroGen/AvroGenHelper.cs:
##########
@@ -93,20 +93,21 @@ public static Assembly CompileCSharpFilesIntoLibrary(IEnumerable<string> sourceF
                 {
                     typeof(object).Assembly.Location,
                     typeof(Schema).Assembly.Location,
+                    typeof(System.CodeDom.Compiler.GeneratedCodeAttribute).Assembly.Location,
                     Path.Combine(assemblyPath, "System.Runtime.dll"),
                     Path.Combine(assemblyPath, "netstandard.dll")
                 };
 
                 // Create compiler
                 CSharpCompilation compilation = CSharpCompilation
-                    .Create(assemblyName)
-                    .WithOptions(new CSharpCompilationOptions(OutputKind.DynamicallyLinkedLibrary))
-                    .AddReferences(assemblies.Select(path => MetadataReference.CreateFromFile(path)))
-                    .AddSyntaxTrees(sourceFiles.Select(sourceFile =>
-                    {
-                        string sourceText = System.IO.File.ReadAllText(sourceFile);
-                        return CSharpSyntaxTree.ParseText(sourceText);
-                    }));
+                .Create(assemblyName)

Review Comment:
   I chose to make it more legible.



-- 
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: issues-unsubscribe@avro.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org