Commit 98de125a authored by Jon Skeet's avatar Jon Skeet

Merge pull request #373 from jtattermusch/csharp_generate_proto

C# generate_proto.sh and buildall.sh scripts
parents d1183bba 88199535
#!/bin/bash
# Use mono to build solution and run all tests.
# Adjust these to reflect the location of nunit-console in your system.
NUNIT_CONSOLE=nunit-console
# The rest you can leave intact
CONFIG=Release
KEYFILE=../keys/Google.ProtocolBuffers.snk # TODO(jtattermusch): signing!
SRC=$(dirname $0)/src
set -ex
echo Building the solution.
xbuild /p:Configuration=$CONFIG $SRC/ProtocolBuffers.sln
echo Running tests.
$NUNIT_CONSOLE $SRC/ProtocolBuffers.Test/bin/$CONFIG/Google.ProtocolBuffers.Test.dll
$NUNIT_CONSOLE $SRC/ProtocolBuffersLite.Test/bin/$CONFIG/Google.ProtocolBuffersLite.Test.dll
$NUNIT_CONSOLE $SRC/ProtocolBuffersLite.Test/bin/$CONFIG/Google.ProtocolBuffersMixedLite.Test.dll
#!/bin/bash
# Generates C# source files from .proto files.
# You first need to make sure protoc has been built (see instructions on
# building protoc in root of this repository)
set -ex
# cd to repository root
cd $(dirname $0)/..
# protocol buffer compiler to use
PROTOC=src/protoc
# Descriptor proto
#TODO(jtattermusch): generate descriptor.proto
# ProtocolBuffers.Test protos
$PROTOC -Isrc --csharp_out=csharp/src/ProtocolBuffers.Test/TestProtos \
src/google/protobuf/unittest.proto \
src/google/protobuf/unittest_custom_options.proto \
src/google/protobuf/unittest_drop_unknown_fields.proto \
src/google/protobuf/unittest_enormous_descriptor.proto \
src/google/protobuf/unittest_import.proto \
src/google/protobuf/unittest_import_public.proto \
src/google/protobuf/unittest_mset.proto \
src/google/protobuf/unittest_optimize_for.proto \
src/google/protobuf/unknown_enum_test.proto
$PROTOC -Icsharp/protos/extest --csharp_out=csharp/src/ProtocolBuffers.Test/TestProtos \
csharp/protos/extest/unittest_extras_xmltest.proto \
csharp/protos/extest/unittest_issues.proto
$PROTOC -Icsharp --csharp_out=csharp/src/ProtocolBuffers.Test/TestProtos \
csharp/protos/google/protobuf/field_presence_test.proto
$PROTOC -Ibenchmarks --csharp_out=csharp/src/ProtocolBuffers.Test/TestProtos \
benchmarks/google_size.proto \
benchmarks/google_speed.proto
# ProtocolBuffersLite.Test protos
$PROTOC -Isrc --csharp_out=csharp/src/ProtocolBuffersLite.Test/TestProtos \
src/google/protobuf/unittest.proto \
src/google/protobuf/unittest_import.proto \
src/google/protobuf/unittest_import_lite.proto \
src/google/protobuf/unittest_import_public.proto \
src/google/protobuf/unittest_import_public_lite.proto \
src/google/protobuf/unittest_lite.proto \
src/google/protobuf/unittest_lite_imports_nonlite.proto
$PROTOC -Icsharp/protos/extest --csharp_out=csharp/src/ProtocolBuffersLite.Test/TestProtos \
csharp/protos/extest/unittest_extras_full.proto \
csharp/protos/extest/unittest_extras_lite.proto
#!/bin/bash
# Adjust these to reflect the location of NUnit in your system,
# and how you want NUnit to run
NUNIT=~/protobuf/NUnit-2.5.0.9122/bin/net-2.0/nunit-console.exe
NUNIT_OPTIONS=-noshadow
# The rest should be okay.
SRC=../src
LIB=../lib
KEYFILE=../keys/Google.ProtocolBuffers.snk
rm -rf bin
mkdir bin
# Running the unit tests requires the dependencies are
# in the bin directory too
cp -f $LIB/{Rhino.Mocks.dll,nunit.framework.dll} bin
echo Building main library
gmcs -target:library -out:bin/Google.ProtocolBuffers.dll `find $SRC/ProtocolBuffers -name '*.cs'` -keyfile:$KEYFILE
echo Building main library tests
gmcs -target:library -out:bin/Google.ProtocolBuffers.Test.dll `find $SRC/ProtocolBuffers.Test -name '*.cs'` -keyfile:$KEYFILE -r:bin/Google.ProtocolBuffers.dll -r:$LIB/nunit.framework.dll -r:$LIB/Rhino.Mocks.dll
echo Running main library tests
mono $NUNIT bin/Google.ProtocolBuffers.Test.dll $NUNIT_OPTIONS
echo Building ProtoGen
gmcs -target:exe -out:bin/ProtoGen.exe `find $SRC/ProtoGen -name '*.cs'` -keyfile:$KEYFILE -r:bin/Google.ProtocolBuffers.dll
echo Building ProtoGen tests
gmcs -target:library -out:bin/Google.ProtocolBuffers.ProtoGen.Test.dll `find $SRC/ProtoGen.Test -name '*.cs'` -keyfile:$KEYFILE -r:bin/Google.ProtocolBuffers.dll -r:$LIB/nunit.framework.dll -r:bin/ProtoGen.exe
echo Running ProtoGen tests
mono $NUNIT bin/Google.ProtocolBuffers.ProtoGen.Test.dll $NUNIT_OPTIONS
#!/bin/bash
echo Compiling protobufs
rm -rf tmp
mkdir tmp
PROTOS_DIR=../protos
./protoc --proto_path=$PROTOS_DIR --descriptor_set_out=tmp/compiled.pb \
$PROTOS_DIR/google/protobuf/descriptor.proto \
$PROTOS_DIR/google/protobuf/csharp_options.proto \
$PROTOS_DIR/google/protobuf/unittest.proto \
$PROTOS_DIR/google/protobuf/unittest_csharp_options.proto \
$PROTOS_DIR/google/protobuf/unittest_custom_options.proto \
$PROTOS_DIR/google/protobuf/unittest_embed_optimize_for.proto \
$PROTOS_DIR/google/protobuf/unittest_import.proto \
$PROTOS_DIR/google/protobuf/unittest_mset.proto \
$PROTOS_DIR/google/protobuf/unittest_optimize_for.proto \
$PROTOS_DIR/tutorial/addressbook.proto
cd tmp
echo Generating new source
mono ../bin/ProtoGen.exe compiled.pb
echo Copying source into place
cp DescriptorProtoFile.cs CSharpOptions.cs ../../src/ProtocolBuffers/DescriptorProtos
cp UnitTest*.cs ../../src/ProtocolBuffers.Test/TestProtos
cp AddressBookProtos.cs ../../src/AddressBook
cd ..
rm -rf tmp
Getting started with Protocol Buffers on Mono
---------------------------------------------
Prerequisites:
o Mono 2.4 or higher. Earlier versions of Mono had too
many issues with the weird and wonderful generic type
relationships in Protocol Buffers. (Even Mono 2.4 *did*
have a few compile-time problems, but I've worked round them.)
o Some sort of Linux/Unix system
You can try running with Bash on Windows via MINGW32 or
something similar, but you're on your own :) It's easier
to build and test everything with .NET if you're on
Windows.
o The native Protocol Buffers build for your system.
Get it from http://code.google.com/p/protobuf/
After building it, copy the executable protoc
file into this directory.
o The NUnit binaries from http://nunit.org
I generally just download the latest version, which
may not be the one which goes with nunit.framework.dll
in ../lib, but I've never found this to be a problem.
Building the code with current sources
--------------------------------------
1) Edit buildall.sh to tell it where to find nunit-console.exe
(and possibly change other options)
2) Run buildall.sh from this directory. It should build the
main library code + tests and ProtoGen code + tests, running
each set of tests after building it.
Note that currently one test is ignored in ServiceTest.cs. This
made the Mono VM blow up - I suspect it's some interaction with
Rhino which doesn't quite work on Mono 2.4. If you want to see a
truly nasty stack trace, just comment out the Ignore attribute in
ServiceTest.cs and rerun.
The binaries will be produced in a bin directory under this one. The
build currently starts from scratch each time, cleaning out the bin
directory first. Once I've decided on a full NAnt or xbuild
strategy, I'll do something a little cleaner.
Rebuilding sources for generated code
-------------------------------------
1) Build the current code first. The bootstrapping issue is why
the generated source code is in the source repository :) See
the steps above.
2) Run generatesource.sh from this directory. This will create a
temporary directory, compile the .proto files into a binary
format, then run ProtoGen to generate .cs files from the binary
format. It will copy these files to the right places in the tree,
and finally delete the temporary directory.
3) Rebuild to test that your newly generated sources work. (Optionally
regenerate as well, and hash the generated files to check that
the new build generates the same code as the old build :)
Running the code
----------------
Once you've built the binaries, you should be able to use them just
as if you'd built them with .NET. (And indeed, you should be able to
use binaries built with .NET as if you'd built them with Mono :)
See the getting started guide for more information:
http://code.google.com/p/protobuf-csharp-port/wiki/GettingStarted
FAQ (Frequently Anticipated Questions)
--------------------------------------
Q) This build process sucks! Why aren't you doing X, Y, Z?
A) My Mono skills are limited. My NAnt skills are limited. My
MSBuild/xbuild skils are limited. My shell script skills are
limited. Any help is *very* welcome!
Q) Why doesn't it build ProtoBench etc?
A) This is a first initial "release" I'll add more bits to
the build script. I'll be interested to see the results
of benchmarking it on Mono :)
Any further questions or suggestions? Please email skeet@pobox.com
or leave a request at
http://code.google.com/p/protobuf-csharp-port/issues/list
...@@ -84,7 +84,7 @@ ...@@ -84,7 +84,7 @@
<Compile Include="Compatibility\TestResources.cs" /> <Compile Include="Compatibility\TestResources.cs" />
<Compile Include="Compatibility\TextCompatibilityTests.cs" /> <Compile Include="Compatibility\TextCompatibilityTests.cs" />
<Compile Include="Compatibility\XmlCompatibilityTests.cs" /> <Compile Include="Compatibility\XmlCompatibilityTests.cs" />
<Compile Include="TestProtos\FieldPresence.cs" /> <Compile Include="TestProtos\FieldPresenceTest.cs" />
<Compile Include="TestProtos\GoogleSize.cs" /> <Compile Include="TestProtos\GoogleSize.cs" />
<Compile Include="TestProtos\GoogleSpeed.cs" /> <Compile Include="TestProtos\GoogleSpeed.cs" />
<Compile Include="TestProtos\Unittest.cs" /> <Compile Include="TestProtos\Unittest.cs" />
......
...@@ -265,14 +265,12 @@ namespace Google.ProtocolBuffers.TestProtos { ...@@ -265,14 +265,12 @@ namespace Google.ProtocolBuffers.TestProtos {
public const int Field5FieldNumber = 5; public const int Field5FieldNumber = 5;
private pbc::PopsicleList<ulong> field5_ = new pbc::PopsicleList<ulong>(); private pbc::PopsicleList<ulong> field5_ = new pbc::PopsicleList<ulong>();
[global::System.CLSCompliant(false)]
public scg::IList<ulong> Field5List { public scg::IList<ulong> Field5List {
get { return pbc::Lists.AsReadOnly(field5_); } get { return pbc::Lists.AsReadOnly(field5_); }
} }
public int Field5Count { public int Field5Count {
get { return field5_.Count; } get { return field5_.Count; }
} }
[global::System.CLSCompliant(false)]
public ulong GetField5(int index) { public ulong GetField5(int index) {
return field5_[index]; return field5_[index];
} }
...@@ -899,30 +897,25 @@ namespace Google.ProtocolBuffers.TestProtos { ...@@ -899,30 +897,25 @@ namespace Google.ProtocolBuffers.TestProtos {
return this; return this;
} }
[global::System.CLSCompliant(false)]
public pbc::IPopsicleList<ulong> Field5List { public pbc::IPopsicleList<ulong> Field5List {
get { return PrepareBuilder().field5_; } get { return PrepareBuilder().field5_; }
} }
public int Field5Count { public int Field5Count {
get { return result.Field5Count; } get { return result.Field5Count; }
} }
[global::System.CLSCompliant(false)]
public ulong GetField5(int index) { public ulong GetField5(int index) {
return result.GetField5(index); return result.GetField5(index);
} }
[global::System.CLSCompliant(false)]
public Builder SetField5(int index, ulong value) { public Builder SetField5(int index, ulong value) {
PrepareBuilder(); PrepareBuilder();
result.field5_[index] = value; result.field5_[index] = value;
return this; return this;
} }
[global::System.CLSCompliant(false)]
public Builder AddField5(ulong value) { public Builder AddField5(ulong value) {
PrepareBuilder(); PrepareBuilder();
result.field5_.Add(value); result.field5_.Add(value);
return this; return this;
} }
[global::System.CLSCompliant(false)]
public Builder AddRangeField5(scg::IEnumerable<ulong> values) { public Builder AddRangeField5(scg::IEnumerable<ulong> values) {
PrepareBuilder(); PrepareBuilder();
result.field5_.Add(values); result.field5_.Add(values);
...@@ -1683,7 +1676,6 @@ namespace Google.ProtocolBuffers.TestProtos { ...@@ -1683,7 +1676,6 @@ namespace Google.ProtocolBuffers.TestProtos {
public bool HasField21 { public bool HasField21 {
get { return hasField21; } get { return hasField21; }
} }
[global::System.CLSCompliant(false)]
public ulong Field21 { public ulong Field21 {
get { return field21_; } get { return field21_; }
} }
...@@ -1724,7 +1716,6 @@ namespace Google.ProtocolBuffers.TestProtos { ...@@ -1724,7 +1716,6 @@ namespace Google.ProtocolBuffers.TestProtos {
public bool HasField203 { public bool HasField203 {
get { return hasField203; } get { return hasField203; }
} }
[global::System.CLSCompliant(false)]
public uint Field203 { public uint Field203 {
get { return field203_; } get { return field203_; }
} }
...@@ -1755,7 +1746,6 @@ namespace Google.ProtocolBuffers.TestProtos { ...@@ -1755,7 +1746,6 @@ namespace Google.ProtocolBuffers.TestProtos {
public bool HasField207 { public bool HasField207 {
get { return hasField207; } get { return hasField207; }
} }
[global::System.CLSCompliant(false)]
public ulong Field207 { public ulong Field207 {
get { return field207_; } get { return field207_; }
} }
...@@ -1766,7 +1756,6 @@ namespace Google.ProtocolBuffers.TestProtos { ...@@ -1766,7 +1756,6 @@ namespace Google.ProtocolBuffers.TestProtos {
public bool HasField300 { public bool HasField300 {
get { return hasField300; } get { return hasField300; }
} }
[global::System.CLSCompliant(false)]
public ulong Field300 { public ulong Field300 {
get { return field300_; } get { return field300_; }
} }
...@@ -2102,12 +2091,10 @@ namespace Google.ProtocolBuffers.TestProtos { ...@@ -2102,12 +2091,10 @@ namespace Google.ProtocolBuffers.TestProtos {
public bool HasField21 { public bool HasField21 {
get { return result.hasField21; } get { return result.hasField21; }
} }
[global::System.CLSCompliant(false)]
public ulong Field21 { public ulong Field21 {
get { return result.Field21; } get { return result.Field21; }
set { SetField21(value); } set { SetField21(value); }
} }
[global::System.CLSCompliant(false)]
public Builder SetField21(ulong value) { public Builder SetField21(ulong value) {
PrepareBuilder(); PrepareBuilder();
result.hasField21 = true; result.hasField21 = true;
...@@ -2184,12 +2171,10 @@ namespace Google.ProtocolBuffers.TestProtos { ...@@ -2184,12 +2171,10 @@ namespace Google.ProtocolBuffers.TestProtos {
public bool HasField203 { public bool HasField203 {
get { return result.hasField203; } get { return result.hasField203; }
} }
[global::System.CLSCompliant(false)]
public uint Field203 { public uint Field203 {
get { return result.Field203; } get { return result.Field203; }
set { SetField203(value); } set { SetField203(value); }
} }
[global::System.CLSCompliant(false)]
public Builder SetField203(uint value) { public Builder SetField203(uint value) {
PrepareBuilder(); PrepareBuilder();
result.hasField203 = true; result.hasField203 = true;
...@@ -2247,12 +2232,10 @@ namespace Google.ProtocolBuffers.TestProtos { ...@@ -2247,12 +2232,10 @@ namespace Google.ProtocolBuffers.TestProtos {
public bool HasField207 { public bool HasField207 {
get { return result.hasField207; } get { return result.hasField207; }
} }
[global::System.CLSCompliant(false)]
public ulong Field207 { public ulong Field207 {
get { return result.Field207; } get { return result.Field207; }
set { SetField207(value); } set { SetField207(value); }
} }
[global::System.CLSCompliant(false)]
public Builder SetField207(ulong value) { public Builder SetField207(ulong value) {
PrepareBuilder(); PrepareBuilder();
result.hasField207 = true; result.hasField207 = true;
...@@ -2269,12 +2252,10 @@ namespace Google.ProtocolBuffers.TestProtos { ...@@ -2269,12 +2252,10 @@ namespace Google.ProtocolBuffers.TestProtos {
public bool HasField300 { public bool HasField300 {
get { return result.hasField300; } get { return result.hasField300; }
} }
[global::System.CLSCompliant(false)]
public ulong Field300 { public ulong Field300 {
get { return result.Field300; } get { return result.Field300; }
set { SetField300(value); } set { SetField300(value); }
} }
[global::System.CLSCompliant(false)]
public Builder SetField300(ulong value) { public Builder SetField300(ulong value) {
PrepareBuilder(); PrepareBuilder();
result.hasField300 = true; result.hasField300 = true;
...@@ -2402,7 +2383,6 @@ namespace Google.ProtocolBuffers.TestProtos { ...@@ -2402,7 +2383,6 @@ namespace Google.ProtocolBuffers.TestProtos {
public bool HasField15 { public bool HasField15 {
get { return hasField15; } get { return hasField15; }
} }
[global::System.CLSCompliant(false)]
public ulong Field15 { public ulong Field15 {
get { return field15_; } get { return field15_; }
} }
...@@ -2738,12 +2718,10 @@ namespace Google.ProtocolBuffers.TestProtos { ...@@ -2738,12 +2718,10 @@ namespace Google.ProtocolBuffers.TestProtos {
public bool HasField15 { public bool HasField15 {
get { return result.hasField15; } get { return result.hasField15; }
} }
[global::System.CLSCompliant(false)]
public ulong Field15 { public ulong Field15 {
get { return result.Field15; } get { return result.Field15; }
set { SetField15(value); } set { SetField15(value); }
} }
[global::System.CLSCompliant(false)]
public Builder SetField15(ulong value) { public Builder SetField15(ulong value) {
PrepareBuilder(); PrepareBuilder();
result.hasField15 = true; result.hasField15 = true;
......
...@@ -267,14 +267,12 @@ namespace Google.ProtocolBuffers.TestProtos { ...@@ -267,14 +267,12 @@ namespace Google.ProtocolBuffers.TestProtos {
public const int Field5FieldNumber = 5; public const int Field5FieldNumber = 5;
private pbc::PopsicleList<ulong> field5_ = new pbc::PopsicleList<ulong>(); private pbc::PopsicleList<ulong> field5_ = new pbc::PopsicleList<ulong>();
[global::System.CLSCompliant(false)]
public scg::IList<ulong> Field5List { public scg::IList<ulong> Field5List {
get { return pbc::Lists.AsReadOnly(field5_); } get { return pbc::Lists.AsReadOnly(field5_); }
} }
public int Field5Count { public int Field5Count {
get { return field5_.Count; } get { return field5_.Count; }
} }
[global::System.CLSCompliant(false)]
public ulong GetField5(int index) { public ulong GetField5(int index) {
return field5_[index]; return field5_[index];
} }
...@@ -1540,30 +1538,25 @@ namespace Google.ProtocolBuffers.TestProtos { ...@@ -1540,30 +1538,25 @@ namespace Google.ProtocolBuffers.TestProtos {
return this; return this;
} }
[global::System.CLSCompliant(false)]
public pbc::IPopsicleList<ulong> Field5List { public pbc::IPopsicleList<ulong> Field5List {
get { return PrepareBuilder().field5_; } get { return PrepareBuilder().field5_; }
} }
public int Field5Count { public int Field5Count {
get { return result.Field5Count; } get { return result.Field5Count; }
} }
[global::System.CLSCompliant(false)]
public ulong GetField5(int index) { public ulong GetField5(int index) {
return result.GetField5(index); return result.GetField5(index);
} }
[global::System.CLSCompliant(false)]
public Builder SetField5(int index, ulong value) { public Builder SetField5(int index, ulong value) {
PrepareBuilder(); PrepareBuilder();
result.field5_[index] = value; result.field5_[index] = value;
return this; return this;
} }
[global::System.CLSCompliant(false)]
public Builder AddField5(ulong value) { public Builder AddField5(ulong value) {
PrepareBuilder(); PrepareBuilder();
result.field5_.Add(value); result.field5_.Add(value);
return this; return this;
} }
[global::System.CLSCompliant(false)]
public Builder AddRangeField5(scg::IEnumerable<ulong> values) { public Builder AddRangeField5(scg::IEnumerable<ulong> values) {
PrepareBuilder(); PrepareBuilder();
result.field5_.Add(values); result.field5_.Add(values);
...@@ -2326,7 +2319,6 @@ namespace Google.ProtocolBuffers.TestProtos { ...@@ -2326,7 +2319,6 @@ namespace Google.ProtocolBuffers.TestProtos {
public bool HasField21 { public bool HasField21 {
get { return hasField21; } get { return hasField21; }
} }
[global::System.CLSCompliant(false)]
public ulong Field21 { public ulong Field21 {
get { return field21_; } get { return field21_; }
} }
...@@ -2367,7 +2359,6 @@ namespace Google.ProtocolBuffers.TestProtos { ...@@ -2367,7 +2359,6 @@ namespace Google.ProtocolBuffers.TestProtos {
public bool HasField203 { public bool HasField203 {
get { return hasField203; } get { return hasField203; }
} }
[global::System.CLSCompliant(false)]
public uint Field203 { public uint Field203 {
get { return field203_; } get { return field203_; }
} }
...@@ -2398,7 +2389,6 @@ namespace Google.ProtocolBuffers.TestProtos { ...@@ -2398,7 +2389,6 @@ namespace Google.ProtocolBuffers.TestProtos {
public bool HasField207 { public bool HasField207 {
get { return hasField207; } get { return hasField207; }
} }
[global::System.CLSCompliant(false)]
public ulong Field207 { public ulong Field207 {
get { return field207_; } get { return field207_; }
} }
...@@ -2409,7 +2399,6 @@ namespace Google.ProtocolBuffers.TestProtos { ...@@ -2409,7 +2399,6 @@ namespace Google.ProtocolBuffers.TestProtos {
public bool HasField300 { public bool HasField300 {
get { return hasField300; } get { return hasField300; }
} }
[global::System.CLSCompliant(false)]
public ulong Field300 { public ulong Field300 {
get { return field300_; } get { return field300_; }
} }
...@@ -3099,12 +3088,10 @@ namespace Google.ProtocolBuffers.TestProtos { ...@@ -3099,12 +3088,10 @@ namespace Google.ProtocolBuffers.TestProtos {
public bool HasField21 { public bool HasField21 {
get { return result.hasField21; } get { return result.hasField21; }
} }
[global::System.CLSCompliant(false)]
public ulong Field21 { public ulong Field21 {
get { return result.Field21; } get { return result.Field21; }
set { SetField21(value); } set { SetField21(value); }
} }
[global::System.CLSCompliant(false)]
public Builder SetField21(ulong value) { public Builder SetField21(ulong value) {
PrepareBuilder(); PrepareBuilder();
result.hasField21 = true; result.hasField21 = true;
...@@ -3181,12 +3168,10 @@ namespace Google.ProtocolBuffers.TestProtos { ...@@ -3181,12 +3168,10 @@ namespace Google.ProtocolBuffers.TestProtos {
public bool HasField203 { public bool HasField203 {
get { return result.hasField203; } get { return result.hasField203; }
} }
[global::System.CLSCompliant(false)]
public uint Field203 { public uint Field203 {
get { return result.Field203; } get { return result.Field203; }
set { SetField203(value); } set { SetField203(value); }
} }
[global::System.CLSCompliant(false)]
public Builder SetField203(uint value) { public Builder SetField203(uint value) {
PrepareBuilder(); PrepareBuilder();
result.hasField203 = true; result.hasField203 = true;
...@@ -3244,12 +3229,10 @@ namespace Google.ProtocolBuffers.TestProtos { ...@@ -3244,12 +3229,10 @@ namespace Google.ProtocolBuffers.TestProtos {
public bool HasField207 { public bool HasField207 {
get { return result.hasField207; } get { return result.hasField207; }
} }
[global::System.CLSCompliant(false)]
public ulong Field207 { public ulong Field207 {
get { return result.Field207; } get { return result.Field207; }
set { SetField207(value); } set { SetField207(value); }
} }
[global::System.CLSCompliant(false)]
public Builder SetField207(ulong value) { public Builder SetField207(ulong value) {
PrepareBuilder(); PrepareBuilder();
result.hasField207 = true; result.hasField207 = true;
...@@ -3266,12 +3249,10 @@ namespace Google.ProtocolBuffers.TestProtos { ...@@ -3266,12 +3249,10 @@ namespace Google.ProtocolBuffers.TestProtos {
public bool HasField300 { public bool HasField300 {
get { return result.hasField300; } get { return result.hasField300; }
} }
[global::System.CLSCompliant(false)]
public ulong Field300 { public ulong Field300 {
get { return result.Field300; } get { return result.Field300; }
set { SetField300(value); } set { SetField300(value); }
} }
[global::System.CLSCompliant(false)]
public Builder SetField300(ulong value) { public Builder SetField300(ulong value) {
PrepareBuilder(); PrepareBuilder();
result.hasField300 = true; result.hasField300 = true;
...@@ -3403,7 +3384,6 @@ namespace Google.ProtocolBuffers.TestProtos { ...@@ -3403,7 +3384,6 @@ namespace Google.ProtocolBuffers.TestProtos {
public bool HasField15 { public bool HasField15 {
get { return hasField15; } get { return hasField15; }
} }
[global::System.CLSCompliant(false)]
public ulong Field15 { public ulong Field15 {
get { return field15_; } get { return field15_; }
} }
...@@ -4064,12 +4044,10 @@ namespace Google.ProtocolBuffers.TestProtos { ...@@ -4064,12 +4044,10 @@ namespace Google.ProtocolBuffers.TestProtos {
public bool HasField15 { public bool HasField15 {
get { return result.hasField15; } get { return result.hasField15; }
} }
[global::System.CLSCompliant(false)]
public ulong Field15 { public ulong Field15 {
get { return result.Field15; } get { return result.Field15; }
set { SetField15(value); } set { SetField15(value); }
} }
[global::System.CLSCompliant(false)]
public Builder SetField15(ulong value) { public Builder SetField15(ulong value) {
PrepareBuilder(); PrepareBuilder();
result.hasField15 = true; result.hasField15 = true;
......
This source diff could not be displayed because it is too large. You can view the blob instead.
...@@ -420,7 +420,6 @@ namespace Google.ProtocolBuffers.TestProtos { ...@@ -420,7 +420,6 @@ namespace Google.ProtocolBuffers.TestProtos {
public bool HasZip { public bool HasZip {
get { return hasZip; } get { return hasZip; }
} }
[global::System.CLSCompliant(false)]
public uint Zip { public uint Zip {
get { return zip_; } get { return zip_; }
} }
...@@ -619,12 +618,10 @@ namespace Google.ProtocolBuffers.TestProtos { ...@@ -619,12 +618,10 @@ namespace Google.ProtocolBuffers.TestProtos {
public bool HasZip { public bool HasZip {
get { return result.hasZip; } get { return result.hasZip; }
} }
[global::System.CLSCompliant(false)]
public uint Zip { public uint Zip {
get { return result.Zip; } get { return result.Zip; }
set { SetZip(value); } set { SetZip(value); }
} }
[global::System.CLSCompliant(false)]
public Builder SetZip(uint value) { public Builder SetZip(uint value) {
PrepareBuilder(); PrepareBuilder();
result.hasZip = true; result.hasZip = true;
......
...@@ -101,7 +101,9 @@ namespace Google.ProtocolBuffers.TestProtos { ...@@ -101,7 +101,9 @@ namespace Google.ProtocolBuffers.TestProtos {
#region Lite runtime methods #region Lite runtime methods
public override int GetHashCode() { public override int GetHashCode() {
int hash = GetType().GetHashCode(); int hash = GetType().GetHashCode();
if (hasD) hash ^= d_.GetHashCode(); if (hasD) {
hash ^= d_.GetHashCode();
}
return hash; return hash;
} }
......
...@@ -92,7 +92,9 @@ namespace Google.ProtocolBuffers.TestProtos { ...@@ -92,7 +92,9 @@ namespace Google.ProtocolBuffers.TestProtos {
#region Lite runtime methods #region Lite runtime methods
public override int GetHashCode() { public override int GetHashCode() {
int hash = GetType().GetHashCode(); int hash = GetType().GetHashCode();
if (hasE) hash ^= e_.GetHashCode(); if (hasE) {
hash ^= e_.GetHashCode();
}
return hash; return hash;
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment