Files
codeql/csharp/scripts/gen-assembly-info.py
Cornelius Riemenschneider 6731bccc92 C#: Provide skeleton to generate an assemblyInfo file.
Each unit gets a unique assemblyInfo file, on top
of the ones for entrypoints that also gets the git info embedded.
2024-06-07 15:24:53 +02:00

28 lines
633 B
Python

"""
Generates an `AssemblyInfo.cs` file that specifies a bunch of useful attributes
that we want to set on our assemblies."""
import pathlib
import argparse
def options():
p = argparse.ArgumentParser(
description="Generate an assembly info file."
)
p.add_argument("output", help="The path to the output file")
p.add_argument("name", help="The name of the assembly")
return p.parse_args()
opts = options()
output_file = pathlib.Path(opts.output)
output_file_contents = f"""
using System.Reflection;
[assembly: XX("{opts.name}")]
[assembly: YY("ZZ")]
"""
output_file.write_text(output_file_contents)