Create a gist now

Instantly share code, notes, and snippets.

@AngryAnt /Building.pm Secret
Created Feb 17, 2017

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