Skip to content

Instantly share code, notes, and snippets.

@AngryAnt
Created February 17, 2017 12:44
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save AngryAnt/16c548412cdf1dba30140e8cdd97dc64 to your computer and use it in GitHub Desktop.
Save AngryAnt/16c548412cdf1dba30140e8cdd97dc64 to your computer and use it in GitHub Desktop.
Perl utility script for generating a protobuf-net serialiser from .proto definitions.
print ("Generating debugger protocol from .proto definitions\n");
my $generatedFile = "Behave.Debugger.Protocol.cs";
RunWithSystemMono (
"$checkoutRoot/Tools/Protobuf-net/protogen/protogen.exe",
"-d",
"-i:" . File::Spec->rel2abs ("$checkoutRoot/Source/Core/Debugger/Protocol.proto"),
"-o:$generatedFile",
"-ns:Behave.Debugging"
) and die ("Failed to generate debugger protocol");
print ("Patching generated classes from public to internal\n");
my $generatedContents = read_file ($generatedFile);
$generatedContents =~ s/public partial class/internal partial class/g;
write_file ($generatedFile, $generatedContents);
print ("Protocol ready\n");
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment