aboutsummaryrefslogtreecommitdiff
path: root/src/ProtoGen/ServiceGenerator.cs
diff options
context:
space:
mode:
authorcsharptest <roger@csharptest.net>2012-10-14 11:55:10 -0500
committerrogerk <devnull@localhost>2012-10-14 11:55:10 -0500
commit14e011f61ba2f5976f287e67f4ad82e0cdc546cd (patch)
tree4cd4d2056f763261af13161e72d0845c9b530b5f /src/ProtoGen/ServiceGenerator.cs
parent7d53c1291202b1b503fb611829514e17fdef053b (diff)
downloadprotobuf-14e011f61ba2f5976f287e67f4ad82e0cdc546cd.tar.gz
protobuf-14e011f61ba2f5976f287e67f4ad82e0cdc546cd.tar.bz2
protobuf-14e011f61ba2f5976f287e67f4ad82e0cdc546cd.zip
Add generated_code_attributes option, defaulted to false to generate the CompilerGeneratedAttribute and GeneratedCodeAttribute attributes
Diffstat (limited to 'src/ProtoGen/ServiceGenerator.cs')
-rw-r--r--src/ProtoGen/ServiceGenerator.cs8
1 files changed, 2 insertions, 6 deletions
diff --git a/src/ProtoGen/ServiceGenerator.cs b/src/ProtoGen/ServiceGenerator.cs
index ac84d3d8..a6b9eb28 100644
--- a/src/ProtoGen/ServiceGenerator.cs
+++ b/src/ProtoGen/ServiceGenerator.cs
@@ -54,9 +54,7 @@ namespace Google.ProtocolBuffers.ProtoGen
public void Generate(TextGenerator writer)
{
writer.WriteLine("[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]");
- writer.WriteLine("[global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]");
- writer.WriteLine("[global::System.CodeDom.Compiler.GeneratedCodeAttribute(\"{0}\", \"{1}\")]",
- GetType().Assembly.GetName().Name, GetType().Assembly.GetName().Version);
+ WriteGeneratedCodeAttributes(writer);
writer.WriteLine("{0} abstract class {1} : pb::IService {{", ClassAccessLevel, Descriptor.Name);
writer.Indent();
@@ -156,9 +154,7 @@ namespace Google.ProtocolBuffers.ProtoGen
writer.WriteLine("}");
writer.WriteLine();
writer.WriteLine("[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]");
- writer.WriteLine("[global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]");
- writer.WriteLine("[global::System.CodeDom.Compiler.GeneratedCodeAttribute(\"{0}\", \"{1}\")]",
- GetType().Assembly.GetName().Name, GetType().Assembly.GetName().Version);
+ WriteGeneratedCodeAttributes(writer);
writer.WriteLine("{0} class Stub : {1} {{", ClassAccessLevel, GetClassName(Descriptor));
writer.Indent();
writer.WriteLine("internal Stub(pb::IRpcChannel channel) {");