Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in / Register
Toggle navigation
P
protobuf
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Packages
Packages
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
submodule
protobuf
Commits
926f4dd3
Commit
926f4dd3
authored
Oct 04, 2011
by
csharptest
Committed by
rogerk
Oct 04, 2011
Browse files
Options
Browse Files
Download
Plain Diff
merged issue-30
parents
3ede2921
947cb8f3
Show whitespace changes
Inline
Side-by-side
Showing
47 changed files
with
825 additions
and
1245 deletions
+825
-1245
.hgignore
.hgignore
+2
-0
Build20.bat
build/Build20.bat
+3
-6
BuildAll.bat
build/BuildAll.bat
+2
-43
BuildSilverlight2.bat
build/BuildSilverlight2.bat
+1
-5
Common.targets
build/Common.targets
+108
-33
GenerateCompletePackage.bat
build/GenerateCompletePackage.bat
+0
-20
GenerateReleasePackage.bat
build/GenerateReleasePackage.bat
+0
-14
Google.ProtocolBuffers.nuspec
build/Google.ProtocolBuffers.nuspec
+13
-7
Google.ProtocolBuffersLite.nuspec
build/Google.ProtocolBuffersLite.nuspec
+13
-7
PublishRelease.bat
build/PublishRelease.bat
+18
-9
RunBenchmarks.bat
build/RunBenchmarks.bat
+1
-5
build.csproj
build/build.csproj
+64
-42
build35.bat
build/build35.bat
+3
-3
build40.bat
build/build40.bat
+8
-0
nunit-console.v2.0.config
lib/NUnit 2.2.8.0/nunit-console.v2.0.config
+5
-0
nunit-console.v3.5.config
lib/NUnit 2.2.8.0/nunit-console.v3.5.config
+103
-0
nunit-console.v4.0.config
lib/NUnit 2.2.8.0/nunit-console.v4.0.config
+103
-0
Program.cs
src/ProtoBench/Program.cs
+27
-6
Extensions.cs
src/ProtocolBuffers.Serialization/Extensions.cs
+122
-9
MessageFormatFactory.cs
...rotocolBuffers.Serialization/Http/MessageFormatFactory.cs
+0
-40
ServiceExtensions.cs
src/ProtocolBuffers.Serialization/Http/ServiceExtensions.cs
+0
-34
JsonFormatWriter.cs
src/ProtocolBuffers.Serialization/JsonFormatWriter.cs
+1
-1
ProtocolBuffers.Serialization.csproj
...uffers.Serialization/ProtocolBuffers.Serialization.csproj
+13
-17
ProtocolBuffersLite.Serialization.csproj
...rs.Serialization/ProtocolBuffersLite.Serialization.csproj
+13
-17
RecursionLimitExceeded.cs
src/ProtocolBuffers.Serialization/RecursionLimitExceeded.cs
+2
-2
TestResources.Designer.cs
...tocolBuffers.Test/Compatibility/TestResources.Designer.cs
+0
-77
TestResources.cs
src/ProtocolBuffers.Test/Compatibility/TestResources.cs
+42
-0
TestResources.resx
src/ProtocolBuffers.Test/Compatibility/TestResources.resx
+0
-128
ProtocolBuffers.Test.csproj
src/ProtocolBuffers.Test/ProtocolBuffers.Test.csproj
+3
-13
ReusableBuilderTest.cs
src/ProtocolBuffers.Test/ReusableBuilderTest.cs
+2
-2
TestMimeMessageFormats.cs
src/ProtocolBuffers.Test/TestMimeMessageFormats.cs
+21
-21
TestRpcForMimeTypes.cs
src/ProtocolBuffers.Test/TestRpcForMimeTypes.cs
+4
-4
TestWriterFormatJson.cs
src/ProtocolBuffers.Test/TestWriterFormatJson.cs
+9
-7
TestWriterFormatXml.cs
src/ProtocolBuffers.Test/TestWriterFormatXml.cs
+9
-7
ProtocolBuffers.sln
src/ProtocolBuffers.sln
+39
-41
CodedInputStream.cs
src/ProtocolBuffers/CodedInputStream.cs
+1
-1
CodedOutputStream.cs
src/ProtocolBuffers/CodedOutputStream.cs
+1
-1
CustomSerialization.cs
src/ProtocolBuffers/CustomSerialization.cs
+1
-1
EnumLite.cs
src/ProtocolBuffers/EnumLite.cs
+1
-1
ProtocolBuffers.csproj
src/ProtocolBuffers/ProtocolBuffers.csproj
+9
-8
ProtocolBuffersLite.csproj
src/ProtocolBuffers/ProtocolBuffersLite.csproj
+11
-9
SilverlightCompatibility.cs
src/ProtocolBuffers/SilverlightCompatibility.cs
+1
-1
SortedList.cs
src/ProtocolBuffers/SortedList.cs
+1
-1
ProtocolBuffers2008.sln
src/ProtocolBuffers2008.sln
+39
-41
ProtocolBuffersLite.Test.csproj
src/ProtocolBuffersLite.Test/ProtocolBuffersLite.Test.csproj
+6
-2
TestRpcForMimeTypes.cs
src/ProtocolBuffersLite.Test/TestRpcForMimeTypes.cs
+0
-387
TestRpcGenerator.cs
src/ProtocolBuffersLite.Test/TestRpcGenerator.cs
+0
-172
No files found.
.hgignore
View file @
926f4dd3
...
...
@@ -9,6 +9,8 @@ _ReSharper.*
*.user
*.suo
lib/NUnit 2.2.8.0/nunit-console.exe.config
syntax: regexp
build/\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,5}/
build/Build.bat
→
build/Build
20
.bat
View file @
926f4dd3
@echo off
SET BUILD_TARGET=%1
SET BUILD_CONFIG=%2
SET BUILD_TARGET=%
~
1
SET BUILD_CONFIG=%
~
2
IF "%BUILD_TARGET%"=="" SET BUILD_TARGET=Rebuild
IF "%BUILD_CONFIG%"=="" SET BUILD_CONFIG=Debug
CMD.exe /Q /C "CD %~dp0 && %WINDIR%\Microsoft.NET\Framework\v4.0.30319\MSBuild.exe build.csproj %3 %4 %5 %6 /t:%BUILD_TARGET% /p:BuildConfiguration=%BUILD_CONFIG% /p:Platform="Any CPU" /p:BuildTools=4.0 /toolsversion:4.0"
pause
\ No newline at end of file
CMD.exe /Q /C "CD %~dp0 && %WINDIR%\Microsoft.NET\Framework\v4.0.30319\MSBuild.exe build.csproj /toolsversion:4.0 %3 %4 %5 %6 "/t:%BUILD_TARGET%" "/p:BuildConfiguration=%BUILD_CONFIG%;TargetVersion=2"
build/BuildAll.bat
View file @
926f4dd3
@ECHO OFF
SET PREV_WORKING_DIR=%CD%
CD %~dp0
REM -- 3.5 Debug build, ensure this continues to work
%WINDIR%\Microsoft.NET\Framework\v3.5\MSBuild.exe build.csproj /t:Rebuild /p:BuildConfiguration=Debug /p:Platform="Any CPU" /p:BuildTools=3.5 /toolsversion:3.5"
IF ERRORLEVEL 1 GOTO ERROR
REM -- 4.0 Debug build
%WINDIR%\Microsoft.NET\Framework\v4.0.30319\msbuild build.csproj /m /t:Rebuild /p:BuildConfiguration=Debug /p:Platform="Any CPU"
IF ERRORLEVEL 1 GOTO ERROR
REM -- 4.0 Release build
%WINDIR%\Microsoft.NET\Framework\v4.0.30319\msbuild build.csproj /m /t:Rebuild /p:BuildConfiguration=Release /p:Platform="Any CPU"
IF ERRORLEVEL 1 GOTO ERROR
IF EXIST "%ProgramFiles%\MSBuild\Microsoft\Silverlight\v2.0\Microsoft.Silverlight.CSharp.targets" GOTO SILVERLIGHT
IF EXIST "%ProgramFiles(x86)%\MSBuild\Microsoft\Silverlight\v2.0\Microsoft.Silverlight.CSharp.targets" GOTO SILVERLIGHT
ECHO Unable to locate %ProgramFiles(x86)%\MSBuild\Microsoft\Silverlight\v2.0
GOTO ERROR
:SILVERLIGHT
REM -- 4.0 Debug_Silverlight2 build
%WINDIR%\Microsoft.NET\Framework\v4.0.30319\msbuild build.csproj /m /t:Rebuild /p:BuildConfiguration=Debug_Silverlight2 /p:Platform="Any CPU"
IF ERRORLEVEL 1 GOTO ERROR
REM -- 4.0 Release_Silverlight2 build
%WINDIR%\Microsoft.NET\Framework\v4.0.30319\msbuild build.csproj /m /t:Rebuild /p:BuildConfiguration=Release_Silverlight2 /p:Platform="Any CPU"
IF ERRORLEVEL 1 GOTO ERROR
GOTO END
:ERROR
CD %PREV_WORKING_DIR%
PAUSE
:END
CD %PREV_WORKING_DIR%
SET PREV_WORKING_DIR=
\ No newline at end of file
@echo off
CMD.exe /Q /C "CD %~dp0 && %WINDIR%\Microsoft.NET\Framework\v4.0.30319\MSBuild.exe build.csproj /t:FullBuild /toolsversion:4.0 %1 %2 %3 %4 %5 %6
build/BuildSilverlight2.bat
View file @
926f4dd3
@echo off
%WINDIR%\Microsoft.NET\Framework\v4.0.30319\msbuild build.csproj /m /t:Build /p:BuildConfiguration=Debug_Silverlight2 /p:Platform="Any CPU"
pause
\ No newline at end of file
CMD.exe /Q /C "CD %~dp0 && %WINDIR%\Microsoft.NET\Framework\v4.0.30319\MSBuild.exe build.csproj /toolsversion:4.0 /t:Rebuild %1 %2 %3 %4 "/p:BuildConfiguration=Debug_Silverlight;TargetVersion=2"
build/Common.targets
View file @
926f4dd3
...
...
@@ -2,10 +2,43 @@
<Project
ToolsVersion=
"4.0"
xmlns=
"http://schemas.microsoft.com/developer/msbuild/2003"
>
<!-- **********************************************************************************************
Targets For FullBuild
*********************************************************************************************** -->
<Target
Name=
"_FullBuild"
DependsOnTargets=
"_CleanOutputDirectory;_BuildProtoGen;_GenerateSource;_CopyGeneratedSource"
>
<MSBuild
Projects=
"$(MSBuildProjectFullPath)"
Properties=
"SolutionTarget=Rebuild;TargetVersion=2"
Targets=
"_BuildAllConfigurations"
/>
<MSBuild
Projects=
"$(MSBuildProjectFullPath)"
Properties=
"SolutionTarget=Rebuild;TargetVersion=3"
Targets=
"_BuildAllConfigurations"
/>
<MSBuild
Projects=
"$(MSBuildProjectFullPath)"
Properties=
"SolutionTarget=Rebuild;TargetVersion=4"
Targets=
"_BuildAllConfigurations"
/>
</Target>
<Target
Name=
"_BuildAllConfigurations"
>
<!-- Release Package -->
<MSBuild
Projects=
"$(MSBuildProjectFullPath)"
Properties=
"SolutionTarget=Rebuild;Platform=$(Platform);TargetVersion=$(TargetVersion);BuildConfiguration=Release"
Targets=
"_BuildConfiguration"
/>
<MSBuild
Projects=
"$(MSBuildProjectFullPath)"
Properties=
"SolutionTarget=Rebuild;Platform=$(Platform);TargetVersion=$(TargetVersion);BuildConfiguration=Release_Silverlight"
Targets=
"_BuildConfiguration"
/>
<MSBuild
Projects=
"$(MSBuildProjectFullPath)"
Properties=
"SolutionTarget=Rebuild;Platform=$(Platform);TargetVersion=$(TargetVersion);PackageName=Release-$(ForcedFrameworkVersion)"
Targets=
"_GeneratePackage"
/>
<!-- Full Package -->
<MSBuild
Projects=
"$(MSBuildProjectFullPath)"
Properties=
"SolutionTarget=Rebuild;Platform=$(Platform);TargetVersion=$(TargetVersion);BuildConfiguration=Debug"
Targets=
"_BuildConfiguration"
/>
<MSBuild
Projects=
"$(MSBuildProjectFullPath)"
Properties=
"SolutionTarget=Rebuild;Platform=$(Platform);TargetVersion=$(TargetVersion);BuildConfiguration=Debug_Silverlight"
Targets=
"_BuildConfiguration"
/>
<MSBuild
Projects=
"$(MSBuildProjectFullPath)"
Properties=
"SolutionTarget=Rebuild;Platform=$(Platform);TargetVersion=$(TargetVersion);PackageName=Full-$(ForcedFrameworkVersion)"
Targets=
"_GeneratePackage"
/>
</Target>
<Target
Name=
"_BuildConfiguration"
DependsOnTargets=
"_ReportConfig;_Clean;_BuildSolution;_Test;_PreparePackageComponent"
/>
<Target
Name=
"_ReportConfig"
>
<Message
Importance=
"high"
Text=
"
Building $(BuildConfiguration) configuration for .NET Framework $(ForcedFrameworkVersion) $(Platform)"
/>
</Target>
<!-- **********************************************************************************************
Targets For Build
*********************************************************************************************** -->
<Target
Name=
"_BuildSolution"
>
<Message
Text=
"Running $(SolutionTarget) $(BuildConfiguration) with $(BuildTools) on $(SolutionFile)"
Importance=
"normal"
/>
<MSBuild
Targets=
"$(SolutionTarget)"
Projects=
"$(SolutionFile)"
ToolsVersion=
"$(BuildTools)"
Properties=
"Configuration=$(BuildConfiguration);
$(ForcedFrameworkVersion)TreatWarningsAsErrors=true;
"
Properties=
"Configuration=$(BuildConfiguration);
Platform=$(Platform);TargetFrameworkVersion=$(ForcedFrameworkVersion);TreatWarningsAsErrors=true;SilverlightVersion=$(SilverlightVersion)
"
/>
</Target>
...
...
@@ -13,73 +46,119 @@
<RemoveDir
Directories=
"@(WorkingDirectories)"
Condition=
"Exists(%(WorkingDirectories.Identity))"
/>
<MakeDir
Directories=
"@(WorkingDirectories)"
/>
<MSBuild
Projects=
"$(MSBuildProjectFullPath)"
Properties=
"SolutionTarget=Clean;BuildConfiguration=$(BuildConfiguration)"
Targets=
"_BuildSolution"
ContinueOnError=
"true"
/>
<MSBuild
Projects=
"$(MSBuildProjectFullPath)"
Properties=
"SolutionTarget=Clean;BuildConfiguration=$(BuildConfiguration)
;Platform=$(Platform)
"
Targets=
"_BuildSolution"
ContinueOnError=
"true"
/>
</Target>
<Target
Name=
"_Compile"
>
<MSBuild
Projects=
"$(MSBuildProjectFullPath)"
Properties=
"SolutionTarget=Rebuild;BuildConfiguration=$(BuildConfiguration)"
Targets=
"_BuildSolution"
/>
<MSBuild
Projects=
"$(MSBuildProjectFullPath)"
Properties=
"SolutionTarget=Rebuild;BuildConfiguration=$(BuildConfiguration);Platform=$(Platform)"
Targets=
"_BuildSolution"
/>
</Target>
<Target
Name=
"Requires20"
>
<Error
Text=
"Must be run with TargetVersion=2"
Condition=
" '$(TargetVersion)' != '2' "
/>
</Target>
<Target
Name=
"RequiresRelease"
>
<Error
Text=
"Must be run with BuildConfiguration=Release"
Condition=
" '$(BuildConfiguration)' != 'Release' "
/>
</Target>
<Target
Name=
"_CompileGeneratedSource"
DependsOnTargets=
"_CopyGeneratedSource"
>
<MSBuild
Projects=
"$(MSBuildProjectFullPath)"
Properties=
"Step=Two;SolutionTarget=Build;BuildConfiguration=$(BuildConfiguration)"
Targets=
"_BuildSolution"
/>
<!-- **********************************************************************************************
Targets For GenerateSource
*********************************************************************************************** -->
<Target
Name=
"_BuildProtoGen"
>
<MSBuild
Targets=
"Build"
ToolsVersion=
"3.5"
Projects=
"$(ProjectDirectory)\src\ProtocolBuffers\ProtocolBuffers.csproj;$(ProjectDirectory)\src\ProtoGen\ProtoGen.csproj"
Properties=
"Step=_BuildProtoGen;Configuration=Release;Platform=AnyCPU;TargetFrameworkVersion=v2.0;DebugType=none;DocumentationFile=;TreatWarningsAsErrors=true;OutputPath=$(BuildOutputDirectory)\ProtoGen;"
/>
</Target>
<Target
Name=
"_CleanTempSource"
>
<Message
Importance=
"normal"
Text=
"Cleaning source directory $(SourceTempDirectory)"
/>
<RemoveDir
Directories=
"$(SourceTempDirectory)"
Condition=
"Exists($(SourceTempDirectory))"
/>
<MakeDir
Directories=
"$(SourceTempDirectory)"
/>
</Target>
<Target
Name=
"_GenerateSource"
>
<Exec
Command=
"$(ProtocExePath) --proto_path=$(ProtosDirectory) --descriptor_set_out=compiled.pb @(Protos->'%(RelativeDir)%(Filename)%(Extension)', ' ')"
WorkingDirectory=
"$(BuildTempDirectory)"
/>
<Exec
Command=
"$(ProtogenExePath) compiled.pb"
WorkingDirectory=
"$(BuildTempDirectory)"
/>
<Target
Name=
"_GenerateSource"
DependsOnTargets=
"_CleanTempSource"
>
<Message
Importance=
"high"
Text=
"Generating source from proto files"
/>
<Exec
Command=
"$(ProtocExePath) --proto_path=$(ProtosDirectory) --descriptor_set_out=compiled.pb @(Protos->'%(RelativeDir)%(Filename)%(Extension)', ' ')"
WorkingDirectory=
"$(SourceTempDirectory)"
/>
<Exec
Command=
"$(ProtogenExePath) compiled.pb"
WorkingDirectory=
"$(SourceTempDirectory)"
/>
<!-- Generate the AddressBookProtos.cs directly -->
<Exec
Command=
"$(ProtogenExePath) --protoc_dir=$(LibDirectory) --proto_path=$(ProtosDirectory) $(ProtosDirectory)\tutorial\addressbook.proto -namespace=Google.ProtocolBuffers.Examples.AddressBook -umbrella_classname=AddressBookProtos"
WorkingDirectory=
"$(
Build
TempDirectory)"
/>
<Exec
Command=
"$(ProtogenExePath) --protoc_dir=$(LibDirectory) --proto_path=$(ProtosDirectory) $(ProtosDirectory)\tutorial\addressbook.proto -namespace=Google.ProtocolBuffers.Examples.AddressBook -umbrella_classname=AddressBookProtos"
WorkingDirectory=
"$(
Source
TempDirectory)"
/>
</Target>
<Target
Name=
"_CopyGeneratedSource"
DependsOnTargets=
"_GenerateSource"
>
<Copy
SourceFiles=
"%(GeneratedSource.Identity)"
DestinationFiles=
"%(GeneratedSource.TargetDirectory)\%(GeneratedSource.Filename)%(GeneratedSource.Extension)"
/>
</Target>
<Target
Name=
"_Test"
DependsOnTargets=
"_CompileGeneratedSource"
Condition=
"$(BuildConfiguration)=='Debug' or $(BuildConfiguration)=='Release'"
>
<!-- **********************************************************************************************
Targets For Test
*********************************************************************************************** -->
<Target
Name=
"_Test"
Condition=
"$(BuildConfiguration)=='Debug' or $(BuildConfiguration)=='Release'"
>
<CallTarget
Targets=
"_RunTests"
/>
</Target>
<Target
Name=
"_RunTests"
>
<Exec
Command=
""$(NUnitExePath)" /noshadow %(TestContainer.Identity) /xml:$(BuildTempDirectory)\..\%(TestContainer.Filename).$(BuildConfiguration).xml"
/>
<Copy
SourceFiles=
"$(NUnitExeConfig)"
DestinationFiles=
"$(NUnitExePath).config"
/>
<Exec
Command=
""$(NUnitExePath)" /nologo /noshadow %(TestContainer.Identity) /xml:$(BuildTempDirectory)\%(TestContainer.Filename).$(BuildConfiguration).xml"
/>
</Target>
<!--## Package Generation ##-->
<!-- **********************************************************************************************
Targets For Package
*********************************************************************************************** -->
<Target
Name=
"_CleanOutputDirectory"
>
<RemoveDir
Directories=
"$(
ProjectDirectory)\build_output\Package
"
ContinueOnError=
"true"
/>
<RemoveDir
Directories=
"$(
ProjectDirectory)\build_output
"
ContinueOnError=
"true"
/>
<MakeDir
Directories=
"$(
ProjectDirectory)\build_output
"
ContinueOnError=
"true"
/>
<RemoveDir
Directories=
"$(
BuildOutputPackage)
"
ContinueOnError=
"true"
/>
<RemoveDir
Directories=
"$(
BuildOutputDirectory)
"
ContinueOnError=
"true"
/>
<MakeDir
Directories=
"$(
BuildOutputDirectory)
"
ContinueOnError=
"true"
/>
</Target>
<Target
Name=
"_PreparePackageComponent"
>
<Copy
SourceFiles=
"@(DynamicPackageItem)"
DestinationFolder=
"$(
ProjectDirectory)\build_output\Package
\$(BuildConfiguration)\%(DynamicPackageItem.TargetDirectory)\%(DynamicPackageItem.RecursiveDir)"
/>
<Copy
SourceFiles=
"@(DynamicPackageItem)"
DestinationFolder=
"$(
BuildOutputPackage)
\$(BuildConfiguration)\%(DynamicPackageItem.TargetDirectory)\%(DynamicPackageItem.RecursiveDir)"
/>
</Target>
<Target
Name=
"_GeneratePackage"
>
<Copy
SourceFiles=
"@(StaticPackageItem)"
DestinationFolder=
"$(
ProjectDirectory)\build_output\Package
\%(StaticPackageItem.TargetDirectory)\%(StaticPackageItem.RecursiveDir)"
/>
<Exec
Command=
""$(ZipExePath)" a -tzip ..\$(PackageName)
* -r"
WorkingDirectory=
"$(ProjectDirectory)\build_output\Package
"
/>
<Copy
SourceFiles=
"@(StaticPackageItem)"
DestinationFolder=
"$(
BuildOutputPackage)
\%(StaticPackageItem.TargetDirectory)\%(StaticPackageItem.RecursiveDir)"
/>
<Exec
Command=
""$(ZipExePath)" a -tzip ..\$(PackageName)
.zip * -r"
WorkingDirectory=
"$(BuildOutputPackage)
"
/>
</Target>
<!--## Benchmark ##-->
<Target
Name=
"_GenerateBenchmarkSource"
DependsOnTargets=
"_Clean;_Compile"
>
<!-- **********************************************************************************************
Targets For Benchmark
*********************************************************************************************** -->
<Target
Name=
"_GenerateBenchmarkSource"
>
<PropertyGroup>
<Args>
$(BenchmarkProtosDirectory)\google_size.proto $(BenchmarkProtosDirectory)\google_speed.proto
</Args>
</PropertyGroup>
<Exec
Command=
"$(ProtocExePath) --proto_path=$(BenchmarkProtosDirectory);$(ProtosDirectory) --include_imports=compiled.pb --descriptor_set_out=compiled.pb $(Args)"
WorkingDirectory=
"$(BuildTempDirectory)"
/>
<Exec
Command=
"$(ProtogenExePath) compiled.pb"
WorkingDirectory=
"$(BuildTempDirectory)"
/>
<Exec
Command=
"$(ProtocExePath) --proto_path=$(BenchmarkProtosDirectory);$(ProtosDirectory) --include_imports=compiled.pb --descriptor_set_out=compiled.pb $(Args)"
WorkingDirectory=
"$(SourceTempDirectory)"
/>
<Exec
Command=
"$(ProtogenExePath) compiled.pb"
WorkingDirectory=
"$(SourceTempDirectory)"
/>
</Target>
<Target
Name=
"_CompileBenchmarkAssemblyInFramework20"
Condition=
" '$(MSBuildToolsVersion)' != '2.0' "
>
<MSBuild
Projects=
"$(MSBuildProjectFullPath)"
Properties=
"SolutionTarget=Rebuild;BuildConfiguration=$(BuildConfiguration);Platform=$(Platform)"
Targets=
"_CompileBenchmarkAssembly"
ToolsVersion=
"2.0"
/>
</Target>
<Target
Name=
"_CompileBenchmarkAssembly"
DependsOnTargets=
"_GenerateBenchmarkSource"
>
<Error
Text=
"Must be run with Framework 2.0"
Condition=
" '$(MSBuildToolsVersion)' != '2.0' "
/>
<ItemGroup>
<BenchmarkSources
Include=
"$(
Build
TempDirectory)\GoogleSizeProtoFile.cs"
/>
<BenchmarkSources
Include=
"$(
Build
TempDirectory)\GoogleSpeedProtoFile.cs"
/>
<BenchmarkSources
Include=
"$(
Source
TempDirectory)\GoogleSizeProtoFile.cs"
/>
<BenchmarkSources
Include=
"$(
Source
TempDirectory)\GoogleSpeedProtoFile.cs"
/>
<BenchmarkSources
Include=
"$(SourceDirectory)\ProtoBench\Properties\AssemblyInfo.cs"
/>
</ItemGroup>
<Csc
TargetType=
"library"
OutputAssembly=
"$(BuildTempDirectory)\BenchmarkTypes.dll"
Optimize=
"true"
Sources=
"@(BenchmarkSources)"
References=
"$(SourceDirectory)\ProtocolBuffers\bin\$(BuildConfiguration)\Google.ProtocolBuffers.dll"
/>
<Csc
TargetType=
"library"
OutputAssembly=
"$(BuildTempDirectory)\BenchmarkTypes.dll"
Optimize=
"true"
Sources=
"@(BenchmarkSources)"
References=
"$(SourceDirectory)\ProtocolBuffers\bin\$(BuildConfiguration)\Google.ProtocolBuffers.dll"
/>
</Target>
<Target
Name=
"_PrepareBenchmarkEnvironment"
DependsOnTargets=
"_CompileBenchmarkAssembly"
>
<Target
Name=
"_PrepareBenchmarkEnvironment"
DependsOnTargets=
"_CompileBenchmarkAssembly
InFramework20
"
>
<ItemGroup>
<BenchmarkResources
Include=
"$(BenchmarkProtosDirectory)\google_message1.dat"
/>
<BenchmarkResources
Include=
"$(BenchmarkProtosDirectory)\google_message2.dat"
/>
...
...
@@ -93,7 +172,6 @@
<Target
Name=
"_RunBenchmarks"
DependsOnTargets=
"_PrepareBenchmarkEnvironment"
>
<ItemGroup>
<BenchmarkParameter
Include=
"/v2"
/>
<BenchmarkParameter
Include=
"Google.ProtocolBuffers.ProtoBench.SizeMessage1,BenchmarkTypes"
/>
<BenchmarkParameter
Include=
"google_message1.dat"
/>
<BenchmarkParameter
Include=
"Google.ProtocolBuffers.ProtoBench.SpeedMessage1,BenchmarkTypes"
/>
...
...
@@ -104,12 +182,10 @@
<BenchmarkParameter
Include=
"google_message2.dat"
/>
</ItemGroup>
<PropertyGroup>
<BenchmarkParameterList>
@(BenchmarkParameter)
</BenchmarkParameterList>
<Args>
$(BenchmarkParameterList.Replace(`;`,` `))
</Args>
</PropertyGroup>
<Message
Text=
"Running $(ProtoBenchExePath) from $(BuildTempDirectory)"
/>
<Exec
Command=
""$(ProtoBenchExePath)" $(BenchmarkArgs) @(BenchmarkParameter->'%(Identity)', ' ') "/log:$(BenchmarkOutputFile)""
WorkingDirectory=
"$(BuildTempDirectory)"
/>
<Exec
Command=
""$(ProtoBenchExePath)" @(BenchmarkParameter->'%(Identity)', ' ') > "$(BuildTempDirectory)\..\BenchmarkResults.txt""
WorkingDirectory=
"$(BuildTempDirectory)"
/>
</Target>
</Project>
\ No newline at end of file
build/GenerateCompletePackage.bat
deleted
100644 → 0
View file @
3ede2921
@ECHO OFF
%WINDIR%\Microsoft.NET\Framework\v4.0.30319\msbuild build.csproj /m /t:PrepareOutputDirectory
IF ERRORLEVEL 1 GOTO END
%WINDIR%\Microsoft.NET\Framework\v4.0.30319\msbuild build.csproj /m /t:Rebuild;PreparePackageComponent /p:BuildConfiguration=Debug /p:Platform="Any CPU" %PROTOBUF_KEY_FILE%
IF ERRORLEVEL 1 GOTO END
%WINDIR%\Microsoft.NET\Framework\v4.0.30319\msbuild build.csproj /m /t:Rebuild;PreparePackageComponent /p:BuildConfiguration=Debug_Silverlight2 /p:Platform="Any CPU" %PROTOBUF_KEY_FILE%
IF ERRORLEVEL 1 GOTO END
%WINDIR%\Microsoft.NET\Framework\v4.0.30319\msbuild build.csproj /m /t:Rebuild;PreparePackageComponent /p:BuildConfiguration=Release /p:Platform="Any CPU" %PROTOBUF_KEY_FILE%
IF ERRORLEVEL 1 GOTO END
%WINDIR%\Microsoft.NET\Framework\v4.0.30319\msbuild build.csproj /m /t:Rebuild;PreparePackageComponent /p:BuildConfiguration=Release_Silverlight2 /p:Platform="Any CPU" %PROTOBUF_KEY_FILE%
IF ERRORLEVEL 1 GOTO END
%WINDIR%\Microsoft.NET\Framework\v4.0.30319\msbuild build.csproj /m /t:GeneratePackage /p:PackageName=AllBinariesAndSource.zip /p:Platform="Any CPU"
:END
\ No newline at end of file
build/GenerateReleasePackage.bat
deleted
100644 → 0
View file @
3ede2921
@ECHO OFF
%WINDIR%\Microsoft.NET\Framework\v4.0.30319\msbuild build.csproj /m /t:PrepareOutputDirectory
IF ERRORLEVEL 1 GOTO END
%WINDIR%\Microsoft.NET\Framework\v4.0.30319\msbuild build.csproj /m /t:Rebuild;PreparePackageComponent /p:BuildConfiguration=Release /p:Platform="Any CPU" %PROTOBUF_KEY_FILE%
IF ERRORLEVEL 1 GOTO END
%WINDIR%\Microsoft.NET\Framework\v4.0.30319\msbuild build.csproj /m /t:Rebuild;PreparePackageComponent /p:BuildConfiguration=Release_Silverlight2 /p:Platform="Any CPU" %PROTOBUF_KEY_FILE%
IF ERRORLEVEL 1 GOTO END
%WINDIR%\Microsoft.NET\Framework\v4.0.30319\msbuild build.csproj /m /t:GeneratePackage /p:PackageName=ReleaseBinaries.zip /p:Platform="Any CPU"
:END
\ No newline at end of file
build/Google.ProtocolBuffers.nuspec
View file @
926f4dd3
...
...
@@ -43,16 +43,22 @@ Language Guide - http://code.google.com/apis/protocolbuffers/docs/proto.html
</metadata>
<files>
<!-- Release Binaries -->
<file
src=
"..\build_output\Package\Release\Google.ProtocolBuffers.???"
target=
"lib\net20"
/>
<file
src=
"..\build_output\Package\Release\Google.ProtocolBuffers.Serialization.???"
target=
"lib\net20"
/>
<file
src=
"..\build_output\v2.0\Release\Google.ProtocolBuffers.???"
target=
"lib\net20"
/>
<file
src=
"..\build_output\v2.0\Release\Google.ProtocolBuffers.Serialization.???"
target=
"lib\net20"
/>
<file
src=
"..\build_output\v3.5\Release\Google.ProtocolBuffers.???"
target=
"lib\net35"
/>
<file
src=
"..\build_output\v3.5\Release\Google.ProtocolBuffers.Serialization.???"
target=
"lib\net35"
/>
<file
src=
"..\build_output\v4.0\Release\Google.ProtocolBuffers.???"
target=
"lib\net40"
/>
<file
src=
"..\build_output\v4.0\Release\Google.ProtocolBuffers.Serialization.???"
target=
"lib\net40"
/>
<!-- Silverlight Binaries -->
<file
src=
"..\build_output\Package\Release_Silverlight2\Google.ProtocolBuffers.???"
target=
"lib\sl20"
/>
<file
src=
"..\build_output\Package\Release_Silverlight2\Google.ProtocolBuffers.Serialization.???"
target=
"lib\sl20"
/>
<file
src=
"..\build_output\v2.0\Release_Silverlight\Google.ProtocolBuffers.???"
target=
"lib\sl20"
/>
<file
src=
"..\build_output\v2.0\Release_Silverlight\Google.ProtocolBuffers.Serialization.???"
target=
"lib\sl20"
/>
<file
src=
"..\build_output\v3.5\Release_Silverlight\Google.ProtocolBuffers.???"
target=
"lib\sl30"
/>
<file
src=
"..\build_output\v3.5\Release_Silverlight\Google.ProtocolBuffers.Serialization.???"
target=
"lib\sl30"
/>
<file
src=
"..\build_output\v4.0\Release_Silverlight\Google.ProtocolBuffers.???"
target=
"lib\sl40"
/>
<file
src=
"..\build_output\v4.0\Release_Silverlight\Google.ProtocolBuffers.Serialization.???"
target=
"lib\sl40"
/>
<!-- Tools -->
<file
src=
"..\lib\Protoc.exe"
target=
"tools"
/>
<file
src=
"..\build_output\Package\Release\Google.ProtocolBuffers.dll"
target=
"tools"
/>
<file
src=
"..\build_output\Package\Release\ProtoGen.exe"
target=
"tools"
/>
<file
src=
"..\build_output\Package\Release\ProtoGen.exe.config"
target=
"tools"
/>
<file
src=
"..\build_output\ProtoGen\*"
target=
"tools"
/>
<!-- Content -->
<file
src=
"..\CHANGES.txt"
target=
"content"
/>
<file
src=
"..\license.txt"
target=
"content\licenses"
/>
...
...
build/Google.ProtocolBuffersLite.nuspec
View file @
926f4dd3
...
...
@@ -43,16 +43,22 @@ Language Guide - http://code.google.com/apis/protocolbuffers/docs/proto.html
</metadata>
<files>
<!-- Release Binaries -->
<file
src=
"..\build_output\Package\Release\Google.ProtocolBuffersLite.???"
target=
"lib\net20"
/>
<file
src=
"..\build_output\Package\Release\Google.ProtocolBuffersLite.Serialization.???"
target=
"lib\net20"
/>
<file
src=
"..\build_output\v2.0\Release\Google.ProtocolBuffersLite.???"
target=
"lib\net20"
/>
<file
src=
"..\build_output\v2.0\Release\Google.ProtocolBuffersLite.Serialization.???"
target=
"lib\net20"
/>
<file
src=
"..\build_output\v3.5\Release\Google.ProtocolBuffersLite.???"
target=
"lib\net35"
/>
<file
src=
"..\build_output\v3.5\Release\Google.ProtocolBuffersLite.Serialization.???"
target=
"lib\net35"
/>
<file
src=
"..\build_output\v4.0\Release\Google.ProtocolBuffersLite.???"
target=
"lib\net40"
/>
<file
src=
"..\build_output\v4.0\Release\Google.ProtocolBuffersLite.Serialization.???"
target=
"lib\net40"
/>
<!-- Silverlight Binaries -->
<file
src=
"..\build_output\Package\Release_Silverlight2\Google.ProtocolBuffersLite.???"
target=
"lib\sl20"
/>
<file
src=
"..\build_output\Package\Release_Silverlight2\Google.ProtocolBuffersLite.Serialization.???"
target=
"lib\sl20"
/>
<file
src=
"..\build_output\v2.0\Release_Silverlight\Google.ProtocolBuffersLite.???"
target=
"lib\sl20"
/>
<file
src=
"..\build_output\v2.0\Release_Silverlight\Google.ProtocolBuffersLite.Serialization.???"
target=
"lib\sl20"
/>
<file
src=
"..\build_output\v3.5\Release_Silverlight\Google.ProtocolBuffersLite.???"
target=
"lib\sl30"
/>
<file
src=
"..\build_output\v3.5\Release_Silverlight\Google.ProtocolBuffersLite.Serialization.???"
target=
"lib\sl30"
/>
<file
src=
"..\build_output\v4.0\Release_Silverlight\Google.ProtocolBuffersLite.???"
target=
"lib\sl40"
/>
<file
src=
"..\build_output\v4.0\Release_Silverlight\Google.ProtocolBuffersLite.Serialization.???"
target=
"lib\sl40"
/>
<!-- Tools -->
<file
src=
"..\lib\Protoc.exe"
target=
"tools"
/>
<file
src=
"..\build_output\Package\Release\Google.ProtocolBuffers.dll"
target=
"tools"
/>
<file
src=
"..\build_output\Package\Release\ProtoGen.exe"
target=
"tools"
/>
<file
src=
"..\build_output\Package\Release\ProtoGen.exe.config"
target=
"tools"
/>
<file
src=
"..\build_output\ProtoGen\*"
target=
"tools"
/>
<!-- Content -->
<file
src=
"..\CHANGES.txt"
target=
"content"
/>
<file
src=
"..\license.txt"
target=
"content\licenses"
/>
...
...
build/PublishRelease.bat
View file @
926f4dd3
...
...
@@ -22,19 +22,24 @@ CMD.exe /Q /C "CD .. && lib\StampVersion.exe /major:2 /minor:4 /build:1 /revisio
IF EXIST "C:\Program Files\Microsoft SDKs\Windows\v7.0\Bin\sn.exe" SET WIN7SDK_DIR=C:\Program Files\Microsoft SDKs\Windows\v7.0\Bin\
IF NOT EXIST "..\release-key" hg clone https://bitbucket.org/rknapp/protobuf-csharp-port-keyfile ..\release-key
SET PROTOBUF_KEY_FILE="/p:AssemblyOriginatorKeyFile=%~dp0..\release-key\Google.ProtocolBuffers.snk"
MD "%2"
CMD.exe /Q /C "GenerateCompletePackage.bat"
COPY /y ..\build_output\AllBinariesAndSource.zip %2\protobuf-csharp-port-%2-full-binaries.zip
CMD.exe /Q /C "GenerateReleasePackage.bat"
COPY /y ..\build_output\ReleaseBinaries.zip %2\protobuf-csharp-port-%2-release-binaries.zip
CMD.exe /Q /C "BuildAll.bat /verbosity:minimal "/p:AssemblyOriginatorKeyFile=%~dp0..\release-key\Google.ProtocolBuffers.snk"
COPY /y ..\build_output\Release-v2.0.zip %2\protobuf-csharp-port-%2-net20-release-binaries.zip
COPY /y ..\build_output\Release-v3.5.zip %2\protobuf-csharp-port-%2-net35-release-binaries.zip
COPY /y ..\build_output\Release-v4.0.zip %2\protobuf-csharp-port-%2-net40-release-binaries.zip
COPY /y ..\build_output\Full-v2.0.zip %2\protobuf-csharp-port-%2-net20-full-binaries.zip
COPY /y ..\build_output\Full-v3.5.zip %2\protobuf-csharp-port-%2-net35-full-binaries.zip
COPY /y ..\build_output\Full-v4.0.zip %2\protobuf-csharp-port-%2-net40-full-binaries.zip
..\lib\NuGet.exe pack Google.ProtocolBuffers.nuspec -Symbols -Version %2 -NoPackageAnalysis -OutputDirectory %2
..\lib\NuGet.exe pack Google.ProtocolBuffersLite.nuspec -Symbols -Version %2 -NoPackageAnalysis -OutputDirectory %2
hg archive %2\protobuf-csharp-port-%2-source.zip
SET PROTOBUF_KEY_FILE=
"%WIN7SDK_DIR%sn.exe" -T ..\build_output\Package\Release\Google.ProtocolBuffers.dll
"%WIN7SDK_DIR%sn.exe" -T ..\build_output\v2.0\Release\Google.ProtocolBuffers.dll
@ECHO.
@ECHO ***********************************************************
@ECHO IMPORTANT: Verify the above key output is: 55f7125234beb589
...
...
@@ -61,8 +66,12 @@ hg push
SET GOOGLEUPLOAD=python.exe googlecode_upload.py --project protobuf-csharp-port --user "%3" --password "%4"
%GOOGLEUPLOAD% --labels Type-Source,Featured --summary "Version %2 source" %2\protobuf-csharp-port-%2-source.zip
%GOOGLEUPLOAD% --labels Type-Executable,Featured --summary "Version %2 binaries (all configurations)" %2\protobuf-csharp-port-%2-full-binaries.zip
%GOOGLEUPLOAD% --labels Type-Executable,Featured --summary "Version %2 binaries (release only)" %2\protobuf-csharp-port-%2-release-binaries.zip
%GOOGLEUPLOAD% --labels Type-Executable,Featured --summary "Version %2 binaries for .NET 2.0 (all configurations)" %2\protobuf-csharp-port-%2-net20-full-binaries.zip
%GOOGLEUPLOAD% --labels Type-Executable,Featured --summary "Version %2 binaries for .NET 3.5 (all configurations)" %2\protobuf-csharp-port-%2-net35-full-binaries.zip
%GOOGLEUPLOAD% --labels Type-Executable,Featured --summary "Version %2 binaries for .NET 4.0 (all configurations)" %2\protobuf-csharp-port-%2-net40-full-binaries.zip
%GOOGLEUPLOAD% --labels Type-Executable,Featured --summary "Version %2 binaries for .NET 2.0 (release only)" %2\protobuf-csharp-port-%2-net20-release-binaries.zip
%GOOGLEUPLOAD% --labels Type-Executable,Featured --summary "Version %2 binaries for .NET 3.5 (release only)" %2\protobuf-csharp-port-%2-net35-release-binaries.zip
%GOOGLEUPLOAD% --labels Type-Executable,Featured --summary "Version %2 binaries for .NET 4.0 (release only)" %2\protobuf-csharp-port-%2-net40-release-binaries.zip
@SET GOOGLEUPLOAD=
@ECHO.
...
...
build/RunBenchmarks.bat
View file @
926f4dd3
@echo off
%WINDIR%\Microsoft.NET\Framework\v4.0.30319\msbuild %~dp0\build.csproj /m /t:RunBenchmarks /p:BuildConfiguration=Release /p:Platform="Any CPU"
pause
\ No newline at end of file
CMD.exe /Q /C "CD %~dp0 && %WINDIR%\Microsoft.NET\Framework\v4.0.30319\MSBuild.exe build.csproj /toolsversion:4.0 /t:RunBenchmarks %1 %2 %3 %4 "/p:BuildConfiguration=Release;TargetVersion=2"
build/build.csproj
View file @
926f4dd3
...
...
@@ -4,29 +4,45 @@
<PropertyGroup>
<ProjectName>
Protocol Buffers
</ProjectName>
<BuildConfiguration
Condition=
" '$(BuildConfiguration)' == '' "
>
Error
</BuildConfiguration>
<BuildTools
Condition=
" '$(BuildTools)' == '' "
>
4.0
</BuildTools>
<ForcedFrameworkVersion
Condition=
" '$(BuildTools)' == '3.5' "
>
TargetFrameworkVersion=v2.0;
</ForcedFrameworkVersion>
<Platform>
Any CPU
</Platform>
<!-- BuildToolsVersion -->
<BuildTools>
3.5
</BuildTools>
<BuildTools
Condition=
" '$(TargetVersion)' == '4' "
>
4.0
</BuildTools>
<!-- TargetFrameworkVersion -->
<ForcedFrameworkVersion>
v2.0
</ForcedFrameworkVersion>
<ForcedFrameworkVersion
Condition=
" '$(TargetVersion)' == '3' "
>
v3.5
</ForcedFrameworkVersion>
<ForcedFrameworkVersion
Condition=
" '$(TargetVersion)' == '4' "
>
v4.0
</ForcedFrameworkVersion>
<TargetFrameworkVersion>
$(ForcedFrameworkVersion)
</TargetFrameworkVersion>
<!-- SilverlightVersion -->
<SilverlightVersion>
v2.0
</SilverlightVersion>
<SilverlightVersion
Condition=
" '$(TargetVersion)' == '3' "
>
v3.0
</SilverlightVersion>
<SilverlightVersion
Condition=
" '$(TargetVersion)' == '4' "
>
v4.0
</SilverlightVersion>
<!--Directory Paths-->
<ProjectDirectory>
$(MSBuildProjectDirectory)\..
</ProjectDirectory>
<SourceDirectory>
$(ProjectDirectory)\src
</SourceDirectory>
<LibDirectory>
$(ProjectDirectory)\lib
</LibDirectory>
<ProtosDirectory>
$(ProjectDirectory)\protos
</ProtosDirectory>
<SourceTempDirectory>
$(ProjectDirectory)\build_temp\GeneratedSource
</SourceTempDirectory>
<BuildTempDirectory>
$(ProjectDirectory)\build_temp\$(BuildConfiguration)$(TargetVersion)
</BuildTempDirectory>
<BuildOutputDirectory>
$(ProjectDirectory)\build_output
</BuildOutputDirectory>
<BuildOutputPackage>
$(BuildOutputDirectory)\$(ForcedFrameworkVersion)
</BuildOutputPackage>
<BenchmarkArgs>
/v2 /fast /formats
</BenchmarkArgs>
<BenchmarkOutputFile>
$(BuildTempDirectory)\..\BenchmarkResults.txt
</BenchmarkOutputFile>
<BenchmarkProtosDirectory>
$(ProjectDirectory)\benchmarks
</BenchmarkProtosDirectory>
<BuildTempDirectory>
$(ProjectDirectory)\build_temp\$(BuildConfiguration)
</BuildTempDirectory>
<BuildOutputDirectory>
$(ProjectDirectory)\build_output\$(BuildConfiguration)
</BuildOutputDirectory>
<PackageName
Condition=
" '$(PackageName)' == '' "
>
$(BuildConfiguration)
</PackageName>
<!--File Paths-->
<SolutionFile
Condition=
" '$(BuildTools)' == '4.0' "
>
$(SourceDirectory)\ProtocolBuffers.sln
</SolutionFile>
<SolutionFile
Condition=
" '$(BuildTools)' == '3.5' "
>
$(SourceDirectory)\ProtocolBuffers2008.sln
</SolutionFile>
<SolutionFile>
$(SourceDirectory)\ProtocolBuffers.sln
</SolutionFile>
<!--Tool Paths-->
<ProtocExePath>
$(LibDirectory)\protoc.exe
</ProtocExePath>
<ProtogenExePath>
$(
SourceDirectory)\ProtoGen\bin\$(BuildConfiguration)
\protogen.exe
</ProtogenExePath>
<ProtogenExePath>
$(
BuildOutputDirectory)\ProtoGen
\protogen.exe
</ProtogenExePath>
<ProtoBenchExePath>
$(BuildTempDirectory)\ProtoBench.exe
</ProtoBenchExePath>
<NUnitExePath>
$(LibDirectory)\NUnit 2.2.8.0\nunit-console.exe
</NUnitExePath>
<NUnitExeConfig>
$(LibDirectory)\NUnit 2.2.8.0\nunit-console.$(ForcedFrameworkVersion).config
</NUnitExeConfig>
<ZipExePath>
$(LibDirectory)\7-Zip 9.20\7za.exe
</ZipExePath>
</PropertyGroup>
...
...
@@ -34,7 +50,6 @@
<ItemGroup>
<WorkingDirectories
Include=
"$(BuildTempDirectory)"
/>
<WorkingDirectories
Include=
"$(BuildOutputDirectory)"
/>
<Protos
Include=
"$(ProtosDirectory)\extest\unittest_issues.proto"
/>
<Protos
Include=
"$(ProtosDirectory)\extest\unittest_extras.proto"
/>
...
...
@@ -62,92 +77,92 @@
<Protos
Include=
"$(ProtosDirectory)\google\test\google_speed.proto"
/>
<!-- Main protos -->
<GeneratedSource
Include=
"$(
Build
TempDirectory)\CSharpOptions.cs"
>
<GeneratedSource
Include=
"$(
Source
TempDirectory)\CSharpOptions.cs"
>
<TargetDirectory>
$(SourceDirectory)\ProtocolBuffers\DescriptorProtos
</TargetDirectory>
</GeneratedSource>
<GeneratedSource
Include=
"$(
Build
TempDirectory)\DescriptorProtoFile.cs"
>
<GeneratedSource
Include=
"$(
Source
TempDirectory)\DescriptorProtoFile.cs"
>
<TargetDirectory>
$(SourceDirectory)\ProtocolBuffers\DescriptorProtos
</TargetDirectory>
</GeneratedSource>
<!-- Address book sample -->
<GeneratedSource
Include=
"$(
Build
TempDirectory)\AddressBookProtos.cs"
>
<GeneratedSource
Include=
"$(
Source
TempDirectory)\AddressBookProtos.cs"
>
<TargetDirectory>
$(SourceDirectory)\AddressBook
</TargetDirectory>
</GeneratedSource>
<!-- Unit test -->
<GeneratedSource
Include=
"$(
Build
TempDirectory)\UnitTestExtrasProtoFile.cs"
>
<GeneratedSource
Include=
"$(
Source
TempDirectory)\UnitTestExtrasProtoFile.cs"
>
<TargetDirectory>
$(SourceDirectory)\ProtocolBuffers.Test\TestProtos
</TargetDirectory>
</GeneratedSource>
<GeneratedSource
Include=
"$(
Build
TempDirectory)\UnitTestExtrasIssuesProtoFile.cs"
>
<GeneratedSource
Include=
"$(
Source
TempDirectory)\UnitTestExtrasIssuesProtoFile.cs"
>
<TargetDirectory>
$(SourceDirectory)\ProtocolBuffers.Test\TestProtos
</TargetDirectory>
</GeneratedSource>
<GeneratedSource
Include=
"$(
Build
TempDirectory)\UnitTestXmlSerializerTestProtoFile.cs"
>
<GeneratedSource
Include=
"$(
Source
TempDirectory)\UnitTestXmlSerializerTestProtoFile.cs"
>
<TargetDirectory>
$(SourceDirectory)\ProtocolBuffers.Test\TestProtos
</TargetDirectory>
</GeneratedSource>
<GeneratedSource
Include=
"$(
Build
TempDirectory)\UnitTestCSharpOptionsProtoFile.cs"
>
<GeneratedSource
Include=
"$(
Source
TempDirectory)\UnitTestCSharpOptionsProtoFile.cs"
>
<TargetDirectory>
$(SourceDirectory)\ProtocolBuffers.Test\TestProtos
</TargetDirectory>
</GeneratedSource>
<GeneratedSource
Include=
"$(
Build
TempDirectory)\UnitTestCustomOptionsProtoFile.cs"
>
<GeneratedSource
Include=
"$(
Source
TempDirectory)\UnitTestCustomOptionsProtoFile.cs"
>
<TargetDirectory>
$(SourceDirectory)\ProtocolBuffers.Test\TestProtos
</TargetDirectory>
</GeneratedSource>
<GeneratedSource
Include=
"$(
Build
TempDirectory)\UnitTestEmbedOptimizeForProtoFile.cs"
>
<GeneratedSource
Include=
"$(
Source
TempDirectory)\UnitTestEmbedOptimizeForProtoFile.cs"
>
<TargetDirectory>
$(SourceDirectory)\ProtocolBuffers.Test\TestProtos
</TargetDirectory>
</GeneratedSource>
<GeneratedSource
Include=
"$(
Build
TempDirectory)\UnitTestEmptyProtoFile.cs"
>
<GeneratedSource
Include=
"$(
Source
TempDirectory)\UnitTestEmptyProtoFile.cs"
>
<TargetDirectory>
$(SourceDirectory)\ProtocolBuffers.Test\TestProtos
</TargetDirectory>
</GeneratedSource>
<GeneratedSource
Include=
"$(
Build
TempDirectory)\UnitTestImportLiteProtoFile.cs"
>
<GeneratedSource
Include=
"$(
Source
TempDirectory)\UnitTestImportLiteProtoFile.cs"
>
<TargetDirectory>
$(SourceDirectory)\ProtocolBuffers.Test\TestProtos
</TargetDirectory>
</GeneratedSource>
<GeneratedSource
Include=
"$(
Build
TempDirectory)\UnitTestImportProtoFile.cs"
>
<GeneratedSource
Include=
"$(
Source
TempDirectory)\UnitTestImportProtoFile.cs"
>
<TargetDirectory>
$(SourceDirectory)\ProtocolBuffers.Test\TestProtos
</TargetDirectory>
</GeneratedSource>
<GeneratedSource
Include=
"$(
Build
TempDirectory)\UnitTestMessageSetProtoFile.cs"
>
<GeneratedSource
Include=
"$(
Source
TempDirectory)\UnitTestMessageSetProtoFile.cs"
>
<TargetDirectory>
$(SourceDirectory)\ProtocolBuffers.Test\TestProtos
</TargetDirectory>
</GeneratedSource>
<GeneratedSource
Include=
"$(
Build
TempDirectory)\UnitTestNoGenericServicesProtoFile.cs"
>
<GeneratedSource
Include=
"$(
Source
TempDirectory)\UnitTestNoGenericServicesProtoFile.cs"
>
<TargetDirectory>
$(SourceDirectory)\ProtocolBuffers.Test\TestProtos
</TargetDirectory>
</GeneratedSource>
<GeneratedSource
Include=
"$(
Build
TempDirectory)\UnitTestOptimizeForProtoFile.cs"
>
<GeneratedSource
Include=
"$(
Source
TempDirectory)\UnitTestOptimizeForProtoFile.cs"
>
<TargetDirectory>
$(SourceDirectory)\ProtocolBuffers.Test\TestProtos
</TargetDirectory>
</GeneratedSource>
<GeneratedSource
Include=
"$(
Build
TempDirectory)\UnitTestProtoFile.cs"
>
<GeneratedSource
Include=
"$(
Source
TempDirectory)\UnitTestProtoFile.cs"
>
<TargetDirectory>
$(SourceDirectory)\ProtocolBuffers.Test\TestProtos
</TargetDirectory>
</GeneratedSource>
<GeneratedSource
Include=
"$(
Build
TempDirectory)\UnitTestRpcInterop.cs"
>
<GeneratedSource
Include=
"$(
Source
TempDirectory)\UnitTestRpcInterop.cs"
>
<TargetDirectory>
$(SourceDirectory)\ProtocolBuffers.Test\TestProtos
</TargetDirectory>
</GeneratedSource>
<GeneratedSource
Include=
"$(
Build
TempDirectory)\UnitTestRpcInteropLite.cs"
>
<GeneratedSource
Include=
"$(
Source
TempDirectory)\UnitTestRpcInteropLite.cs"
>
<TargetDirectory>
$(SourceDirectory)\ProtocolBuffersLite.Test\TestProtos
</TargetDirectory>
</GeneratedSource>
<GeneratedSource
Include=
"$(
Build
TempDirectory)\UnitTestGenericServices.cs"
>
<GeneratedSource
Include=
"$(
Source
TempDirectory)\UnitTestGenericServices.cs"
>
<TargetDirectory>
$(SourceDirectory)\ProtocolBuffers.Test\TestProtos
</TargetDirectory>
</GeneratedSource>
<!-- Lite unit test -->
<GeneratedSource
Include=
"$(
Build
TempDirectory)\UnitTestExtrasFullProtoFile.cs"
>
<GeneratedSource
Include=
"$(
Source
TempDirectory)\UnitTestExtrasFullProtoFile.cs"
>
<TargetDirectory>
$(SourceDirectory)\ProtocolBuffersLite.Test\TestProtos
</TargetDirectory>
</GeneratedSource>
<GeneratedSource
Include=
"$(
Build
TempDirectory)\UnitTestExtrasLiteProtoFile.cs"
>
<GeneratedSource
Include=
"$(
Source
TempDirectory)\UnitTestExtrasLiteProtoFile.cs"
>
<TargetDirectory>
$(SourceDirectory)\ProtocolBuffersLite.Test\TestProtos
</TargetDirectory>
</GeneratedSource>
<GeneratedSource
Include=
"$(
Build
TempDirectory)\UnitTestImportLiteProtoFile.cs"
>
<GeneratedSource
Include=
"$(
Source
TempDirectory)\UnitTestImportLiteProtoFile.cs"
>
<TargetDirectory>
$(SourceDirectory)\ProtocolBuffersLite.Test\TestProtos
</TargetDirectory>
</GeneratedSource>
<GeneratedSource
Include=
"$(
Build
TempDirectory)\UnitTestImportProtoFile.cs"
>
<GeneratedSource
Include=
"$(
Source
TempDirectory)\UnitTestImportProtoFile.cs"
>
<TargetDirectory>
$(SourceDirectory)\ProtocolBuffersLite.Test\TestProtos
</TargetDirectory>
</GeneratedSource>
<GeneratedSource
Include=
"$(
Build
TempDirectory)\UnitTestLiteImportNonLiteProtoFile.cs"
>
<GeneratedSource
Include=
"$(
Source
TempDirectory)\UnitTestLiteImportNonLiteProtoFile.cs"
>
<TargetDirectory>
$(SourceDirectory)\ProtocolBuffersLite.Test\TestProtos
</TargetDirectory>
</GeneratedSource>
<GeneratedSource
Include=
"$(
Build
TempDirectory)\UnitTestLiteProtoFile.cs"
>
<GeneratedSource
Include=
"$(
Source
TempDirectory)\UnitTestLiteProtoFile.cs"
>
<TargetDirectory>
$(SourceDirectory)\ProtocolBuffersLite.Test\TestProtos
</TargetDirectory>
</GeneratedSource>
<GeneratedSource
Include=
"$(
Build
TempDirectory)\UnitTestProtoFile.cs"
>
<GeneratedSource
Include=
"$(
Source
TempDirectory)\UnitTestProtoFile.cs"
>
<TargetDirectory>
$(SourceDirectory)\ProtocolBuffersLite.Test\TestProtos
</TargetDirectory>
</GeneratedSource>
<GeneratedSource
Include=
"$(
Build
TempDirectory)\UnitTestGoogleSizeProtoFile.cs"
>
<GeneratedSource
Include=
"$(
Source
TempDirectory)\UnitTestGoogleSizeProtoFile.cs"
>
<TargetDirectory>
$(SourceDirectory)\ProtocolBuffers.Test\TestProtos
</TargetDirectory>
</GeneratedSource>
<GeneratedSource
Include=
"$(
Build
TempDirectory)\UnitTestGoogleSpeedProtoFile.cs"
>
<GeneratedSource
Include=
"$(
Source
TempDirectory)\UnitTestGoogleSpeedProtoFile.cs"
>
<TargetDirectory>
$(SourceDirectory)\ProtocolBuffers.Test\TestProtos
</TargetDirectory>
</GeneratedSource>
...
...
@@ -167,8 +182,14 @@
<StaticPackageItem
Include=
"$(ProjectDirectory)\CHANGES.txt"
/>
<StaticPackageItem
Include=
"$(ProjectDirectory)\license.txt"
/>
<StaticPackageItem
Include=
"$(ProjectDirectory)\protos\**\*.*"
>
<TargetDirectory>
\protos
</TargetDirectory>
<StaticPackageItem
Include=
"$(ProjectDirectory)\protos\google\protobuf\descriptor.proto"
>
<TargetDirectory>
\protos\google\protobuf
</TargetDirectory>
</StaticPackageItem>
<StaticPackageItem
Include=
"$(ProjectDirectory)\protos\google\protobuf\csharp_options.proto"
>
<TargetDirectory>
\protos\google\protobuf
</TargetDirectory>
</StaticPackageItem>
<StaticPackageItem
Include=
"$(ProjectDirectory)\protos\tutorial\addressbook.proto"
>
<TargetDirectory>
\protos\tutorial
</TargetDirectory>
</StaticPackageItem>
<StaticPackageItem
Include=
"$(LibDirectory)\Protoc*"
>
<TargetDirectory>
\Protoc
</TargetDirectory>
...
...
@@ -178,14 +199,15 @@
<!-- targets -->
<Target
Name=
"Clean"
DependsOnTargets=
"_Clean"
/>
<Target
Name=
"Build"
DependsOnTargets=
"_Compile;_Test"
/>
<Target
Name=
"Build"
DependsOnTargets=
"
GenerateSource;
_Compile;_Test"
/>
<Target
Name=
"Test"
DependsOnTargets=
"_RunTests"
/>
<Target
Name=
"Rebuild"
DependsOnTargets=
"Clean;Build"
/>
<Target
Name=
"GenerateSource"
DependsOnTargets=
"_GenerateSource;_CopyGeneratedSource"
/>
<Target
Name=
"GenerateSource"
DependsOnTargets=
"_
BuildProtoGen;_
GenerateSource;_CopyGeneratedSource"
/>
<Target
Name=
"BuildPackage"
DependsOnTargets=
"PrepareOutputDirectory;PreparePackageComponent;GeneratePackage"
/>
<Target
Name=
"PrepareOutputDirectory"
DependsOnTargets=
"_CleanOutputDirectory"
/>
<Target
Name=
"PreparePackageComponent"
DependsOnTargets=
"_PreparePackageComponent"
/>
<Target
Name=
"GeneratePackage"
DependsOnTargets=
"_GeneratePackage"
/>
<Target
Name=
"RunBenchmarks"
DependsOnTargets=
"_RunBenchmarks"
/>
<Target
Name=
"RunBenchmarks"
DependsOnTargets=
"Requires20;RequiresRelease;Rebuild;_RunBenchmarks"
/>
<Target
Name=
"FullBuild"
DependsOnTargets=
"_FullBuild"
/>
</Project>
build/build35.bat
View file @
926f4dd3
@echo off
SET BUILD_TARGET=%1
SET BUILD_CONFIG=%2
SET BUILD_TARGET=%
~
1
SET BUILD_CONFIG=%
~
2
IF "%BUILD_TARGET%"=="" SET BUILD_TARGET=Rebuild
IF "%BUILD_CONFIG%"=="" SET BUILD_CONFIG=Debug
CMD.exe /Q /C "CD %~dp0 && %WINDIR%\Microsoft.NET\Framework\v
3.5\MSBuild.exe build.csproj %3 %4 %5 %6 /t:%BUILD_TARGET% /p:BuildConfiguration=%BUILD_CONFIG% /p:Platform="Any CPU" /p:BuildTools=3.5 /toolsversion:3.5
"
CMD.exe /Q /C "CD %~dp0 && %WINDIR%\Microsoft.NET\Framework\v
4.0.30319\MSBuild.exe build.csproj /toolsversion:4.0 %3 %4 %5 %6 "/t:%BUILD_TARGET%" "/p:BuildConfiguration=%BUILD_CONFIG%;TargetVersion=3
"
build/build40.bat
0 → 100644
View file @
926f4dd3
@echo off
SET BUILD_TARGET=%~1
SET BUILD_CONFIG=%~2
IF "%BUILD_TARGET%"=="" SET BUILD_TARGET=Rebuild
IF "%BUILD_CONFIG%"=="" SET BUILD_CONFIG=Debug
CMD.exe /Q /C "CD %~dp0 && %WINDIR%\Microsoft.NET\Framework\v4.0.30319\MSBuild.exe build.csproj /toolsversion:4.0 %3 %4 %5 %6 "/t:%BUILD_TARGET%" "/p:BuildConfiguration=%BUILD_CONFIG%;TargetVersion=4"
lib/NUnit 2.2.8.0/nunit-console.
exe
.config
→
lib/NUnit 2.2.8.0/nunit-console.
v2.0
.config
View file @
926f4dd3
<?
xml
version
=
"1.0"
encoding
=
"Windows-1252"
?>
<
configuration
>
<
startup
>
<
requiredRuntime
version
=
"v2.0.50727"
/>
</
startup
>
<!--
Application
settings
for
NUnit
-
console
.
exe
.
Do
NOT
put
settings
for
use
by
your
tests
here
.
...
...
lib/NUnit 2.2.8.0/nunit-console.v3.5.config
0 → 100644
View file @
926f4dd3
<?
xml
version
=
"1.0"
encoding
=
"Windows-1252"
?>
<
configuration
>
<
startup
>
<
requiredRuntime
version
=
"v2.0.50727"
/>
</
startup
>
<!--
Application
settings
for
NUnit
-
console
.
exe
.
Do
NOT
put
settings
for
use
by
your
tests
here
.
-->
<
appSettings
>
<!--
Specify
the
location
to
be
used
by
.
NET
for
the
cache
-->
<
add
key
=
"shadowfiles.path"
value
=
"%temp%\nunit20\ShadowCopyCache"
/>
</
appSettings
>
<!--
The
startup
section
may
be
used
to
specify
the
runtime
versions
supported
in
the
order
that
they
will
be
used
if
more
than
one
is
present
.
As
supplied
,
this
section
is
commented
out
,
which
causes
nunit
-
console
to
use
the
version
of
the
framework
with
which
it
was
built
.
Since
.
NET
1
.
0
does
not
recognize
the
<
supportedRuntime
>
elements
,
a
<
requiredRuntime
>
element
is
used
in
case
it
is
the
only
version
of
the
framework
that
is
installed
.
-->
<!--
<
startup
>
<
supportedRuntime
version
=
"v2.0.50727"
/>
<
supportedRuntime
version
=
"v2.0.50215"
/>
<
supportedRuntime
version
=
"v2.0.40607"
/>
<
supportedRuntime
version
=
"v1.1.4322"
/>
<
supportedRuntime
version
=
"v1.0.3705"
/>
<
requiredRuntime
version
=
"v1.0.3705"
/>
</
startup
>
-->
<!--
The
following
<
runtime
>
section
allows
running
nunit
under
.
NET
1
.
0
by
redirecting
assemblies
.
The
appliesTo
attribute
causes
the
section
to
be
ignored
except
under
.
NET
1
.
0
version
1
on
a
machine
with
only
the
.
NET
version
1
.
0
runtime
installed
.
If
application
and
its
tests
were
built
for
.
NET
1
.
1
you
will
also
need
to
redirect
system
assemblies
in
the
test
config
file
.
-->
<
runtime
>
<
assemblyBinding
xmlns
=
"urn:schemas-microsoft-com:asm.v1"
appliesTo
=
"v1.0.3705"
>
<
dependentAssembly
>
<
assemblyIdentity
name
=
"System"
publicKeyToken
=
"b77a5c561934e089"
culture
=
"neutral"
/>
<
bindingRedirect
oldVersion
=
"1.0.5000.0"
newVersion
=
"1.0.3300.0"
/>
</
dependentAssembly
>
<
dependentAssembly
>
<
assemblyIdentity
name
=
"System.Data"
publicKeyToken
=
"b77a5c561934e089"
culture
=
"neutral"
/>
<
bindingRedirect
oldVersion
=
"1.0.5000.0"
newVersion
=
"1.0.3300.0"
/>
</
dependentAssembly
>
<
dependentAssembly
>
<
assemblyIdentity
name
=
"System.Drawing"
publicKeyToken
=
"b03f5f7f11d50a3a"
culture
=
"neutral"
/>
<
bindingRedirect
oldVersion
=
"1.0.5000.0"
newVersion
=
"1.0.3300.0"
/>
</
dependentAssembly
>
<
dependentAssembly
>
<
assemblyIdentity
name
=
"System.Windows.Forms"
publicKeyToken
=
"b77a5c561934e089"
culture
=
"neutral"
/>
<
bindingRedirect
oldVersion
=
"1.0.5000.0"
newVersion
=
"1.0.3300.0"
/>
</
dependentAssembly
>
<
dependentAssembly
>
<
assemblyIdentity
name
=
"System.Xml"
publicKeyToken
=
"b77a5c561934e089"
culture
=
"neutral"
/>
<
bindingRedirect
oldVersion
=
"1.0.5000.0"
newVersion
=
"1.0.3300.0"
/>
</
dependentAssembly
>
</
assemblyBinding
>
</
runtime
>
</
configuration
>
\ No newline at end of file
lib/NUnit 2.2.8.0/nunit-console.v4.0.config
0 → 100644
View file @
926f4dd3
<?
xml
version
=
"1.0"
encoding
=
"Windows-1252"
?>
<
configuration
>
<
startup
useLegacyV2RuntimeActivationPolicy
=
"true"
>
<
requiredRuntime
version
=
"v4.0.30319"
safemode
=
"true"
/>
</
startup
>
<!--
Application
settings
for
NUnit
-
console
.
exe
.
Do
NOT
put
settings
for
use
by
your
tests
here
.
-->
<
appSettings
>
<!--
Specify
the
location
to
be
used
by
.
NET
for
the
cache
-->
<
add
key
=
"shadowfiles.path"
value
=
"%temp%\nunit20\ShadowCopyCache"
/>
</
appSettings
>
<!--
The
startup
section
may
be
used
to
specify
the
runtime
versions
supported
in
the
order
that
they
will
be
used
if
more
than
one
is
present
.
As
supplied
,
this
section
is
commented
out
,
which
causes
nunit
-
console
to
use
the
version
of
the
framework
with
which
it
was
built
.
Since
.
NET
1
.
0
does
not
recognize
the
<
supportedRuntime
>
elements
,
a
<
requiredRuntime
>
element
is
used
in
case
it
is
the
only
version
of
the
framework
that
is
installed
.
-->
<!--
<
startup
>
<
supportedRuntime
version
=
"v2.0.50727"
/>
<
supportedRuntime
version
=
"v2.0.50215"
/>
<
supportedRuntime
version
=
"v2.0.40607"
/>
<
supportedRuntime
version
=
"v1.1.4322"
/>
<
supportedRuntime
version
=
"v1.0.3705"
/>
<
requiredRuntime
version
=
"v1.0.3705"
/>
</
startup
>
-->
<!--
The
following
<
runtime
>
section
allows
running
nunit
under
.
NET
1
.
0
by
redirecting
assemblies
.
The
appliesTo
attribute
causes
the
section
to
be
ignored
except
under
.
NET
1
.
0
version
1
on
a
machine
with
only
the
.
NET
version
1
.
0
runtime
installed
.
If
application
and
its
tests
were
built
for
.
NET
1
.
1
you
will
also
need
to
redirect
system
assemblies
in
the
test
config
file
.
-->
<
runtime
>
<
assemblyBinding
xmlns
=
"urn:schemas-microsoft-com:asm.v1"
appliesTo
=
"v1.0.3705"
>
<
dependentAssembly
>
<
assemblyIdentity
name
=
"System"
publicKeyToken
=
"b77a5c561934e089"
culture
=
"neutral"
/>
<
bindingRedirect
oldVersion
=
"1.0.5000.0"
newVersion
=
"1.0.3300.0"
/>
</
dependentAssembly
>
<
dependentAssembly
>
<
assemblyIdentity
name
=
"System.Data"
publicKeyToken
=
"b77a5c561934e089"
culture
=
"neutral"
/>
<
bindingRedirect
oldVersion
=
"1.0.5000.0"
newVersion
=
"1.0.3300.0"
/>
</
dependentAssembly
>
<
dependentAssembly
>
<
assemblyIdentity
name
=
"System.Drawing"
publicKeyToken
=
"b03f5f7f11d50a3a"
culture
=
"neutral"
/>
<
bindingRedirect
oldVersion
=
"1.0.5000.0"
newVersion
=
"1.0.3300.0"
/>
</
dependentAssembly
>
<
dependentAssembly
>
<
assemblyIdentity
name
=
"System.Windows.Forms"
publicKeyToken
=
"b77a5c561934e089"
culture
=
"neutral"
/>
<
bindingRedirect
oldVersion
=
"1.0.5000.0"
newVersion
=
"1.0.3300.0"
/>
</
dependentAssembly
>
<
dependentAssembly
>
<
assemblyIdentity
name
=
"System.Xml"
publicKeyToken
=
"b77a5c561934e089"
culture
=
"neutral"
/>
<
bindingRedirect
oldVersion
=
"1.0.5000.0"
newVersion
=
"1.0.3300.0"
/>
</
dependentAssembly
>
</
assemblyBinding
>
</
runtime
>
</
configuration
>
\ No newline at end of file
src/ProtoBench/Program.cs
View file @
926f4dd3
...
...
@@ -62,6 +62,15 @@ namespace Google.ProtocolBuffers.ProtoBench
private
static
BenchmarkTest
RunBenchmark
;
private
static
string
_logFile
;
static
void
WriteLine
(
string
format
,
params
object
[]
arg
)
{
if
(
arg
.
Length
>
0
)
format
=
String
.
Format
(
format
,
arg
);
Console
.
Out
.
WriteLine
(
format
);
if
(!
String
.
IsNullOrEmpty
(
_logFile
))
File
.
AppendAllText
(
_logFile
,
format
+
Environment
.
NewLine
);
}
[
STAThread
]
public
static
int
Main
(
string
[]
args
)
{
...
...
@@ -70,6 +79,18 @@ namespace Google.ProtocolBuffers.ProtoBench
Verbose
=
temp
.
Remove
(
"/verbose"
)
||
temp
.
Remove
(
"-verbose"
);
OtherFormats
=
temp
.
Remove
(
"/formats"
)
||
temp
.
Remove
(
"-formats"
);
foreach
(
string
arg
in
temp
)
{
if
(
arg
.
StartsWith
(
"/log:"
,
StringComparison
.
OrdinalIgnoreCase
)
||
arg
.
StartsWith
(
"-log:"
,
StringComparison
.
OrdinalIgnoreCase
))
{
_logFile
=
arg
.
Substring
(
5
);
if
(!
String
.
IsNullOrEmpty
(
_logFile
))
File
.
AppendAllText
(
_logFile
,
Environment
.
NewLine
+
"Started benchmarks at "
+
DateTime
.
Now
+
Environment
.
NewLine
);
temp
.
Remove
(
arg
);
break
;
}
}
if
(
true
==
(
FastTest
=
(
temp
.
Remove
(
"/fast"
)
||
temp
.
Remove
(
"-fast"
))))
{
TargetTime
=
TimeSpan
.
FromSeconds
(
10
);
...
...
@@ -120,7 +141,7 @@ namespace Google.ProtocolBuffers.ProtoBench
/// </summary>
public
static
bool
RunTest
(
string
typeName
,
string
file
,
byte
[]
inputData
)
{
Console
.
WriteLine
(
"Benchmarking {0} with file {1}"
,
typeName
,
file
);
WriteLine
(
"Benchmarking {0} with file {1}"
,
typeName
,
file
);
IMessage
defaultMessage
;
try
{
...
...
@@ -238,7 +259,7 @@ namespace Google.ProtocolBuffers.ProtoBench
new
DictionaryReader
(
dictionary
).
Merge
(
defaultMessage
.
WeakCreateBuilderForType
()).
WeakBuild
());
}
Console
.
WriteLine
(
);
WriteLine
(
String
.
Empty
);
return
true
;
}
catch
(
Exception
e
)
...
...
@@ -281,7 +302,7 @@ namespace Google.ProtocolBuffers.ProtoBench
double
first
=
(
iterations
*
dataSize
)/(
elapsed
.
TotalSeconds
*
1024
*
1024
);
if
(
Verbose
)
{
Console
.
WriteLine
(
"Round ---: Count = {1,6}, Bps = {2,8:f3}"
,
0
,
iterations
,
first
);
WriteLine
(
"Round ---: Count = {1,6}, Bps = {2,8:f3}"
,
0
,
iterations
,
first
);
}
elapsed
=
TimeSpan
.
Zero
;
int
max
=
(
int
)
TargetTime
.
TotalSeconds
;
...
...
@@ -294,7 +315,7 @@ namespace Google.ProtocolBuffers.ProtoBench
double
bps
=
(
iterations
*
dataSize
)/(
cycle
.
TotalSeconds
*
1024
*
1024
);
if
(
Verbose
)
{
Console
.
WriteLine
(
"Round {1,3}: Count = {2,6}, Bps = {3,8:f3}"
,
WriteLine
(
"Round {1,3}: Count = {2,6}, Bps = {3,8:f3}"
,
0
,
runs
,
iterations
,
bps
);
}
...
...
@@ -308,7 +329,7 @@ namespace Google.ProtocolBuffers.ProtoBench
}
Thread
.
EndThreadAffinity
();
Console
.
WriteLine
(
WriteLine
(
"{1}: averages {2} per {3:f3}s for {4} runs; avg: {5:f3}mbps; best: {6:f3}mbps; worst: {7:f3}mbps"
,
0
,
name
,
totalCount
/
runs
,
elapsed
.
TotalSeconds
/
runs
,
runs
,
(
totalCount
*
dataSize
)/(
elapsed
.
TotalSeconds
*
1024
*
1024
),
best
,
worst
);
...
...
@@ -331,7 +352,7 @@ namespace Google.ProtocolBuffers.ProtoBench
// to avoid overflow issues.
iterations
=
(
int
)
((
TargetTime
.
Ticks
/(
double
)
elapsed
.
Ticks
)*
iterations
);
elapsed
=
TimeAction
(
action
,
iterations
);
Console
.
WriteLine
(
"{0}: {1} iterations in {2:f3}s; {3:f3}MB/s"
,
WriteLine
(
"{0}: {1} iterations in {2:f3}s; {3:f3}MB/s"
,
name
,
iterations
,
elapsed
.
TotalSeconds
,
(
iterations
*
dataSize
)/(
elapsed
.
TotalSeconds
*
1024
*
1024
));
}
...
...
src/ProtocolBuffers.Serialization/Extensions.cs
View file @
926f4dd3
...
...
@@ -3,6 +3,7 @@ using System.Text;
using
System.IO
;
using
System.Xml
;
using
Google.ProtocolBuffers.Serialization
;
using
Google.ProtocolBuffers.Serialization.Http
;
namespace
Google.ProtocolBuffers
{
...
...
@@ -16,7 +17,11 @@ namespace Google.ProtocolBuffers
/// Serializes the message to JSON text. This is a trivial wrapper
/// around Serialization.JsonFormatWriter.WriteMessage.
/// </summary>
public
static
string
ToJson
(
this
IMessageLite
message
)
public
static
string
ToJson
(
#if !NET20
this
#endif
IMessageLite
message
)
{
JsonFormatWriter
w
=
JsonFormatWriter
.
CreateInstance
();
w
.
WriteMessage
(
message
);
...
...
@@ -26,7 +31,11 @@ namespace Google.ProtocolBuffers
/// Serializes the message to XML text. This is a trivial wrapper
/// around Serialization.XmlFormatWriter.WriteMessage.
/// </summary>
public
static
string
ToXml
(
this
IMessageLite
message
)
public
static
string
ToXml
(
#if !NET20
this
#endif
IMessageLite
message
)
{
StringWriter
w
=
new
StringWriter
(
new
StringBuilder
(
4096
));
XmlFormatWriter
.
CreateInstance
(
w
).
WriteMessage
(
message
);
...
...
@@ -36,19 +45,53 @@ namespace Google.ProtocolBuffers
/// Serializes the message to XML text using the element name provided.
/// This is a trivial wrapper around Serialization.XmlFormatWriter.WriteMessage.
/// </summary>
public
static
string
ToXml
(
this
IMessageLite
message
,
string
rootElementName
)
public
static
string
ToXml
(
#if !NET20
this
#endif
IMessageLite
message
,
string
rootElementName
)
{
StringWriter
w
=
new
StringWriter
(
new
StringBuilder
(
4096
));
XmlFormatWriter
.
CreateInstance
(
w
).
WriteMessage
(
rootElementName
,
message
);
return
w
.
ToString
();
}
/// <summary>
/// Writes the message instance to the stream using the content type provided
/// </summary>
/// <param name="message">An instance of a message</param>
/// <param name="options">Options specific to writing this message and/or content type</param>
/// <param name="contentType">The mime type of the content to be written</param>
/// <param name="output">The stream to write the message to</param>
public
static
void
WriteTo
(
#if !NET20
this
#endif
IMessageLite
message
,
MessageFormatOptions
options
,
string
contentType
,
Stream
output
)
{
ICodedOutputStream
codedOutput
=
MessageFormatFactory
.
CreateOutputStream
(
options
,
contentType
,
output
);
// Output the appropriate message preamble
codedOutput
.
WriteMessageStart
();
// Write the message content to the output
message
.
WriteTo
(
codedOutput
);
// Write the closing message fragment
codedOutput
.
WriteMessageEnd
();
codedOutput
.
Flush
();
}
#
endregion
#
region
IBuilderLite
Extensions
/// <summary>
/// Merges a JSON object into this builder and returns
/// </summary>
public
static
TBuilder
MergeFromJson
<
TBuilder
>(
this
TBuilder
builder
,
string
jsonText
)
where
TBuilder
:
IBuilderLite
public
static
TBuilder
MergeFromJson
<
TBuilder
>(
#if !NET20
this
#endif
TBuilder
builder
,
string
jsonText
)
where
TBuilder
:
IBuilderLite
{
return
JsonFormatReader
.
CreateInstance
(
jsonText
)
.
Merge
(
builder
);
...
...
@@ -56,14 +99,22 @@ namespace Google.ProtocolBuffers
/// <summary>
/// Merges a JSON object into this builder and returns
/// </summary>
public
static
TBuilder
MergeFromJson
<
TBuilder
>(
this
TBuilder
builder
,
TextReader
reader
)
where
TBuilder
:
IBuilderLite
public
static
TBuilder
MergeFromJson
<
TBuilder
>(
#if !NET20
this
#endif
TBuilder
builder
,
TextReader
reader
)
where
TBuilder
:
IBuilderLite
{
return
MergeFromJson
(
builder
,
reader
,
ExtensionRegistry
.
Empty
);
}
/// <summary>
/// Merges a JSON object into this builder using the extensions provided and returns
/// </summary>
public
static
TBuilder
MergeFromJson
<
TBuilder
>(
this
TBuilder
builder
,
TextReader
reader
,
ExtensionRegistry
extensionRegistry
)
where
TBuilder
:
IBuilderLite
public
static
TBuilder
MergeFromJson
<
TBuilder
>(
#if !NET20
this
#endif
TBuilder
builder
,
TextReader
reader
,
ExtensionRegistry
extensionRegistry
)
where
TBuilder
:
IBuilderLite
{
return
JsonFormatReader
.
CreateInstance
(
reader
)
.
Merge
(
builder
,
extensionRegistry
);
...
...
@@ -72,7 +123,11 @@ namespace Google.ProtocolBuffers
/// <summary>
/// Merges an XML object into this builder and returns
/// </summary>
public
static
TBuilder
MergeFromXml
<
TBuilder
>(
this
TBuilder
builder
,
XmlReader
reader
)
where
TBuilder
:
IBuilderLite
public
static
TBuilder
MergeFromXml
<
TBuilder
>(
#if !NET20
this
#endif
TBuilder
builder
,
XmlReader
reader
)
where
TBuilder
:
IBuilderLite
{
return
MergeFromXml
(
builder
,
XmlFormatReader
.
DefaultRootElementName
,
reader
,
ExtensionRegistry
.
Empty
);
}
...
...
@@ -80,7 +135,11 @@ namespace Google.ProtocolBuffers
/// <summary>
/// Merges an XML object into this builder and returns
/// </summary>
public
static
TBuilder
MergeFromXml
<
TBuilder
>(
this
TBuilder
builder
,
string
rootElementName
,
XmlReader
reader
)
where
TBuilder
:
IBuilderLite
public
static
TBuilder
MergeFromXml
<
TBuilder
>(
#if !NET20
this
#endif
TBuilder
builder
,
string
rootElementName
,
XmlReader
reader
)
where
TBuilder
:
IBuilderLite
{
return
MergeFromXml
(
builder
,
rootElementName
,
reader
,
ExtensionRegistry
.
Empty
);
}
...
...
@@ -88,13 +147,67 @@ namespace Google.ProtocolBuffers
/// <summary>
/// Merges an XML object into this builder using the extensions provided and returns
/// </summary>
public
static
TBuilder
MergeFromXml
<
TBuilder
>(
this
TBuilder
builder
,
string
rootElementName
,
XmlReader
reader
,
public
static
TBuilder
MergeFromXml
<
TBuilder
>(
#if !NET20
this
#endif
TBuilder
builder
,
string
rootElementName
,
XmlReader
reader
,
ExtensionRegistry
extensionRegistry
)
where
TBuilder
:
IBuilderLite
{
return
XmlFormatReader
.
CreateInstance
(
reader
)
.
Merge
(
rootElementName
,
builder
,
extensionRegistry
);
}
/// <summary>
/// Merges the message from the input stream based on the contentType provided
/// </summary>
/// <typeparam name="TBuilder">A type derived from IBuilderLite</typeparam>
/// <param name="builder">An instance of a message builder</param>
/// <param name="options">Options specific to reading this message and/or content type</param>
/// <param name="contentType">The mime type of the input stream content</param>
/// <param name="input">The stream to read the message from</param>
/// <returns>The same builder instance that was supplied in the builder parameter</returns>
public
static
TBuilder
MergeFrom
<
TBuilder
>(
#if !NET20
this
#endif
TBuilder
builder
,
MessageFormatOptions
options
,
string
contentType
,
Stream
input
)
where
TBuilder
:
IBuilderLite
{
ICodedInputStream
codedInput
=
MessageFormatFactory
.
CreateInputStream
(
options
,
contentType
,
input
);
codedInput
.
ReadMessageStart
();
builder
.
WeakMergeFrom
(
codedInput
,
options
.
ExtensionRegistry
);
codedInput
.
ReadMessageEnd
();
return
builder
;
}
#
endregion
#
region
IRpcServerStub
Extensions
/// <summary>
/// Used to implement a service endpoint on an HTTP server. This works with services generated with the
/// service_generator_type option set to IRPCDISPATCH.
/// </summary>
/// <param name="stub">The service execution stub</param>
/// <param name="methodName">The name of the method being invoked</param>
/// <param name="options">optional arguments for the format reader/writer</param>
/// <param name="contentType">The mime type for the input stream</param>
/// <param name="input">The input stream</param>
/// <param name="responseType">The mime type for the output stream</param>
/// <param name="output">The output stream</param>
public
static
void
HttpCallMethod
(
#if !NET20
this
#endif
IRpcServerStub
stub
,
string
methodName
,
MessageFormatOptions
options
,
string
contentType
,
Stream
input
,
string
responseType
,
Stream
output
)
{
ICodedInputStream
codedInput
=
MessageFormatFactory
.
CreateInputStream
(
options
,
contentType
,
input
);
codedInput
.
ReadMessageStart
();
IMessageLite
response
=
stub
.
CallMethod
(
methodName
,
codedInput
,
options
.
ExtensionRegistry
);
codedInput
.
ReadMessageEnd
();
WriteTo
(
response
,
options
,
responseType
,
output
);
}
#
endregion
}
}
src/ProtocolBuffers.Serialization/Http/MessageFormatFactory.cs
View file @
926f4dd3
...
...
@@ -31,24 +31,6 @@ namespace Google.ProtocolBuffers.Serialization.Http
return
codedInput
;
}
/// <summary>
/// Merges the message from the input stream based on the contentType provided
/// </summary>
/// <typeparam name="TBuilder">A type derived from IBuilderLite</typeparam>
/// <param name="builder">An instance of a message builder</param>
/// <param name="options">Options specific to reading this message and/or content type</param>
/// <param name="contentType">The mime type of the input stream content</param>
/// <param name="input">The stream to read the message from</param>
/// <returns>The same builder instance that was supplied in the builder parameter</returns>
public
static
TBuilder
MergeFrom
<
TBuilder
>(
this
TBuilder
builder
,
MessageFormatOptions
options
,
string
contentType
,
Stream
input
)
where
TBuilder
:
IBuilderLite
{
ICodedInputStream
codedInput
=
CreateInputStream
(
options
,
contentType
,
input
);
codedInput
.
ReadMessageStart
();
builder
.
WeakMergeFrom
(
codedInput
,
options
.
ExtensionRegistry
);
codedInput
.
ReadMessageEnd
();
return
builder
;
}
/// <summary>
/// Writes the message instance to the stream using the content type provided
/// </summary>
...
...
@@ -93,28 +75,6 @@ namespace Google.ProtocolBuffers.Serialization.Http
return
codedOutput
;
}
/// <summary>
/// Writes the message instance to the stream using the content type provided
/// </summary>
/// <param name="message">An instance of a message</param>
/// <param name="options">Options specific to writing this message and/or content type</param>
/// <param name="contentType">The mime type of the content to be written</param>
/// <param name="output">The stream to write the message to</param>
public
static
void
WriteTo
(
this
IMessageLite
message
,
MessageFormatOptions
options
,
string
contentType
,
Stream
output
)
{
ICodedOutputStream
codedOutput
=
CreateOutputStream
(
options
,
contentType
,
output
);
// Output the appropriate message preamble
codedOutput
.
WriteMessageStart
();
// Write the message content to the output
message
.
WriteTo
(
codedOutput
);
// Write the closing message fragment
codedOutput
.
WriteMessageEnd
();
codedOutput
.
Flush
();
}
private
static
ICodedInputStream
ContentTypeToInputStream
(
string
contentType
,
MessageFormatOptions
options
,
Stream
input
)
{
contentType
=
(
contentType
??
String
.
Empty
).
Split
(
';'
)[
0
].
Trim
();
...
...
src/ProtocolBuffers.Serialization/Http/ServiceExtensions.cs
deleted
100644 → 0
View file @
3ede2921
using
System.Collections.Generic
;
using
System.Text
;
using
Google.ProtocolBuffers
;
using
System.IO
;
namespace
Google.ProtocolBuffers.Serialization.Http
{
/// <summary>
/// Extensions for the IRpcServerStub
/// </summary>
public
static
class
ServiceExtensions
{
/// <summary>
/// Used to implement a service endpoint on an HTTP server. This works with services generated with the
/// service_generator_type option set to IRPCDISPATCH.
/// </summary>
/// <param name="stub">The service execution stub</param>
/// <param name="methodName">The name of the method being invoked</param>
/// <param name="options">optional arguments for the format reader/writer</param>
/// <param name="contentType">The mime type for the input stream</param>
/// <param name="input">The input stream</param>
/// <param name="responseType">The mime type for the output stream</param>
/// <param name="output">The output stream</param>
public
static
void
HttpCallMethod
(
this
IRpcServerStub
stub
,
string
methodName
,
MessageFormatOptions
options
,
string
contentType
,
Stream
input
,
string
responseType
,
Stream
output
)
{
ICodedInputStream
codedInput
=
MessageFormatFactory
.
CreateInputStream
(
options
,
contentType
,
input
);
codedInput
.
ReadMessageStart
();
IMessageLite
response
=
stub
.
CallMethod
(
methodName
,
codedInput
,
options
.
ExtensionRegistry
);
codedInput
.
ReadMessageEnd
();
response
.
WriteTo
(
options
,
responseType
,
output
);
}
}
}
src/ProtocolBuffers.Serialization/JsonFormatWriter.cs
View file @
926f4dd3
...
...
@@ -100,7 +100,7 @@ namespace Google.ProtocolBuffers.Serialization
private
class
JsonStreamWriter
:
JsonFormatWriter
{
#if SILVERLIGHT
2
|| COMPACT_FRAMEWORK_35
#if SILVERLIGHT || COMPACT_FRAMEWORK_35
static
readonly
Encoding
Encoding
=
new
UTF8Encoding
(
false
);
#else
private
static
readonly
Encoding
Encoding
=
Encoding
.
ASCII
;
...
...
src/ProtocolBuffers.Serialization/ProtocolBuffers.Serialization.csproj
View file @
926f4dd3
...
...
@@ -34,6 +34,8 @@
<IsWebBootstrapper>
false
</IsWebBootstrapper>
<UseApplicationTrust>
false
</UseApplicationTrust>
<BootstrapperEnabled>
true
</BootstrapperEnabled>
<SilverlightVersion
Condition=
" '$(SilverlightVersion)' == '' "
>
v2.0
</SilverlightVersion>
<DefineConstants
Condition=
" '$(TargetFrameworkVersion)' == 'v2.0' "
>
NET20;
</DefineConstants>
</PropertyGroup>
<PropertyGroup
Condition=
" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' "
>
<DebugSymbols>
true
</DebugSymbols>
...
...
@@ -42,7 +44,7 @@
<OutputPath>
bin\Debug\
</OutputPath>
<DocumentationFile>
$(OutputPath)\$(AssemblyName).xml
</DocumentationFile>
<NoWarn>
1591, 1570, 1571, 1572, 1573, 1574
</NoWarn>
<DefineConstants>
DEBUG;TRACE
</DefineConstants>
<DefineConstants>
$(DefineConstants)TRACE;DEBUG;
</DefineConstants>
<ErrorReport>
prompt
</ErrorReport>
<WarningLevel>
4
</WarningLevel>
<NoStdLib>
true
</NoStdLib>
...
...
@@ -54,32 +56,32 @@
<OutputPath>
bin\Release\
</OutputPath>
<DocumentationFile>
$(OutputPath)\$(AssemblyName).xml
</DocumentationFile>
<NoWarn>
1591, 1570, 1571, 1572, 1573, 1574
</NoWarn>
<DefineConstants>
TRACE
</DefineConstants>
<DefineConstants>
$(DefineConstants)TRACE;
</DefineConstants>
<ErrorReport>
prompt
</ErrorReport>
<WarningLevel>
4
</WarningLevel>
<NoStdLib>
true
</NoStdLib>
<CodeAnalysisRuleSet>
AllRules.ruleset
</CodeAnalysisRuleSet>
</PropertyGroup>
<PropertyGroup
Condition=
"'$(Configuration)|$(Platform)' == 'Debug_Silverlight
2
|AnyCPU'"
>
<PropertyGroup
Condition=
"'$(Configuration)|$(Platform)' == 'Debug_Silverlight|AnyCPU'"
>
<DebugSymbols>
true
</DebugSymbols>
<DebugType>
full
</DebugType>
<Optimize>
false
</Optimize>
<OutputPath>
bin\Debug_Silverlight
2
\
</OutputPath>
<OutputPath>
bin\Debug_Silverlight\
</OutputPath>
<DocumentationFile>
$(OutputPath)\$(AssemblyName).xml
</DocumentationFile>
<NoWarn>
1591, 1570, 1571, 1572, 1573, 1574
</NoWarn>
<DefineConstants>
DEBUG;TRACE;SILVERLIGHT2
</DefineConstants>
<DefineConstants>
$(DefineConstants)TRACE;DEBUG;SILVERLIGHT
</DefineConstants>
<ErrorReport>
prompt
</ErrorReport>
<WarningLevel>
4
</WarningLevel>
<NoStdLib>
true
</NoStdLib>
<CodeAnalysisRuleSet>
AllRules.ruleset
</CodeAnalysisRuleSet>
</PropertyGroup>
<PropertyGroup
Condition=
"'$(Configuration)|$(Platform)' == 'Release_Silverlight
2
|AnyCPU'"
>
<PropertyGroup
Condition=
"'$(Configuration)|$(Platform)' == 'Release_Silverlight|AnyCPU'"
>
<DebugType>
pdbonly
</DebugType>
<Optimize>
true
</Optimize>
<OutputPath>
bin\Release_Silverlight
2
\
</OutputPath>
<OutputPath>
bin\Release_Silverlight\
</OutputPath>
<DocumentationFile>
$(OutputPath)\$(AssemblyName).xml
</DocumentationFile>
<NoWarn>
1591, 1570, 1571, 1572, 1573, 1574
</NoWarn>
<DefineConstants>
TRACE;SILVERLIGHT2
</DefineConstants>
<DefineConstants>
$(DefineConstants)TRACE;SILVERLIGHT
</DefineConstants>
<ErrorReport>
prompt
</ErrorReport>
<WarningLevel>
4
</WarningLevel>
<NoStdLib>
true
</NoStdLib>
...
...
@@ -89,19 +91,13 @@
<Reference
Include=
"mscorlib"
/>
<Reference
Include=
"System"
/>
<Reference
Include=
"System.Xml"
/>
<!-- Only for 2.x compatibility of extension methods -->
<Reference
Include=
"System.Core"
>
<SpecificVersion>
False
</SpecificVersion>
<HintPath>
..\..\lib\System.Core\System.Core.dll
</HintPath>
<Private>
False
</Private>
</Reference>
<Reference
Include=
"System.Core"
Condition=
"'$(TargetFrameworkVersion)' != 'v2.0'"
/>
</ItemGroup>
<ItemGroup>
<Compile
Include=
"Extensions.cs"
/>
<Compile
Include=
"Http\FormUrlEncodedReader.cs"
/>
<Compile
Include=
"Http\MessageFormatFactory.cs"
/>
<Compile
Include=
"Http\MessageFormatOptions.cs"
/>
<Compile
Include=
"Http\ServiceExtensions.cs"
/>
<Compile
Include=
"Properties\AssemblyInfo.cs"
/>
<Compile
Include=
"AbstractReader.cs"
/>
<Compile
Include=
"AbstractTextReader.cs"
/>
...
...
@@ -144,8 +140,8 @@
</ItemGroup>
<Import
Project=
"$(MSBuildToolsPath)\Microsoft.CSharp.targets"
Condition=
" '$(Configuration)' == 'Debug' "
/>
<Import
Project=
"$(MSBuildToolsPath)\Microsoft.CSharp.targets"
Condition=
" '$(Configuration)' == 'Release' "
/>
<Import
Project=
"$(MSBuildExtensionsPath)\Microsoft\Silverlight\
v2.0\Microsoft.Silverlight.CSharp.targets"
Condition=
" '$(Configuration)' == 'Debug_Silverlight2
' "
/>
<Import
Project=
"$(MSBuildExtensionsPath)\Microsoft\Silverlight\
v2.0\Microsoft.Silverlight.CSharp.targets"
Condition=
" '$(Configuration)' == 'Release_Silverlight2
' "
/>
<Import
Project=
"$(MSBuildExtensionsPath)\Microsoft\Silverlight\
$(SilverlightVersion)\Microsoft.Silverlight.CSharp.targets"
Condition=
" '$(Configuration)' == 'Debug_Silverlight
' "
/>
<Import
Project=
"$(MSBuildExtensionsPath)\Microsoft\Silverlight\
$(SilverlightVersion)\Microsoft.Silverlight.CSharp.targets"
Condition=
" '$(Configuration)' == 'Release_Silverlight
' "
/>
<!-- To modify your build process, add your task inside one of the targets below and uncomment it.
Other similar extension points exist, see Microsoft.Common.targets.
<Target Name="BeforeBuild">
...
...
src/ProtocolBuffers.Serialization/ProtocolBuffersLite.Serialization.csproj
View file @
926f4dd3
...
...
@@ -34,6 +34,8 @@
<IsWebBootstrapper>
false
</IsWebBootstrapper>
<UseApplicationTrust>
false
</UseApplicationTrust>
<BootstrapperEnabled>
true
</BootstrapperEnabled>
<SilverlightVersion
Condition=
" '$(SilverlightVersion)' == '' "
>
v2.0
</SilverlightVersion>
<DefineConstants
Condition=
" '$(TargetFrameworkVersion)' == 'v2.0' "
>
NET20;
</DefineConstants>
</PropertyGroup>
<PropertyGroup
Condition=
" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' "
>
<DebugSymbols>
true
</DebugSymbols>
...
...
@@ -42,7 +44,7 @@
<OutputPath>
bin\Debug\
</OutputPath>
<DocumentationFile>
$(OutputPath)\$(AssemblyName).xml
</DocumentationFile>
<NoWarn>
1591, 1570, 1571, 1572, 1573, 1574
</NoWarn>
<DefineConstants>
DEBUG;TRACE
</DefineConstants>
<DefineConstants>
$(DefineConstants)TRACE;DEBUG
</DefineConstants>
<ErrorReport>
prompt
</ErrorReport>
<WarningLevel>
4
</WarningLevel>
<NoStdLib>
true
</NoStdLib>
...
...
@@ -54,32 +56,32 @@
<OutputPath>
bin\Release\
</OutputPath>
<DocumentationFile>
$(OutputPath)\$(AssemblyName).xml
</DocumentationFile>
<NoWarn>
1591, 1570, 1571, 1572, 1573, 1574
</NoWarn>
<DefineConstants>
TRACE
</DefineConstants>
<DefineConstants>
$(DefineConstants)TRACE;
</DefineConstants>
<ErrorReport>
prompt
</ErrorReport>
<WarningLevel>
4
</WarningLevel>
<NoStdLib>
true
</NoStdLib>
<CodeAnalysisRuleSet>
AllRules.ruleset
</CodeAnalysisRuleSet>
</PropertyGroup>
<PropertyGroup
Condition=
"'$(Configuration)|$(Platform)' == 'Debug_Silverlight
2
|AnyCPU'"
>
<PropertyGroup
Condition=
"'$(Configuration)|$(Platform)' == 'Debug_Silverlight|AnyCPU'"
>
<DebugSymbols>
true
</DebugSymbols>
<DebugType>
full
</DebugType>
<Optimize>
false
</Optimize>
<OutputPath>
bin\Debug_Silverlight
2
\
</OutputPath>
<OutputPath>
bin\Debug_Silverlight\
</OutputPath>
<DocumentationFile>
$(OutputPath)\$(AssemblyName).xml
</DocumentationFile>
<NoWarn>
1591, 1570, 1571, 1572, 1573, 1574
</NoWarn>
<DefineConstants>
DEBUG;TRACE;SILVERLIGHT2
</DefineConstants>
<DefineConstants>
$(DefineConstants)TRACE;DEBUG;SILVERLIGHT
</DefineConstants>
<ErrorReport>
prompt
</ErrorReport>
<WarningLevel>
4
</WarningLevel>
<NoStdLib>
true
</NoStdLib>
<CodeAnalysisRuleSet>
AllRules.ruleset
</CodeAnalysisRuleSet>
</PropertyGroup>
<PropertyGroup
Condition=
"'$(Configuration)|$(Platform)' == 'Release_Silverlight
2
|AnyCPU'"
>
<PropertyGroup
Condition=
"'$(Configuration)|$(Platform)' == 'Release_Silverlight|AnyCPU'"
>
<DebugType>
pdbonly
</DebugType>
<Optimize>
true
</Optimize>
<OutputPath>
bin\Release_Silverlight
2
\
</OutputPath>
<OutputPath>
bin\Release_Silverlight\
</OutputPath>
<DocumentationFile>
$(OutputPath)\$(AssemblyName).xml
</DocumentationFile>
<NoWarn>
1591, 1570, 1571, 1572, 1573, 1574
</NoWarn>
<DefineConstants>
TRACE;SILVERLIGHT2
</DefineConstants>
<DefineConstants>
$(DefineConstants)TRACE;SILVERLIGHT
</DefineConstants>
<ErrorReport>
prompt
</ErrorReport>
<WarningLevel>
4
</WarningLevel>
<NoStdLib>
true
</NoStdLib>
...
...
@@ -89,19 +91,13 @@
<Reference
Include=
"mscorlib"
/>
<Reference
Include=
"System"
/>
<Reference
Include=
"System.Xml"
/>
<!-- Only for 2.x compatibility of extension methods -->
<Reference
Include=
"System.Core"
>
<SpecificVersion>
False
</SpecificVersion>
<HintPath>
..\..\lib\System.Core\System.Core.dll
</HintPath>
<Private>
False
</Private>
</Reference>
<Reference
Include=
"System.Core"
Condition=
"'$(TargetFrameworkVersion)' != 'v2.0'"
/>
</ItemGroup>
<ItemGroup>
<Compile
Include=
"Extensions.cs"
/>
<Compile
Include=
"Http\FormUrlEncodedReader.cs"
/>
<Compile
Include=
"Http\MessageFormatFactory.cs"
/>
<Compile
Include=
"Http\MessageFormatOptions.cs"
/>
<Compile
Include=
"Http\ServiceExtensions.cs"
/>
<Compile
Include=
"Properties\AssemblyInfo.cs"
/>
<Compile
Include=
"AbstractReader.cs"
/>
<Compile
Include=
"AbstractTextReader.cs"
/>
...
...
@@ -144,8 +140,8 @@
</ItemGroup>
<Import
Project=
"$(MSBuildToolsPath)\Microsoft.CSharp.targets"
Condition=
" '$(Configuration)' == 'Debug' "
/>
<Import
Project=
"$(MSBuildToolsPath)\Microsoft.CSharp.targets"
Condition=
" '$(Configuration)' == 'Release' "
/>
<Import
Project=
"$(MSBuildExtensionsPath)\Microsoft\Silverlight\
v2.0\Microsoft.Silverlight.CSharp.targets"
Condition=
" '$(Configuration)' == 'Debug_Silverlight2
' "
/>
<Import
Project=
"$(MSBuildExtensionsPath)\Microsoft\Silverlight\
v2.0\Microsoft.Silverlight.CSharp.targets"
Condition=
" '$(Configuration)' == 'Release_Silverlight2
' "
/>
<Import
Project=
"$(MSBuildExtensionsPath)\Microsoft\Silverlight\
$(SilverlightVersion)\Microsoft.Silverlight.CSharp.targets"
Condition=
" '$(Configuration)' == 'Debug_Silverlight
' "
/>
<Import
Project=
"$(MSBuildExtensionsPath)\Microsoft\Silverlight\
$(SilverlightVersion)\Microsoft.Silverlight.CSharp.targets"
Condition=
" '$(Configuration)' == 'Release_Silverlight
' "
/>
<!-- To modify your build process, add your task inside one of the targets below and uncomment it.
Other similar extension points exist, see Microsoft.Common.targets.
<Target Name="BeforeBuild">
...
...
src/ProtocolBuffers.Serialization/RecursionLimitExceeded.cs
View file @
926f4dd3
...
...
@@ -7,7 +7,7 @@ namespace Google.ProtocolBuffers.Serialization
/// <summary>
/// The exception raised when a recursion limit is reached while parsing input.
/// </summary>
#if !SILVERLIGHT
2
#if !SILVERLIGHT
[
Serializable
]
#endif
public
sealed
class
RecursionLimitExceededException
:
FormatException
...
...
@@ -18,7 +18,7 @@ namespace Google.ProtocolBuffers.Serialization
{
}
#if !SILVERLIGHT
2
#if !SILVERLIGHT
private
RecursionLimitExceededException
(
System
.
Runtime
.
Serialization
.
SerializationInfo
info
,
System
.
Runtime
.
Serialization
.
StreamingContext
context
)
:
base
(
info
,
context
)
{
...
...
src/ProtocolBuffers.Test/Compatibility/TestResources.Designer.cs
deleted
100644 → 0
View file @
3ede2921
//------------------------------------------------------------------------------
// <auto-generated>
// This code was generated by a tool.
// Runtime Version:2.0.50727.5446
//
// Changes to this file may cause incorrect behavior and will be lost if
// the code is regenerated.
// </auto-generated>
//------------------------------------------------------------------------------
namespace
Google.ProtocolBuffers.Compatibility
{
using
System
;
/// <summary>
/// A strongly-typed resource class, for looking up localized strings, etc.
/// </summary>
// This class was auto-generated by the StronglyTypedResourceBuilder
// class via a tool like ResGen or Visual Studio.
// To add or remove a member, edit your .ResX file then rerun ResGen
// with the /str option, or rebuild your VS project.
[
global
::
System
.
CodeDom
.
Compiler
.
GeneratedCodeAttribute
(
"System.Resources.Tools.StronglyTypedResourceBuilder"
,
"2.0.0.0"
)]
[
global
::
System
.
Diagnostics
.
DebuggerNonUserCodeAttribute
()]
[
global
::
System
.
Runtime
.
CompilerServices
.
CompilerGeneratedAttribute
()]
internal
class
TestResources
{
private
static
global
::
System
.
Resources
.
ResourceManager
resourceMan
;
private
static
global
::
System
.
Globalization
.
CultureInfo
resourceCulture
;
[
global
::
System
.
Diagnostics
.
CodeAnalysis
.
SuppressMessageAttribute
(
"Microsoft.Performance"
,
"CA1811:AvoidUncalledPrivateCode"
)]
internal
TestResources
()
{
}
/// <summary>
/// Returns the cached ResourceManager instance used by this class.
/// </summary>
[
global
::
System
.
ComponentModel
.
EditorBrowsableAttribute
(
global
::
System
.
ComponentModel
.
EditorBrowsableState
.
Advanced
)]
internal
static
global
::
System
.
Resources
.
ResourceManager
ResourceManager
{
get
{
if
(
object
.
ReferenceEquals
(
resourceMan
,
null
))
{
global
::
System
.
Resources
.
ResourceManager
temp
=
new
global
::
System
.
Resources
.
ResourceManager
(
"Google.ProtocolBuffers.Compatibility.TestResources"
,
typeof
(
TestResources
).
Assembly
);
resourceMan
=
temp
;
}
return
resourceMan
;
}
}
/// <summary>
/// Overrides the current thread's CurrentUICulture property for all
/// resource lookups using this strongly typed resource class.
/// </summary>
[
global
::
System
.
ComponentModel
.
EditorBrowsableAttribute
(
global
::
System
.
ComponentModel
.
EditorBrowsableState
.
Advanced
)]
internal
static
global
::
System
.
Globalization
.
CultureInfo
Culture
{
get
{
return
resourceCulture
;
}
set
{
resourceCulture
=
value
;
}
}
internal
static
byte
[]
google_message1
{
get
{
object
obj
=
ResourceManager
.
GetObject
(
"google_message1"
,
resourceCulture
);
return
((
byte
[])(
obj
));
}
}
internal
static
byte
[]
google_message2
{
get
{
object
obj
=
ResourceManager
.
GetObject
(
"google_message2"
,
resourceCulture
);
return
((
byte
[])(
obj
));
}
}
}
}
src/ProtocolBuffers.Test/Compatibility/TestResources.cs
0 → 100644
View file @
926f4dd3
using
System
;
using
System.Collections.Generic
;
using
System.IO
;
using
System.Text
;
using
NUnit.Framework
;
namespace
Google.ProtocolBuffers.Compatibility
{
static
class
TestResources
{
public
static
byte
[]
google_message1
{
get
{
Stream
resource
=
typeof
(
TestResources
).
Assembly
.
GetManifestResourceStream
(
typeof
(
TestResources
).
Namespace
+
".google_message1.dat"
);
Assert
.
IsNotNull
(
resource
,
"Unable to the locate resource: google_message1"
);
byte
[]
bytes
=
new
byte
[
resource
.
Length
];
int
amtRead
=
resource
.
Read
(
bytes
,
0
,
bytes
.
Length
);
Assert
.
AreEqual
(
bytes
.
Length
,
amtRead
);
return
bytes
;
}
}
public
static
byte
[]
google_message2
{
get
{
Stream
resource
=
typeof
(
TestResources
).
Assembly
.
GetManifestResourceStream
(
typeof
(
TestResources
).
Namespace
+
".google_message2.dat"
);
Assert
.
IsNotNull
(
resource
,
"Unable to the locate resource: google_message2"
);
byte
[]
bytes
=
new
byte
[
resource
.
Length
];
int
amtRead
=
resource
.
Read
(
bytes
,
0
,
bytes
.
Length
);
Assert
.
AreEqual
(
bytes
.
Length
,
amtRead
);
return
bytes
;
}
}
}
}
src/ProtocolBuffers.Test/Compatibility/TestResources.resx
deleted
100644 → 0
View file @
3ede2921
<?xml version="1.0" encoding="utf-8"?>
<root>
<!--
Microsoft ResX Schema
Version 2.0
The primary goals of this format is to allow a simple XML format
that is mostly human readable. The generation and parsing of the
various data types are done through the TypeConverter classes
associated with the data types.
Example:
... ado.net/XML headers & schema ...
<resheader name="resmimetype">text/microsoft-resx</resheader>
<resheader name="version">2.0</resheader>
<resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
<resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
<data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
<data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
<value>[base64 mime encoded serialized .NET Framework object]</value>
</data>
<data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
<comment>This is a comment</comment>
</data>
There are any number of "resheader" rows that contain simple
name/value pairs.
Each data row contains a name, and value. The row also contains a
type or mimetype. Type corresponds to a .NET class that support
text/value conversion through the TypeConverter architecture.
Classes that don't support this are serialized and stored with the
mimetype set.
The mimetype is used for serialized objects, and tells the
ResXResourceReader how to depersist the object. This is currently not
extensible. For a given mimetype the value must be set accordingly:
Note - application/x-microsoft.net.object.binary.base64 is the format
that the ResXResourceWriter will generate, however the reader can
read any of the formats listed below.
mimetype: application/x-microsoft.net.object.binary.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.soap.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.bytearray.base64
value : The object must be serialized into a byte array
: using a System.ComponentModel.TypeConverter
: and then encoded with base64 encoding.
-->
<xsd:schema
id=
"root"
xmlns=
""
xmlns:xsd=
"http://www.w3.org/2001/XMLSchema"
xmlns:msdata=
"urn:schemas-microsoft-com:xml-msdata"
>
<xsd:import
namespace=
"http://www.w3.org/XML/1998/namespace"
/>
<xsd:element
name=
"root"
msdata:IsDataSet=
"true"
>
<xsd:complexType>
<xsd:choice
maxOccurs=
"unbounded"
>
<xsd:element
name=
"metadata"
>
<xsd:complexType>
<xsd:sequence>
<xsd:element
name=
"value"
type=
"xsd:string"
minOccurs=
"0"
/>
</xsd:sequence>
<xsd:attribute
name=
"name"
use=
"required"
type=
"xsd:string"
/>
<xsd:attribute
name=
"type"
type=
"xsd:string"
/>
<xsd:attribute
name=
"mimetype"
type=
"xsd:string"
/>
<xsd:attribute
ref=
"xml:space"
/>
</xsd:complexType>
</xsd:element>
<xsd:element
name=
"assembly"
>
<xsd:complexType>
<xsd:attribute
name=
"alias"
type=
"xsd:string"
/>
<xsd:attribute
name=
"name"
type=
"xsd:string"
/>
</xsd:complexType>
</xsd:element>
<xsd:element
name=
"data"
>
<xsd:complexType>
<xsd:sequence>
<xsd:element
name=
"value"
type=
"xsd:string"
minOccurs=
"0"
msdata:Ordinal=
"1"
/>
<xsd:element
name=
"comment"
type=
"xsd:string"
minOccurs=
"0"
msdata:Ordinal=
"2"
/>
</xsd:sequence>
<xsd:attribute
name=
"name"
type=
"xsd:string"
use=
"required"
msdata:Ordinal=
"1"
/>
<xsd:attribute
name=
"type"
type=
"xsd:string"
msdata:Ordinal=
"3"
/>
<xsd:attribute
name=
"mimetype"
type=
"xsd:string"
msdata:Ordinal=
"4"
/>
<xsd:attribute
ref=
"xml:space"
/>
</xsd:complexType>
</xsd:element>
<xsd:element
name=
"resheader"
>
<xsd:complexType>
<xsd:sequence>
<xsd:element
name=
"value"
type=
"xsd:string"
minOccurs=
"0"
msdata:Ordinal=
"1"
/>
</xsd:sequence>
<xsd:attribute
name=
"name"
type=
"xsd:string"
use=
"required"
/>
</xsd:complexType>
</xsd:element>
</xsd:choice>
</xsd:complexType>
</xsd:element>
</xsd:schema>
<resheader
name=
"resmimetype"
>
<value>
text/microsoft-resx
</value>
</resheader>
<resheader
name=
"version"
>
<value>
2.0
</value>
</resheader>
<resheader
name=
"reader"
>
<value>
System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
</value>
</resheader>
<resheader
name=
"writer"
>
<value>
System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
</value>
</resheader>
<assembly
alias=
"System.Windows.Forms"
name=
"System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"
/>
<data
name=
"google_message1"
type=
"System.Resources.ResXFileRef, System.Windows.Forms"
>
<value>
google_message1.dat;System.Byte[], mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
</value>
</data>
<data
name=
"google_message2"
type=
"System.Resources.ResXFileRef, System.Windows.Forms"
>
<value>
google_message2.dat;System.Byte[], mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
</value>
</data>
</root>
\ No newline at end of file
src/ProtocolBuffers.Test/ProtocolBuffers.Test.csproj
View file @
926f4dd3
...
...
@@ -81,11 +81,7 @@
<Compile
Include=
"Compatibility\CompatibilityTests.cs"
/>
<Compile
Include=
"Compatibility\DictionaryCompatibilityTests.cs"
/>
<Compile
Include=
"Compatibility\JsonCompatibilityTests.cs"
/>
<Compile
Include=
"Compatibility\TestResources.Designer.cs"
>
<AutoGen>
True
</AutoGen>
<DesignTime>
True
</DesignTime>
<DependentUpon>
TestResources.resx
</DependentUpon>
</Compile>
<Compile
Include=
"Compatibility\TestResources.cs"
/>
<Compile
Include=
"Compatibility\TextCompatibilityTests.cs"
/>
<Compile
Include=
"Compatibility\XmlCompatibilityTests.cs"
/>
<Compile
Include=
"TestProtos\UnitTestExtrasProtoFile.cs"
/>
...
...
@@ -163,14 +159,8 @@
</BootstrapperPackage>
</ItemGroup>
<ItemGroup>
<None
Include=
"Compatibility\google_message1.dat"
/>
<None
Include=
"Compatibility\google_message2.dat"
/>
</ItemGroup>
<ItemGroup>
<EmbeddedResource
Include=
"Compatibility\TestResources.resx"
>
<Generator>
ResXFileCodeGenerator
</Generator>
<LastGenOutput>
TestResources.Designer.cs
</LastGenOutput>
</EmbeddedResource>
<EmbeddedResource
Include=
"Compatibility\google_message1.dat"
/>
<EmbeddedResource
Include=
"Compatibility\google_message2.dat"
/>
</ItemGroup>
<Import
Project=
"$(MSBuildToolsPath)\Microsoft.CSharp.targets"
Condition=
" '$(Configuration)' == 'Debug' "
/>
<Import
Project=
"$(MSBuildToolsPath)\Microsoft.CSharp.targets"
Condition=
" '$(Configuration)' == 'Release' "
/>
...
...
src/ProtocolBuffers.Test/ReusableBuilderTest.cs
View file @
926f4dd3
...
...
@@ -90,8 +90,8 @@ namespace Google.ProtocolBuffers
TestAllTypes
m2
=
b1
.
Build
();
Assert
.
AreEqual
(
"{\"optional_foreign_message\":{},\"repeated_int32\":[2],\"default_int32\":1}"
,
m1
.
ToJson
(
));
Assert
.
AreEqual
(
"{\"optional_foreign_message\":{\"c\":7},\"repeated_int32\":[2,6],\"default_int32\":5}"
,
m2
.
ToJson
(
));
Assert
.
AreEqual
(
"{\"optional_foreign_message\":{},\"repeated_int32\":[2],\"default_int32\":1}"
,
Extensions
.
ToJson
(
m1
));
Assert
.
AreEqual
(
"{\"optional_foreign_message\":{\"c\":7},\"repeated_int32\":[2,6],\"default_int32\":5}"
,
Extensions
.
ToJson
(
m2
));
}
[
Test
]
...
...
src/ProtocolBuffers.Test/TestMimeMessageFormats.cs
View file @
926f4dd3
...
...
@@ -98,9 +98,9 @@ namespace Google.ProtocolBuffers
[
Test
]
public
void
TestMergeFromJsonType
()
{
TestXmlMessage
msg
=
new
TestXmlMessage
.
Builder
().
MergeFrom
(
TestXmlMessage
msg
=
Extensions
.
MergeFrom
(
new
TestXmlMessage
.
Builder
(),
new
MessageFormatOptions
(),
"application/json"
,
new
MemoryStream
(
Encoding
.
ASCII
.
GetBytes
(
TestXmlMessage
.
CreateBuilder
().
SetText
(
"a"
).
SetNumber
(
1
).
Build
().
ToJson
(
)
Extensions
.
ToJson
(
TestXmlMessage
.
CreateBuilder
().
SetText
(
"a"
).
SetNumber
(
1
).
Build
()
)
)))
.
Build
();
Assert
.
AreEqual
(
"a"
,
msg
.
Text
);
...
...
@@ -109,9 +109,9 @@ namespace Google.ProtocolBuffers
[
Test
]
public
void
TestMergeFromXmlType
()
{
TestXmlMessage
msg
=
new
TestXmlMessage
.
Builder
().
MergeFrom
(
TestXmlMessage
msg
=
Extensions
.
MergeFrom
(
new
TestXmlMessage
.
Builder
(),
new
MessageFormatOptions
(),
"application/xml"
,
new
MemoryStream
(
Encoding
.
ASCII
.
GetBytes
(
TestXmlMessage
.
CreateBuilder
().
SetText
(
"a"
).
SetNumber
(
1
).
Build
().
ToXml
(
)
Extensions
.
ToXml
(
TestXmlMessage
.
CreateBuilder
().
SetText
(
"a"
).
SetNumber
(
1
).
Build
()
)
)))
.
Build
();
Assert
.
AreEqual
(
"a"
,
msg
.
Text
);
...
...
@@ -120,7 +120,7 @@ namespace Google.ProtocolBuffers
[
Test
]
public
void
TestMergeFromProtoType
()
{
TestXmlMessage
msg
=
new
TestXmlMessage
.
Builder
().
MergeFrom
(
TestXmlMessage
msg
=
Extensions
.
MergeFrom
(
new
TestXmlMessage
.
Builder
(),
new
MessageFormatOptions
(),
"application/vnd.google.protobuf"
,
new
MemoryStream
(
TestXmlMessage
.
CreateBuilder
().
SetText
(
"a"
).
SetNumber
(
1
).
Build
().
ToByteArray
()
))
...
...
@@ -132,8 +132,8 @@ namespace Google.ProtocolBuffers
public
void
TestWriteToJsonType
()
{
MemoryStream
ms
=
new
MemoryStream
();
TestXmlMessage
.
CreateBuilder
().
SetText
(
"a"
).
SetNumber
(
1
).
Build
()
.
WriteTo
(
new
MessageFormatOptions
(),
"application/json"
,
ms
);
Extensions
.
WriteTo
(
TestXmlMessage
.
CreateBuilder
().
SetText
(
"a"
).
SetNumber
(
1
).
Build
(),
new
MessageFormatOptions
(),
"application/json"
,
ms
);
Assert
.
AreEqual
(
@"{""text"":""a"",""number"":1}"
,
Encoding
.
UTF8
.
GetString
(
ms
.
ToArray
()));
}
...
...
@@ -141,8 +141,8 @@ namespace Google.ProtocolBuffers
public
void
TestWriteToXmlType
()
{
MemoryStream
ms
=
new
MemoryStream
();
TestXmlMessage
.
CreateBuilder
().
SetText
(
"a"
).
SetNumber
(
1
).
Build
()
.
WriteTo
(
new
MessageFormatOptions
(),
"application/xml"
,
ms
);
Extensions
.
WriteTo
(
TestXmlMessage
.
CreateBuilder
().
SetText
(
"a"
).
SetNumber
(
1
).
Build
(),
new
MessageFormatOptions
(),
"application/xml"
,
ms
);
Assert
.
AreEqual
(
"<root><text>a</text><number>1</number></root>"
,
Encoding
.
UTF8
.
GetString
(
ms
.
ToArray
()));
}
...
...
@@ -150,8 +150,8 @@ namespace Google.ProtocolBuffers
public
void
TestWriteToProtoType
()
{
MemoryStream
ms
=
new
MemoryStream
();
TestXmlMessage
.
CreateBuilder
().
SetText
(
"a"
).
SetNumber
(
1
).
Build
()
.
WriteTo
(
new
MessageFormatOptions
(),
"application/vnd.google.protobuf"
,
ms
);
Extensions
.
WriteTo
(
TestXmlMessage
.
CreateBuilder
().
SetText
(
"a"
).
SetNumber
(
1
).
Build
(),
new
MessageFormatOptions
(),
"application/vnd.google.protobuf"
,
ms
);
byte
[]
bytes
=
TestXmlMessage
.
CreateBuilder
().
SetText
(
"a"
).
SetNumber
(
1
).
Build
().
ToByteArray
();
Assert
.
AreEqual
(
bytes
,
ms
.
ToArray
());
...
...
@@ -171,7 +171,7 @@ namespace Google.ProtocolBuffers
XmlReaderRootElementName
=
"my-root-node"
};
TestXmlMessage
msg
=
new
TestXmlMessage
.
Builder
().
MergeFrom
(
TestXmlMessage
msg
=
Extensions
.
MergeFrom
(
new
TestXmlMessage
.
Builder
(),
options
,
"application/xml"
,
ms
)
.
Build
();
...
...
@@ -191,7 +191,7 @@ namespace Google.ProtocolBuffers
};
MemoryStream
ms
=
new
MemoryStream
();
message
.
WriteTo
(
options
,
"application/xml"
,
ms
);
Extensions
.
WriteTo
(
message
,
options
,
"application/xml"
,
ms
);
ms
.
Position
=
0
;
TestXmlMessage
.
Builder
builder
=
TestXmlMessage
.
CreateBuilder
();
...
...
@@ -207,8 +207,8 @@ namespace Google.ProtocolBuffers
public
void
TestJsonFormatted
()
{
MemoryStream
ms
=
new
MemoryStream
();
TestXmlMessage
.
CreateBuilder
().
SetText
(
"a"
).
SetNumber
(
1
).
Build
()
.
WriteTo
(
new
MessageFormatOptions
()
{
FormattedOutput
=
true
},
"application/json"
,
ms
);
Extensions
.
WriteTo
(
TestXmlMessage
.
CreateBuilder
().
SetText
(
"a"
).
SetNumber
(
1
).
Build
(),
new
MessageFormatOptions
()
{
FormattedOutput
=
true
},
"application/json"
,
ms
);
Assert
.
AreEqual
(
"{\r\n \"text\": \"a\",\r\n \"number\": 1\r\n}"
,
Encoding
.
UTF8
.
GetString
(
ms
.
ToArray
()));
}
...
...
@@ -216,8 +216,8 @@ namespace Google.ProtocolBuffers
public
void
TestXmlFormatted
()
{
MemoryStream
ms
=
new
MemoryStream
();
TestXmlMessage
.
CreateBuilder
().
SetText
(
"a"
).
SetNumber
(
1
).
Build
()
.
WriteTo
(
new
MessageFormatOptions
()
{
FormattedOutput
=
true
},
"application/xml"
,
ms
);
Extensions
.
WriteTo
(
TestXmlMessage
.
CreateBuilder
().
SetText
(
"a"
).
SetNumber
(
1
).
Build
(),
new
MessageFormatOptions
()
{
FormattedOutput
=
true
},
"application/xml"
,
ms
);
Assert
.
AreEqual
(
"<root>\r\n <text>a</text>\r\n <number>1</number>\r\n</root>"
,
Encoding
.
UTF8
.
GetString
(
ms
.
ToArray
()));
}
...
...
@@ -233,10 +233,10 @@ namespace Google.ProtocolBuffers
Assert
.
AreEqual
(
1
,
options
.
MimeInputTypes
.
Count
);
Stream
xmlStream
=
new
MemoryStream
(
Encoding
.
ASCII
.
GetBytes
(
TestXmlMessage
.
CreateBuilder
().
SetText
(
"a"
).
SetNumber
(
1
).
Build
().
ToXml
(
)
Extensions
.
ToXml
(
TestXmlMessage
.
CreateBuilder
().
SetText
(
"a"
).
SetNumber
(
1
).
Build
()
)
));
TestXmlMessage
msg
=
new
TestXmlMessage
.
Builder
().
MergeFrom
(
TestXmlMessage
msg
=
Extensions
.
MergeFrom
(
new
TestXmlMessage
.
Builder
(),
options
,
"-custom-XML-mime-type-"
,
xmlStream
)
.
Build
();
Assert
.
AreEqual
(
"a"
,
msg
.
Text
);
...
...
@@ -255,8 +255,8 @@ namespace Google.ProtocolBuffers
Assert
.
AreEqual
(
1
,
options
.
MimeOutputTypes
.
Count
);
MemoryStream
ms
=
new
MemoryStream
();
TestXmlMessage
.
CreateBuilder
().
SetText
(
"a"
).
SetNumber
(
1
).
Build
()
.
WriteTo
(
options
,
"-custom-XML-mime-type-"
,
ms
);
Extensions
.
WriteTo
(
TestXmlMessage
.
CreateBuilder
().
SetText
(
"a"
).
SetNumber
(
1
).
Build
(),
options
,
"-custom-XML-mime-type-"
,
ms
);
Assert
.
AreEqual
(
"<root><text>a</text><number>1</number></root>"
,
Encoding
.
UTF8
.
GetString
(
ms
.
ToArray
()));
}
...
...
src/ProtocolBuffers.Test/TestRpcForMimeTypes.cs
View file @
926f4dd3
...
...
@@ -123,8 +123,8 @@ namespace Google.ProtocolBuffers
void
IHttpTransfer
.
Execute
(
string
method
,
string
contentType
,
Stream
input
,
string
acceptType
,
Stream
output
)
{
//
Extension for: Google.ProtocolBuffers.Serialization.Http.ServiceExtensions.HttpCallMethod(_stub,
_stub
.
HttpCallMethod
(
//
3.5: _stub.HttpCallMethod(
Extensions
.
HttpCallMethod
(
_stub
,
method
,
Options
,
contentType
,
input
,
acceptType
,
output
...
...
@@ -165,14 +165,14 @@ namespace Google.ProtocolBuffers
MemoryStream
output
=
new
MemoryStream
();
//Write to _mimeType format
request
.
WriteTo
(
Options
,
_mimeType
,
input
);
Extensions
.
WriteTo
(
request
,
Options
,
_mimeType
,
input
);
input
.
Position
=
0
;
_wire
.
Execute
(
method
,
_mimeType
,
input
,
_mimeType
,
output
);
//Read from _mimeType format
output
.
Position
=
0
;
response
.
MergeFrom
(
Options
,
_mimeType
,
output
);
Extensions
.
MergeFrom
(
response
,
Options
,
_mimeType
,
output
);
return
response
.
Build
();
}
...
...
src/ProtocolBuffers.Test/TestWriterFormatJson.cs
View file @
926f4dd3
...
...
@@ -15,7 +15,8 @@ namespace Google.ProtocolBuffers
{
TestXmlMessage
.
Builder
builder
=
TestXmlMessage
.
CreateBuilder
();
builder
.
MergeFromJson
(
@"{""valid"":true}"
);
//3.5: builder.MergeFromJson(@"{""valid"":true}");
Extensions
.
MergeFromJson
(
builder
,
@"{""valid"":true}"
);
TestXmlMessage
message
=
builder
.
Build
();
Assert
.
AreEqual
(
true
,
message
.
Valid
);
...
...
@@ -29,7 +30,8 @@ namespace Google.ProtocolBuffers
.
SetValid
(
true
)
.
Build
();
string
json
=
message
.
ToJson
();
//3.5: string json = message.ToJson();
string
json
=
Extensions
.
ToJson
(
message
);
Assert
.
AreEqual
(
@"{""valid"":true}"
,
json
);
}
...
...
@@ -100,9 +102,9 @@ namespace Google.ProtocolBuffers
public
void
TestToJsonParseFromJson
()
{
TestAllTypes
msg
=
new
TestAllTypes
.
Builder
().
SetDefaultBool
(
true
).
Build
();
string
json
=
msg
.
ToJson
(
);
string
json
=
Extensions
.
ToJson
(
msg
);
Assert
.
AreEqual
(
"{\"default_bool\":true}"
,
json
);
TestAllTypes
copy
=
new
TestAllTypes
.
Builder
().
MergeFromJson
(
json
).
Build
();
TestAllTypes
copy
=
Extensions
.
MergeFromJson
(
new
TestAllTypes
.
Builder
(),
json
).
Build
();
Assert
.
IsTrue
(
copy
.
HasDefaultBool
&&
copy
.
DefaultBool
);
Assert
.
AreEqual
(
msg
,
copy
);
}
...
...
@@ -111,9 +113,9 @@ namespace Google.ProtocolBuffers
public
void
TestToJsonParseFromJsonReader
()
{
TestAllTypes
msg
=
new
TestAllTypes
.
Builder
().
SetDefaultBool
(
true
).
Build
();
string
json
=
msg
.
ToJson
(
);
string
json
=
Extensions
.
ToJson
(
msg
);
Assert
.
AreEqual
(
"{\"default_bool\":true}"
,
json
);
TestAllTypes
copy
=
new
TestAllTypes
.
Builder
().
MergeFromJson
(
new
StringReader
(
json
)).
Build
();
TestAllTypes
copy
=
Extensions
.
MergeFromJson
(
new
TestAllTypes
.
Builder
(),
new
StringReader
(
json
)).
Build
();
Assert
.
IsTrue
(
copy
.
HasDefaultBool
&&
copy
.
DefaultBool
);
Assert
.
AreEqual
(
msg
,
copy
);
}
...
...
@@ -429,7 +431,7 @@ namespace Google.ProtocolBuffers
StringBuilder
sb
=
new
StringBuilder
(
8192
);
for
(
int
i
=
0
;
i
<
80
;
i
++)
sb
.
Append
(
"{\"child\":"
);
TestXmlRescursive
msg
=
new
TestXmlRescursive
.
Builder
().
MergeFromJson
(
sb
.
ToString
()).
Build
();
TestXmlRescursive
msg
=
Extensions
.
MergeFromJson
(
new
TestXmlRescursive
.
Builder
(),
sb
.
ToString
()).
Build
();
}
[
Test
,
ExpectedException
(
typeof
(
FormatException
))]
public
void
FailWithEmptyText
()
...
...
src/ProtocolBuffers.Test/TestWriterFormatXml.cs
View file @
926f4dd3
...
...
@@ -18,7 +18,8 @@ namespace Google.ProtocolBuffers
TestXmlMessage
.
Builder
builder
=
TestXmlMessage
.
CreateBuilder
();
XmlReader
rdr
=
XmlReader
.
Create
(
new
StringReader
(
@"<root><valid>true</valid></root>"
));
builder
.
MergeFromXml
(
rdr
);
//3.5: builder.MergeFromXml(rdr);
Extensions
.
MergeFromXml
(
builder
,
rdr
);
TestXmlMessage
message
=
builder
.
Build
();
Assert
.
AreEqual
(
true
,
message
.
Valid
);
...
...
@@ -32,7 +33,8 @@ namespace Google.ProtocolBuffers
.
SetValid
(
true
)
.
Build
();
string
Xml
=
message
.
ToXml
();
//3.5: string Xml = message.ToXml();
string
Xml
=
Extensions
.
ToXml
(
message
);
Assert
.
AreEqual
(
@"<root><valid>true</valid></root>"
,
Xml
);
}
...
...
@@ -75,9 +77,9 @@ namespace Google.ProtocolBuffers
public
void
TestToXmlParseFromXml
()
{
TestAllTypes
msg
=
new
TestAllTypes
.
Builder
().
SetDefaultBool
(
true
).
Build
();
string
xml
=
msg
.
ToXml
(
);
string
xml
=
Extensions
.
ToXml
(
msg
);
Assert
.
AreEqual
(
"<root><default_bool>true</default_bool></root>"
,
xml
);
TestAllTypes
copy
=
new
TestAllTypes
.
Builder
().
MergeFromXml
(
XmlReader
.
Create
(
new
StringReader
(
xml
))).
Build
();
TestAllTypes
copy
=
Extensions
.
MergeFromXml
(
new
TestAllTypes
.
Builder
(),
XmlReader
.
Create
(
new
StringReader
(
xml
))).
Build
();
Assert
.
IsTrue
(
copy
.
HasDefaultBool
&&
copy
.
DefaultBool
);
Assert
.
AreEqual
(
msg
,
copy
);
}
...
...
@@ -86,9 +88,9 @@ namespace Google.ProtocolBuffers
public
void
TestToXmlParseFromXmlWithRootName
()
{
TestAllTypes
msg
=
new
TestAllTypes
.
Builder
().
SetDefaultBool
(
true
).
Build
();
string
xml
=
msg
.
ToXml
(
"message"
);
string
xml
=
Extensions
.
ToXml
(
msg
,
"message"
);
Assert
.
AreEqual
(
"<message><default_bool>true</default_bool></message>"
,
xml
);
TestAllTypes
copy
=
new
TestAllTypes
.
Builder
().
MergeFromXml
(
"message"
,
XmlReader
.
Create
(
new
StringReader
(
xml
))).
Build
();
TestAllTypes
copy
=
Extensions
.
MergeFromXml
(
new
TestAllTypes
.
Builder
(),
"message"
,
XmlReader
.
Create
(
new
StringReader
(
xml
))).
Build
();
Assert
.
IsTrue
(
copy
.
HasDefaultBool
&&
copy
.
DefaultBool
);
Assert
.
AreEqual
(
msg
,
copy
);
}
...
...
@@ -447,7 +449,7 @@ namespace Google.ProtocolBuffers
StringBuilder
sb
=
new
StringBuilder
(
8192
);
for
(
int
i
=
0
;
i
<
80
;
i
++)
sb
.
Append
(
"<child>"
);
TestXmlRescursive
msg
=
new
TestXmlRescursive
.
Builder
().
MergeFromXml
(
"child"
,
XmlReader
.
Create
(
new
StringReader
(
sb
.
ToString
()))).
Build
();
TestXmlRescursive
msg
=
Extensions
.
MergeFromXml
(
new
TestXmlRescursive
.
Builder
(),
"child"
,
XmlReader
.
Create
(
new
StringReader
(
sb
.
ToString
()))).
Build
();
}
}
}
src/ProtocolBuffers.sln
View file @
926f4dd3
Microsoft Visual Studio Solution File, Format Version 11.00
# Visual Studio 2010
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "proto", "proto", "{1F896D5C-5FC2-4671-9216-781CB8187EC7}"
ProjectSection(SolutionItems) = preProject
..\protos\tutorial\addressbook.proto = ..\protos\tutorial\addressbook.proto
...
...
@@ -20,8 +19,8 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "unittest", "unittest", "{C8
..\protos\google\protobuf\unittest_enormous_descriptor.proto = ..\protos\google\protobuf\unittest_enormous_descriptor.proto
..\protos\extest\unittest_extras.proto = ..\protos\extest\unittest_extras.proto
..\protos\extest\unittest_extras_full.proto = ..\protos\extest\unittest_extras_full.proto
..\protos\extest\unittest_extras_xmltest.proto = ..\protos\extest\unittest_extras_xmltest.proto
..\protos\extest\unittest_extras_lite.proto = ..\protos\extest\unittest_extras_lite.proto
..\protos\extest\unittest_extras_xmltest.proto = ..\protos\extest\unittest_extras_xmltest.proto
..\protos\extest\unittest_generic_services.proto = ..\protos\extest\unittest_generic_services.proto
..\protos\google\protobuf\unittest_import.proto = ..\protos\google\protobuf\unittest_import.proto
..\protos\google\protobuf\unittest_import_lite.proto = ..\protos\google\protobuf\unittest_import_lite.proto
...
...
@@ -59,14 +58,13 @@ Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "ProtocolBuffersLiteMixed.Te
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "build", "build", "{66ED1950-AD27-42D7-88F8-94355AEC8225}"
ProjectSection(SolutionItems) = preProject
..\build\Build.bat = ..\build\Build.bat
..\build\build.csproj = ..\build\build.csproj
..\build\Build20.bat = ..\build\Build20.bat
..\build\build35.bat = ..\build\build35.bat
..\build\build40.bat = ..\build\build40.bat
..\build\BuildAll.bat = ..\build\BuildAll.bat
..\build\BuildSilverlight2.bat = ..\build\BuildSilverlight2.bat
..\build\Common.targets = ..\build\Common.targets
..\build\GenerateCompletePackage.bat = ..\build\GenerateCompletePackage.bat
..\build\GenerateReleasePackage.bat = ..\build\GenerateReleasePackage.bat
..\build\Google.ProtocolBuffers.nuspec = ..\build\Google.ProtocolBuffers.nuspec
..\build\Google.ProtocolBuffersLite.nuspec = ..\build\Google.ProtocolBuffersLite.nuspec
..\build\PublishRelease.bat = ..\build\PublishRelease.bat
...
...
@@ -79,96 +77,96 @@ Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "ProtocolBuffersLite.Seriali
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug_Silverlight
2|Any CPU = Debug_Silverlight2
|Any CPU
Debug_Silverlight
|Any CPU = Debug_Silverlight
|Any CPU
Debug|Any CPU = Debug|Any CPU
Release_Silverlight
2|Any CPU = Release_Silverlight2
|Any CPU
Release_Silverlight
|Any CPU = Release_Silverlight
|Any CPU
Release|Any CPU = Release|Any CPU
EndGlobalSection
GlobalSection(ProjectConfigurationPlatforms) = postSolution
{6908BDCE-D925-43F3-94AC-A531E6DF2591}.Debug_Silverlight
2|Any CPU.ActiveCfg = Debug_Silverlight2
|Any CPU
{6908BDCE-D925-43F3-94AC-A531E6DF2591}.Debug_Silverlight
2|Any CPU.Build.0 = Debug_Silverlight2
|Any CPU
{6908BDCE-D925-43F3-94AC-A531E6DF2591}.Debug_Silverlight
|Any CPU.ActiveCfg = Debug_Silverlight
|Any CPU
{6908BDCE-D925-43F3-94AC-A531E6DF2591}.Debug_Silverlight
|Any CPU.Build.0 = Debug_Silverlight
|Any CPU
{6908BDCE-D925-43F3-94AC-A531E6DF2591}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{6908BDCE-D925-43F3-94AC-A531E6DF2591}.Debug|Any CPU.Build.0 = Debug|Any CPU
{6908BDCE-D925-43F3-94AC-A531E6DF2591}.Release_Silverlight
2|Any CPU.ActiveCfg = Release_Silverlight2
|Any CPU
{6908BDCE-D925-43F3-94AC-A531E6DF2591}.Release_Silverlight
2|Any CPU.Build.0 = Release_Silverlight2
|Any CPU
{6908BDCE-D925-43F3-94AC-A531E6DF2591}.Release_Silverlight
|Any CPU.ActiveCfg = Release_Silverlight
|Any CPU
{6908BDCE-D925-43F3-94AC-A531E6DF2591}.Release_Silverlight
|Any CPU.Build.0 = Release_Silverlight
|Any CPU
{6908BDCE-D925-43F3-94AC-A531E6DF2591}.Release|Any CPU.ActiveCfg = Release|Any CPU
{6908BDCE-D925-43F3-94AC-A531E6DF2591}.Release|Any CPU.Build.0 = Release|Any CPU
{DD01ED24-3750-4567-9A23-1DB676A15610}.Debug_Silverlight
2
|Any CPU.ActiveCfg = Debug|Any CPU
{DD01ED24-3750-4567-9A23-1DB676A15610}.Debug_Silverlight|Any CPU.ActiveCfg = Debug|Any CPU
{DD01ED24-3750-4567-9A23-1DB676A15610}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{DD01ED24-3750-4567-9A23-1DB676A15610}.Debug|Any CPU.Build.0 = Debug|Any CPU
{DD01ED24-3750-4567-9A23-1DB676A15610}.Release_Silverlight
2
|Any CPU.ActiveCfg = Release|Any CPU
{DD01ED24-3750-4567-9A23-1DB676A15610}.Release_Silverlight|Any CPU.ActiveCfg = Release|Any CPU
{DD01ED24-3750-4567-9A23-1DB676A15610}.Release|Any CPU.ActiveCfg = Release|Any CPU
{DD01ED24-3750-4567-9A23-1DB676A15610}.Release|Any CPU.Build.0 = Release|Any CPU
{250ADE34-82FD-4BAE-86D5-985FBE589C4A}.Debug_Silverlight
2
|Any CPU.ActiveCfg = Debug|Any CPU
{250ADE34-82FD-4BAE-86D5-985FBE589C4A}.Debug_Silverlight|Any CPU.ActiveCfg = Debug|Any CPU
{250ADE34-82FD-4BAE-86D5-985FBE589C4A}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{250ADE34-82FD-4BAE-86D5-985FBE589C4A}.Debug|Any CPU.Build.0 = Debug|Any CPU
{250ADE34-82FD-4BAE-86D5-985FBE589C4A}.Release_Silverlight
2
|Any CPU.ActiveCfg = Release|Any CPU
{250ADE34-82FD-4BAE-86D5-985FBE589C4A}.Release_Silverlight|Any CPU.ActiveCfg = Release|Any CPU
{250ADE34-82FD-4BAE-86D5-985FBE589C4A}.Release|Any CPU.ActiveCfg = Release|Any CPU
{250ADE34-82FD-4BAE-86D5-985FBE589C4A}.Release|Any CPU.Build.0 = Release|Any CPU
{C268DA4C-4004-47DA-AF23-44C983281A68}.Debug_Silverlight
2
|Any CPU.ActiveCfg = Debug|Any CPU
{C268DA4C-4004-47DA-AF23-44C983281A68}.Debug_Silverlight|Any CPU.ActiveCfg = Debug|Any CPU
{C268DA4C-4004-47DA-AF23-44C983281A68}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{C268DA4C-4004-47DA-AF23-44C983281A68}.Debug|Any CPU.Build.0 = Debug|Any CPU
{C268DA4C-4004-47DA-AF23-44C983281A68}.Release_Silverlight
2
|Any CPU.ActiveCfg = Release|Any CPU
{C268DA4C-4004-47DA-AF23-44C983281A68}.Release_Silverlight|Any CPU.ActiveCfg = Release|Any CPU
{C268DA4C-4004-47DA-AF23-44C983281A68}.Release|Any CPU.ActiveCfg = Release|Any CPU
{C268DA4C-4004-47DA-AF23-44C983281A68}.Release|Any CPU.Build.0 = Release|Any CPU
{A31F5FB2-4FF3-432A-B35B-5CD203606311}.Debug_Silverlight
2
|Any CPU.ActiveCfg = Debug|Any CPU
{A31F5FB2-4FF3-432A-B35B-5CD203606311}.Debug_Silverlight|Any CPU.ActiveCfg = Debug|Any CPU
{A31F5FB2-4FF3-432A-B35B-5CD203606311}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{A31F5FB2-4FF3-432A-B35B-5CD203606311}.Debug|Any CPU.Build.0 = Debug|Any CPU
{A31F5FB2-4FF3-432A-B35B-5CD203606311}.Release_Silverlight
2
|Any CPU.ActiveCfg = Release|Any CPU
{A31F5FB2-4FF3-432A-B35B-5CD203606311}.Release_Silverlight|Any CPU.ActiveCfg = Release|Any CPU
{A31F5FB2-4FF3-432A-B35B-5CD203606311}.Release|Any CPU.ActiveCfg = Release|Any CPU
{A31F5FB2-4FF3-432A-B35B-5CD203606311}.Release|Any CPU.Build.0 = Release|Any CPU
{8F09AF72-3327-4FA7-BC09-070B80221AB9}.Debug_Silverlight
2
|Any CPU.ActiveCfg = Debug|Any CPU
{8F09AF72-3327-4FA7-BC09-070B80221AB9}.Debug_Silverlight|Any CPU.ActiveCfg = Debug|Any CPU
{8F09AF72-3327-4FA7-BC09-070B80221AB9}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{8F09AF72-3327-4FA7-BC09-070B80221AB9}.Debug|Any CPU.Build.0 = Debug|Any CPU
{8F09AF72-3327-4FA7-BC09-070B80221AB9}.Release_Silverlight
2
|Any CPU.ActiveCfg = Release|Any CPU
{8F09AF72-3327-4FA7-BC09-070B80221AB9}.Release_Silverlight|Any CPU.ActiveCfg = Release|Any CPU
{8F09AF72-3327-4FA7-BC09-070B80221AB9}.Release|Any CPU.ActiveCfg = Release|Any CPU
{8F09AF72-3327-4FA7-BC09-070B80221AB9}.Release|Any CPU.Build.0 = Release|Any CPU
{C7A4A435-2813-41C8-AA87-BD914BA5223D}.Debug_Silverlight
2
|Any CPU.ActiveCfg = Debug|Any CPU
{C7A4A435-2813-41C8-AA87-BD914BA5223D}.Debug_Silverlight|Any CPU.ActiveCfg = Debug|Any CPU
{C7A4A435-2813-41C8-AA87-BD914BA5223D}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{C7A4A435-2813-41C8-AA87-BD914BA5223D}.Debug|Any CPU.Build.0 = Debug|Any CPU
{C7A4A435-2813-41C8-AA87-BD914BA5223D}.Release_Silverlight
2
|Any CPU.ActiveCfg = Release|Any CPU
{C7A4A435-2813-41C8-AA87-BD914BA5223D}.Release_Silverlight|Any CPU.ActiveCfg = Release|Any CPU
{C7A4A435-2813-41C8-AA87-BD914BA5223D}.Release|Any CPU.ActiveCfg = Release|Any CPU
{C7A4A435-2813-41C8-AA87-BD914BA5223D}.Release|Any CPU.Build.0 = Release|Any CPU
{D7282E99-2DC3-405B-946F-177DB2FD2AE2}.Debug_Silverlight
2
|Any CPU.ActiveCfg = Debug|Any CPU
{D7282E99-2DC3-405B-946F-177DB2FD2AE2}.Debug_Silverlight|Any CPU.ActiveCfg = Debug|Any CPU
{D7282E99-2DC3-405B-946F-177DB2FD2AE2}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{D7282E99-2DC3-405B-946F-177DB2FD2AE2}.Debug|Any CPU.Build.0 = Debug|Any CPU
{D7282E99-2DC3-405B-946F-177DB2FD2AE2}.Release_Silverlight
2
|Any CPU.ActiveCfg = Release|Any CPU
{D7282E99-2DC3-405B-946F-177DB2FD2AE2}.Release_Silverlight|Any CPU.ActiveCfg = Release|Any CPU
{D7282E99-2DC3-405B-946F-177DB2FD2AE2}.Release|Any CPU.ActiveCfg = Release|Any CPU
{D7282E99-2DC3-405B-946F-177DB2FD2AE2}.Release|Any CPU.Build.0 = Release|Any CPU
{6969BDCE-D925-43F3-94AC-A531E6DF2591}.Debug_Silverlight
2|Any CPU.ActiveCfg = Debug_Silverlight2
|Any CPU
{6969BDCE-D925-43F3-94AC-A531E6DF2591}.Debug_Silverlight
2|Any CPU.Build.0 = Debug_Silverlight2
|Any CPU
{6969BDCE-D925-43F3-94AC-A531E6DF2591}.Debug_Silverlight
|Any CPU.ActiveCfg = Debug_Silverlight
|Any CPU
{6969BDCE-D925-43F3-94AC-A531E6DF2591}.Debug_Silverlight
|Any CPU.Build.0 = Debug_Silverlight
|Any CPU
{6969BDCE-D925-43F3-94AC-A531E6DF2591}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{6969BDCE-D925-43F3-94AC-A531E6DF2591}.Debug|Any CPU.Build.0 = Debug|Any CPU
{6969BDCE-D925-43F3-94AC-A531E6DF2591}.Release_Silverlight
2|Any CPU.ActiveCfg = Release_Silverlight2
|Any CPU
{6969BDCE-D925-43F3-94AC-A531E6DF2591}.Release_Silverlight
2|Any CPU.Build.0 = Release_Silverlight2
|Any CPU
{6969BDCE-D925-43F3-94AC-A531E6DF2591}.Release_Silverlight
|Any CPU.ActiveCfg = Release_Silverlight
|Any CPU
{6969BDCE-D925-43F3-94AC-A531E6DF2591}.Release_Silverlight
|Any CPU.Build.0 = Release_Silverlight
|Any CPU
{6969BDCE-D925-43F3-94AC-A531E6DF2591}.Release|Any CPU.ActiveCfg = Release|Any CPU
{6969BDCE-D925-43F3-94AC-A531E6DF2591}.Release|Any CPU.Build.0 = Release|Any CPU
{EE01ED24-3750-4567-9A23-1DB676A15610}.Debug_Silverlight
2
|Any CPU.ActiveCfg = Debug|Any CPU
{EE01ED24-3750-4567-9A23-1DB676A15610}.Debug_Silverlight|Any CPU.ActiveCfg = Debug|Any CPU
{EE01ED24-3750-4567-9A23-1DB676A15610}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{EE01ED24-3750-4567-9A23-1DB676A15610}.Debug|Any CPU.Build.0 = Debug|Any CPU
{EE01ED24-3750-4567-9A23-1DB676A15610}.Release_Silverlight
2
|Any CPU.ActiveCfg = Release|Any CPU
{EE01ED24-3750-4567-9A23-1DB676A15610}.Release_Silverlight|Any CPU.ActiveCfg = Release|Any CPU
{EE01ED24-3750-4567-9A23-1DB676A15610}.Release|Any CPU.ActiveCfg = Release|Any CPU
{EE01ED24-3750-4567-9A23-1DB676A15610}.Release|Any CPU.Build.0 = Release|Any CPU
{EEFFED24-3750-4567-9A23-1DB676A15610}.Debug_Silverlight
2
|Any CPU.ActiveCfg = Debug|Any CPU
{EEFFED24-3750-4567-9A23-1DB676A15610}.Debug_Silverlight|Any CPU.ActiveCfg = Debug|Any CPU
{EEFFED24-3750-4567-9A23-1DB676A15610}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{EEFFED24-3750-4567-9A23-1DB676A15610}.Debug|Any CPU.Build.0 = Debug|Any CPU
{EEFFED24-3750-4567-9A23-1DB676A15610}.Release_Silverlight
2
|Any CPU.ActiveCfg = Release|Any CPU
{EEFFED24-3750-4567-9A23-1DB676A15610}.Release_Silverlight|Any CPU.ActiveCfg = Release|Any CPU
{EEFFED24-3750-4567-9A23-1DB676A15610}.Release|Any CPU.ActiveCfg = Release|Any CPU
{EEFFED24-3750-4567-9A23-1DB676A15610}.Release|Any CPU.Build.0 = Release|Any CPU
{231391AF-449C-4A39-986C-AD7F270F4750}.Debug_Silverlight
2|Any CPU.ActiveCfg = Debug_Silverlight2
|Any CPU
{231391AF-449C-4A39-986C-AD7F270F4750}.Debug_Silverlight
2|Any CPU.Build.0 = Debug_Silverlight2
|Any CPU
{231391AF-449C-4A39-986C-AD7F270F4750}.Debug_Silverlight
|Any CPU.ActiveCfg = Debug_Silverlight
|Any CPU
{231391AF-449C-4A39-986C-AD7F270F4750}.Debug_Silverlight
|Any CPU.Build.0 = Debug_Silverlight
|Any CPU
{231391AF-449C-4A39-986C-AD7F270F4750}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{231391AF-449C-4A39-986C-AD7F270F4750}.Debug|Any CPU.Build.0 = Debug|Any CPU
{231391AF-449C-4A39-986C-AD7F270F4750}.Release_Silverlight
2|Any CPU.ActiveCfg = Release_Silverlight2
|Any CPU
{231391AF-449C-4A39-986C-AD7F270F4750}.Release_Silverlight
2|Any CPU.Build.0 = Release_Silverlight2
|Any CPU
{231391AF-449C-4A39-986C-AD7F270F4750}.Release_Silverlight
|Any CPU.ActiveCfg = Release_Silverlight
|Any CPU
{231391AF-449C-4A39-986C-AD7F270F4750}.Release_Silverlight
|Any CPU.Build.0 = Release_Silverlight
|Any CPU
{231391AF-449C-4A39-986C-AD7F270F4750}.Release|Any CPU.ActiveCfg = Release|Any CPU
{231391AF-449C-4A39-986C-AD7F270F4750}.Release|Any CPU.Build.0 = Release|Any CPU
{E067A59D-9D0A-4A1F-92B1-38E4457241D1}.Debug_Silverlight
2|Any CPU.ActiveCfg = Debug_Silverlight2
|Any CPU
{E067A59D-9D0A-4A1F-92B1-38E4457241D1}.Debug_Silverlight
2|Any CPU.Build.0 = Debug_Silverlight2
|Any CPU
{E067A59D-9D0A-4A1F-92B1-38E4457241D1}.Debug_Silverlight
|Any CPU.ActiveCfg = Debug_Silverlight
|Any CPU
{E067A59D-9D0A-4A1F-92B1-38E4457241D1}.Debug_Silverlight
|Any CPU.Build.0 = Debug_Silverlight
|Any CPU
{E067A59D-9D0A-4A1F-92B1-38E4457241D1}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{E067A59D-9D0A-4A1F-92B1-38E4457241D1}.Debug|Any CPU.Build.0 = Debug|Any CPU
{E067A59D-9D0A-4A1F-92B1-38E4457241D1}.Release_Silverlight
2|Any CPU.ActiveCfg = Release_Silverlight2
|Any CPU
{E067A59D-9D0A-4A1F-92B1-38E4457241D1}.Release_Silverlight
2|Any CPU.Build.0 = Release_Silverlight2
|Any CPU
{E067A59D-9D0A-4A1F-92B1-38E4457241D1}.Release_Silverlight
|Any CPU.ActiveCfg = Release_Silverlight
|Any CPU
{E067A59D-9D0A-4A1F-92B1-38E4457241D1}.Release_Silverlight
|Any CPU.Build.0 = Release_Silverlight
|Any CPU
{E067A59D-9D0A-4A1F-92B1-38E4457241D1}.Release|Any CPU.ActiveCfg = Release|Any CPU
{E067A59D-9D0A-4A1F-92B1-38E4457241D1}.Release|Any CPU.Build.0 = Release|Any CPU
EndGlobalSection
...
...
src/ProtocolBuffers/CodedInputStream.cs
View file @
926f4dd3
...
...
@@ -231,7 +231,7 @@ namespace Google.ProtocolBuffers
/// </summary>
public
bool
ReadDouble
(
ref
double
value
)
{
#if SILVERLIGHT
2
|| COMPACT_FRAMEWORK_35
#if SILVERLIGHT || COMPACT_FRAMEWORK_35
if
(
BitConverter
.
IsLittleEndian
&&
8
<=
bufferSize
-
bufferPos
)
{
value
=
BitConverter
.
ToDouble
(
buffer
,
bufferPos
);
...
...
src/ProtocolBuffers/CodedOutputStream.cs
View file @
926f4dd3
...
...
@@ -496,7 +496,7 @@ namespace Google.ProtocolBuffers
/// </summary>
public
void
WriteDoubleNoTag
(
double
value
)
{
#if SILVERLIGHT
2
|| COMPACT_FRAMEWORK_35
#if SILVERLIGHT || COMPACT_FRAMEWORK_35
byte
[]
rawBytes
=
BitConverter
.
GetBytes
(
value
);
if
(!
BitConverter
.
IsLittleEndian
)
ByteArray
.
Reverse
(
rawBytes
);
...
...
src/ProtocolBuffers/CustomSerialization.cs
View file @
926f4dd3
...
...
@@ -40,7 +40,7 @@ using System.Runtime.Serialization;
/*
* This entire source file is not supported on the Silverlight platform
*/
#if !SILVERLIGHT
2
#if !SILVERLIGHT
namespace
Google.ProtocolBuffers
{
/*
...
...
src/ProtocolBuffers/EnumLite.cs
View file @
926f4dd3
...
...
@@ -98,7 +98,7 @@ namespace Google.ProtocolBuffers
public
EnumLiteMap
()
{
items
=
new
SortedList
<
int
,
IEnumLite
>();
#if SILVERLIGHT
2
#if SILVERLIGHT
// Silverlight doesn't support Enum.GetValues
// TODO(jonskeet): Validate that this reflection is permitted, e.g. in Windows Phone 7
foreach
(
System
.
Reflection
.
FieldInfo
fi
in
typeof
(
TEnum
).
GetFields
(
System
.
Reflection
.
BindingFlags
.
Static
|
System
.
Reflection
.
BindingFlags
.
Public
))
...
...
src/ProtocolBuffers/ProtocolBuffers.csproj
View file @
926f4dd3
...
...
@@ -34,6 +34,7 @@
<IsWebBootstrapper>
false
</IsWebBootstrapper>
<UseApplicationTrust>
false
</UseApplicationTrust>
<BootstrapperEnabled>
true
</BootstrapperEnabled>
<SilverlightVersion
Condition=
" '$(SilverlightVersion)' == '' "
>
v2.0
</SilverlightVersion>
</PropertyGroup>
<PropertyGroup
Condition=
" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' "
>
<DebugSymbols>
true
</DebugSymbols>
...
...
@@ -60,26 +61,26 @@
<NoStdLib>
true
</NoStdLib>
<CodeAnalysisRuleSet>
AllRules.ruleset
</CodeAnalysisRuleSet>
</PropertyGroup>
<PropertyGroup
Condition=
"'$(Configuration)|$(Platform)' == 'Debug_Silverlight
2
|AnyCPU'"
>
<PropertyGroup
Condition=
"'$(Configuration)|$(Platform)' == 'Debug_Silverlight|AnyCPU'"
>
<DebugSymbols>
true
</DebugSymbols>
<DebugType>
full
</DebugType>
<Optimize>
false
</Optimize>
<OutputPath>
bin\Debug_Silverlight
2
\
</OutputPath>
<OutputPath>
bin\Debug_Silverlight\
</OutputPath>
<DocumentationFile>
$(OutputPath)\$(AssemblyName).xml
</DocumentationFile>
<NoWarn>
1591, 1570, 1571, 1572, 1573, 1574
</NoWarn>
<DefineConstants>
DEBUG;TRACE;SILVERLIGHT
2
</DefineConstants>
<DefineConstants>
DEBUG;TRACE;SILVERLIGHT
</DefineConstants>
<ErrorReport>
prompt
</ErrorReport>
<WarningLevel>
4
</WarningLevel>
<NoStdLib>
true
</NoStdLib>
<CodeAnalysisRuleSet>
AllRules.ruleset
</CodeAnalysisRuleSet>
</PropertyGroup>
<PropertyGroup
Condition=
"'$(Configuration)|$(Platform)' == 'Release_Silverlight
2
|AnyCPU'"
>
<PropertyGroup
Condition=
"'$(Configuration)|$(Platform)' == 'Release_Silverlight|AnyCPU'"
>
<DebugType>
pdbonly
</DebugType>
<Optimize>
true
</Optimize>
<OutputPath>
bin\Release_Silverlight
2
\
</OutputPath>
<OutputPath>
bin\Release_Silverlight\
</OutputPath>
<DocumentationFile>
$(OutputPath)\$(AssemblyName).xml
</DocumentationFile>
<NoWarn>
1591, 1570, 1571, 1572, 1573, 1574
</NoWarn>
<DefineConstants>
TRACE;SILVERLIGHT
2
</DefineConstants>
<DefineConstants>
TRACE;SILVERLIGHT
</DefineConstants>
<ErrorReport>
prompt
</ErrorReport>
<WarningLevel>
4
</WarningLevel>
<NoStdLib>
true
</NoStdLib>
...
...
@@ -211,8 +212,8 @@
</ItemGroup>
<Import
Project=
"$(MSBuildToolsPath)\Microsoft.CSharp.targets"
Condition=
" '$(Configuration)' == 'Debug' "
/>
<Import
Project=
"$(MSBuildToolsPath)\Microsoft.CSharp.targets"
Condition=
" '$(Configuration)' == 'Release' "
/>
<Import
Project=
"$(MSBuildExtensionsPath)\Microsoft\Silverlight\
v2.0\Microsoft.Silverlight.CSharp.targets"
Condition=
" '$(Configuration)' == 'Debug_Silverlight2
' "
/>
<Import
Project=
"$(MSBuildExtensionsPath)\Microsoft\Silverlight\
v2.0\Microsoft.Silverlight.CSharp.targets"
Condition=
" '$(Configuration)' == 'Release_Silverlight2
' "
/>
<Import
Project=
"$(MSBuildExtensionsPath)\Microsoft\Silverlight\
$(SilverlightVersion)\Microsoft.Silverlight.CSharp.targets"
Condition=
" '$(Configuration)' == 'Debug_Silverlight
' "
/>
<Import
Project=
"$(MSBuildExtensionsPath)\Microsoft\Silverlight\
$(SilverlightVersion)\Microsoft.Silverlight.CSharp.targets"
Condition=
" '$(Configuration)' == 'Release_Silverlight
' "
/>
<!-- To modify your build process, add your task inside one of the targets below and uncomment it.
Other similar extension points exist, see Microsoft.Common.targets.
<Target Name="BeforeBuild">
...
...
src/ProtocolBuffers/ProtocolBuffersLite.csproj
View file @
926f4dd3
...
...
@@ -18,6 +18,7 @@
</FileUpgradeFlags>
<OldToolsVersion>
3.5
</OldToolsVersion>
<UpgradeBackupLocation
/>
<SilverlightVersion
Condition=
" '$(SilverlightVersion)' == '' "
>
v2.0
</SilverlightVersion>
</PropertyGroup>
<PropertyGroup
Condition=
" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' "
>
<DebugSymbols>
true
</DebugSymbols>
...
...
@@ -42,26 +43,26 @@
<WarningLevel>
4
</WarningLevel>
<NoStdLib>
true
</NoStdLib>
</PropertyGroup>
<PropertyGroup
Condition=
"'$(Configuration)|$(Platform)' == 'Debug_Silverlight
2
|AnyCPU'"
>
<PropertyGroup
Condition=
"'$(Configuration)|$(Platform)' == 'Debug_Silverlight|AnyCPU'"
>
<DebugSymbols>
true
</DebugSymbols>
<DebugType>
full
</DebugType>
<Optimize>
false
</Optimize>
<OutputPath>
bin\Debug_Silverlight
2
\
</OutputPath>
<OutputPath>
bin\Debug_Silverlight\
</OutputPath>
<DocumentationFile>
$(OutputPath)\$(AssemblyName).xml
</DocumentationFile>
<NoWarn>
1591, 1570, 1571, 1572, 1573, 1574
</NoWarn>
<DefineConstants>
DEBUG;TRACE;SILVERLIGHT
2
;LITE
</DefineConstants>
<DefineConstants>
DEBUG;TRACE;SILVERLIGHT;LITE
</DefineConstants>
<ErrorReport>
prompt
</ErrorReport>
<WarningLevel>
4
</WarningLevel>
<NoStdLib>
true
</NoStdLib>
<CodeAnalysisRuleSet>
AllRules.ruleset
</CodeAnalysisRuleSet>
</PropertyGroup>
<PropertyGroup
Condition=
"'$(Configuration)|$(Platform)' == 'Release_Silverlight
2
|AnyCPU'"
>
<PropertyGroup
Condition=
"'$(Configuration)|$(Platform)' == 'Release_Silverlight|AnyCPU'"
>
<DebugType>
pdbonly
</DebugType>
<Optimize>
true
</Optimize>
<OutputPath>
bin\Release_Silverlight
2
\
</OutputPath>
<OutputPath>
bin\Release_Silverlight\
</OutputPath>
<DocumentationFile>
$(OutputPath)\$(AssemblyName).xml
</DocumentationFile>
<NoWarn>
1591, 1570, 1571, 1572, 1573, 1574
</NoWarn>
<DefineConstants>
TRACE;SILVERLIGHT
2
;LITE
</DefineConstants>
<DefineConstants>
TRACE;SILVERLIGHT;LITE
</DefineConstants>
<ErrorReport>
prompt
</ErrorReport>
<WarningLevel>
4
</WarningLevel>
<NoStdLib>
true
</NoStdLib>
...
...
@@ -70,7 +71,6 @@
<ItemGroup>
<Reference
Include=
"mscorlib"
/>
<Reference
Include=
"System"
/>
<Reference
Include=
"System.Data"
/>
<Reference
Include=
"System.Xml"
/>
</ItemGroup>
<ItemGroup>
...
...
@@ -115,8 +115,10 @@
<Compile
Include=
"UninitializedMessageException.cs"
/>
<Compile
Include=
"WireFormat.cs"
/>
</ItemGroup>
<Import
Project=
"$(MSBuildToolsPath)\Microsoft.CSharp.targets"
Condition=
" '$(Configuration)' != 'Silverlight2' "
/>
<Import
Project=
"$(MSBuildExtensionsPath)\Microsoft\Silverlight\v2.0\Microsoft.Silverlight.CSharp.targets"
Condition=
" '$(Configuration)' == 'Silverlight2' "
/>
<Import
Project=
"$(MSBuildToolsPath)\Microsoft.CSharp.targets"
Condition=
" '$(Configuration)' == 'Debug' "
/>
<Import
Project=
"$(MSBuildToolsPath)\Microsoft.CSharp.targets"
Condition=
" '$(Configuration)' == 'Release' "
/>
<Import
Project=
"$(MSBuildExtensionsPath)\Microsoft\Silverlight\$(SilverlightVersion)\Microsoft.Silverlight.CSharp.targets"
Condition=
" '$(Configuration)' == 'Debug_Silverlight' "
/>
<Import
Project=
"$(MSBuildExtensionsPath)\Microsoft\Silverlight\$(SilverlightVersion)\Microsoft.Silverlight.CSharp.targets"
Condition=
" '$(Configuration)' == 'Release_Silverlight' "
/>
<!-- To modify your build process, add your task inside one of the targets below and uncomment it.
Other similar extension points exist, see Microsoft.Common.targets.
<Target Name="BeforeBuild">
...
...
src/ProtocolBuffers/SilverlightCompatibility.cs
View file @
926f4dd3
...
...
@@ -43,7 +43,7 @@ namespace Google.ProtocolBuffers
/// </summary>
internal
static
class
SilverlightCompatibility
{
#if SILVERLIGHT
2
#if SILVERLIGHT
internal
const
RegexOptions
CompiledRegexWhereAvailable
=
RegexOptions
.
None
;
#else
internal
const
RegexOptions
CompiledRegexWhereAvailable
=
RegexOptions
.
Compiled
;
...
...
src/ProtocolBuffers/SortedList.cs
View file @
926f4dd3
...
...
@@ -34,7 +34,7 @@
#endregion
#if SILVERLIGHT
2
#if SILVERLIGHT
using
System.Collections
;
using
System.Collections.Generic
;
...
...
src/ProtocolBuffers2008.sln
View file @
926f4dd3
Microsoft Visual Studio Solution File, Format Version 10.00
# Visual Studio 2008
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "proto", "proto", "{1F896D5C-5FC2-4671-9216-781CB8187EC7}"
ProjectSection(SolutionItems) = preProject
..\protos\tutorial\addressbook.proto = ..\protos\tutorial\addressbook.proto
...
...
@@ -20,8 +19,8 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "unittest", "unittest", "{C8
..\protos\google\protobuf\unittest_enormous_descriptor.proto = ..\protos\google\protobuf\unittest_enormous_descriptor.proto
..\protos\extest\unittest_extras.proto = ..\protos\extest\unittest_extras.proto
..\protos\extest\unittest_extras_full.proto = ..\protos\extest\unittest_extras_full.proto
..\protos\extest\unittest_extras_xmltest.proto = ..\protos\extest\unittest_extras_xmltest.proto
..\protos\extest\unittest_extras_lite.proto = ..\protos\extest\unittest_extras_lite.proto
..\protos\extest\unittest_extras_xmltest.proto = ..\protos\extest\unittest_extras_xmltest.proto
..\protos\extest\unittest_generic_services.proto = ..\protos\extest\unittest_generic_services.proto
..\protos\google\protobuf\unittest_import.proto = ..\protos\google\protobuf\unittest_import.proto
..\protos\google\protobuf\unittest_import_lite.proto = ..\protos\google\protobuf\unittest_import_lite.proto
...
...
@@ -59,14 +58,13 @@ Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "ProtocolBuffersLiteMixed.Te
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "build", "build", "{66ED1950-AD27-42D7-88F8-94355AEC8225}"
ProjectSection(SolutionItems) = preProject
..\build\Build.bat = ..\build\Build.bat
..\build\build.csproj = ..\build\build.csproj
..\build\Build20.bat = ..\build\Build20.bat
..\build\build35.bat = ..\build\build35.bat
..\build\build40.bat = ..\build\build40.bat
..\build\BuildAll.bat = ..\build\BuildAll.bat
..\build\BuildSilverlight2.bat = ..\build\BuildSilverlight2.bat
..\build\Common.targets = ..\build\Common.targets
..\build\GenerateCompletePackage.bat = ..\build\GenerateCompletePackage.bat
..\build\GenerateReleasePackage.bat = ..\build\GenerateReleasePackage.bat
..\build\Google.ProtocolBuffers.nuspec = ..\build\Google.ProtocolBuffers.nuspec
..\build\Google.ProtocolBuffersLite.nuspec = ..\build\Google.ProtocolBuffersLite.nuspec
..\build\PublishRelease.bat = ..\build\PublishRelease.bat
...
...
@@ -79,96 +77,96 @@ Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "ProtocolBuffersLite.Seriali
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug_Silverlight
2|Any CPU = Debug_Silverlight2
|Any CPU
Debug_Silverlight
|Any CPU = Debug_Silverlight
|Any CPU
Debug|Any CPU = Debug|Any CPU
Release_Silverlight
2|Any CPU = Release_Silverlight2
|Any CPU
Release_Silverlight
|Any CPU = Release_Silverlight
|Any CPU
Release|Any CPU = Release|Any CPU
EndGlobalSection
GlobalSection(ProjectConfigurationPlatforms) = postSolution
{6908BDCE-D925-43F3-94AC-A531E6DF2591}.Debug_Silverlight
2|Any CPU.ActiveCfg = Debug_Silverlight2
|Any CPU
{6908BDCE-D925-43F3-94AC-A531E6DF2591}.Debug_Silverlight
2|Any CPU.Build.0 = Debug_Silverlight2
|Any CPU
{6908BDCE-D925-43F3-94AC-A531E6DF2591}.Debug_Silverlight
|Any CPU.ActiveCfg = Debug_Silverlight
|Any CPU
{6908BDCE-D925-43F3-94AC-A531E6DF2591}.Debug_Silverlight
|Any CPU.Build.0 = Debug_Silverlight
|Any CPU
{6908BDCE-D925-43F3-94AC-A531E6DF2591}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{6908BDCE-D925-43F3-94AC-A531E6DF2591}.Debug|Any CPU.Build.0 = Debug|Any CPU
{6908BDCE-D925-43F3-94AC-A531E6DF2591}.Release_Silverlight
2|Any CPU.ActiveCfg = Release_Silverlight2
|Any CPU
{6908BDCE-D925-43F3-94AC-A531E6DF2591}.Release_Silverlight
2|Any CPU.Build.0 = Release_Silverlight2
|Any CPU
{6908BDCE-D925-43F3-94AC-A531E6DF2591}.Release_Silverlight
|Any CPU.ActiveCfg = Release_Silverlight
|Any CPU
{6908BDCE-D925-43F3-94AC-A531E6DF2591}.Release_Silverlight
|Any CPU.Build.0 = Release_Silverlight
|Any CPU
{6908BDCE-D925-43F3-94AC-A531E6DF2591}.Release|Any CPU.ActiveCfg = Release|Any CPU
{6908BDCE-D925-43F3-94AC-A531E6DF2591}.Release|Any CPU.Build.0 = Release|Any CPU
{DD01ED24-3750-4567-9A23-1DB676A15610}.Debug_Silverlight
2
|Any CPU.ActiveCfg = Debug|Any CPU
{DD01ED24-3750-4567-9A23-1DB676A15610}.Debug_Silverlight|Any CPU.ActiveCfg = Debug|Any CPU
{DD01ED24-3750-4567-9A23-1DB676A15610}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{DD01ED24-3750-4567-9A23-1DB676A15610}.Debug|Any CPU.Build.0 = Debug|Any CPU
{DD01ED24-3750-4567-9A23-1DB676A15610}.Release_Silverlight
2
|Any CPU.ActiveCfg = Release|Any CPU
{DD01ED24-3750-4567-9A23-1DB676A15610}.Release_Silverlight|Any CPU.ActiveCfg = Release|Any CPU
{DD01ED24-3750-4567-9A23-1DB676A15610}.Release|Any CPU.ActiveCfg = Release|Any CPU
{DD01ED24-3750-4567-9A23-1DB676A15610}.Release|Any CPU.Build.0 = Release|Any CPU
{250ADE34-82FD-4BAE-86D5-985FBE589C4A}.Debug_Silverlight
2
|Any CPU.ActiveCfg = Debug|Any CPU
{250ADE34-82FD-4BAE-86D5-985FBE589C4A}.Debug_Silverlight|Any CPU.ActiveCfg = Debug|Any CPU
{250ADE34-82FD-4BAE-86D5-985FBE589C4A}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{250ADE34-82FD-4BAE-86D5-985FBE589C4A}.Debug|Any CPU.Build.0 = Debug|Any CPU
{250ADE34-82FD-4BAE-86D5-985FBE589C4A}.Release_Silverlight
2
|Any CPU.ActiveCfg = Release|Any CPU
{250ADE34-82FD-4BAE-86D5-985FBE589C4A}.Release_Silverlight|Any CPU.ActiveCfg = Release|Any CPU
{250ADE34-82FD-4BAE-86D5-985FBE589C4A}.Release|Any CPU.ActiveCfg = Release|Any CPU
{250ADE34-82FD-4BAE-86D5-985FBE589C4A}.Release|Any CPU.Build.0 = Release|Any CPU
{C268DA4C-4004-47DA-AF23-44C983281A68}.Debug_Silverlight
2
|Any CPU.ActiveCfg = Debug|Any CPU
{C268DA4C-4004-47DA-AF23-44C983281A68}.Debug_Silverlight|Any CPU.ActiveCfg = Debug|Any CPU
{C268DA4C-4004-47DA-AF23-44C983281A68}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{C268DA4C-4004-47DA-AF23-44C983281A68}.Debug|Any CPU.Build.0 = Debug|Any CPU
{C268DA4C-4004-47DA-AF23-44C983281A68}.Release_Silverlight
2
|Any CPU.ActiveCfg = Release|Any CPU
{C268DA4C-4004-47DA-AF23-44C983281A68}.Release_Silverlight|Any CPU.ActiveCfg = Release|Any CPU
{C268DA4C-4004-47DA-AF23-44C983281A68}.Release|Any CPU.ActiveCfg = Release|Any CPU
{C268DA4C-4004-47DA-AF23-44C983281A68}.Release|Any CPU.Build.0 = Release|Any CPU
{A31F5FB2-4FF3-432A-B35B-5CD203606311}.Debug_Silverlight
2
|Any CPU.ActiveCfg = Debug|Any CPU
{A31F5FB2-4FF3-432A-B35B-5CD203606311}.Debug_Silverlight|Any CPU.ActiveCfg = Debug|Any CPU
{A31F5FB2-4FF3-432A-B35B-5CD203606311}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{A31F5FB2-4FF3-432A-B35B-5CD203606311}.Debug|Any CPU.Build.0 = Debug|Any CPU
{A31F5FB2-4FF3-432A-B35B-5CD203606311}.Release_Silverlight
2
|Any CPU.ActiveCfg = Release|Any CPU
{A31F5FB2-4FF3-432A-B35B-5CD203606311}.Release_Silverlight|Any CPU.ActiveCfg = Release|Any CPU
{A31F5FB2-4FF3-432A-B35B-5CD203606311}.Release|Any CPU.ActiveCfg = Release|Any CPU
{A31F5FB2-4FF3-432A-B35B-5CD203606311}.Release|Any CPU.Build.0 = Release|Any CPU
{8F09AF72-3327-4FA7-BC09-070B80221AB9}.Debug_Silverlight
2
|Any CPU.ActiveCfg = Debug|Any CPU
{8F09AF72-3327-4FA7-BC09-070B80221AB9}.Debug_Silverlight|Any CPU.ActiveCfg = Debug|Any CPU
{8F09AF72-3327-4FA7-BC09-070B80221AB9}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{8F09AF72-3327-4FA7-BC09-070B80221AB9}.Debug|Any CPU.Build.0 = Debug|Any CPU
{8F09AF72-3327-4FA7-BC09-070B80221AB9}.Release_Silverlight
2
|Any CPU.ActiveCfg = Release|Any CPU
{8F09AF72-3327-4FA7-BC09-070B80221AB9}.Release_Silverlight|Any CPU.ActiveCfg = Release|Any CPU
{8F09AF72-3327-4FA7-BC09-070B80221AB9}.Release|Any CPU.ActiveCfg = Release|Any CPU
{8F09AF72-3327-4FA7-BC09-070B80221AB9}.Release|Any CPU.Build.0 = Release|Any CPU
{C7A4A435-2813-41C8-AA87-BD914BA5223D}.Debug_Silverlight
2
|Any CPU.ActiveCfg = Debug|Any CPU
{C7A4A435-2813-41C8-AA87-BD914BA5223D}.Debug_Silverlight|Any CPU.ActiveCfg = Debug|Any CPU
{C7A4A435-2813-41C8-AA87-BD914BA5223D}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{C7A4A435-2813-41C8-AA87-BD914BA5223D}.Debug|Any CPU.Build.0 = Debug|Any CPU
{C7A4A435-2813-41C8-AA87-BD914BA5223D}.Release_Silverlight
2
|Any CPU.ActiveCfg = Release|Any CPU
{C7A4A435-2813-41C8-AA87-BD914BA5223D}.Release_Silverlight|Any CPU.ActiveCfg = Release|Any CPU
{C7A4A435-2813-41C8-AA87-BD914BA5223D}.Release|Any CPU.ActiveCfg = Release|Any CPU
{C7A4A435-2813-41C8-AA87-BD914BA5223D}.Release|Any CPU.Build.0 = Release|Any CPU
{D7282E99-2DC3-405B-946F-177DB2FD2AE2}.Debug_Silverlight
2
|Any CPU.ActiveCfg = Debug|Any CPU
{D7282E99-2DC3-405B-946F-177DB2FD2AE2}.Debug_Silverlight|Any CPU.ActiveCfg = Debug|Any CPU
{D7282E99-2DC3-405B-946F-177DB2FD2AE2}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{D7282E99-2DC3-405B-946F-177DB2FD2AE2}.Debug|Any CPU.Build.0 = Debug|Any CPU
{D7282E99-2DC3-405B-946F-177DB2FD2AE2}.Release_Silverlight
2
|Any CPU.ActiveCfg = Release|Any CPU
{D7282E99-2DC3-405B-946F-177DB2FD2AE2}.Release_Silverlight|Any CPU.ActiveCfg = Release|Any CPU
{D7282E99-2DC3-405B-946F-177DB2FD2AE2}.Release|Any CPU.ActiveCfg = Release|Any CPU
{D7282E99-2DC3-405B-946F-177DB2FD2AE2}.Release|Any CPU.Build.0 = Release|Any CPU
{6969BDCE-D925-43F3-94AC-A531E6DF2591}.Debug_Silverlight
2|Any CPU.ActiveCfg = Debug_Silverlight2
|Any CPU
{6969BDCE-D925-43F3-94AC-A531E6DF2591}.Debug_Silverlight
2|Any CPU.Build.0 = Debug_Silverlight2
|Any CPU
{6969BDCE-D925-43F3-94AC-A531E6DF2591}.Debug_Silverlight
|Any CPU.ActiveCfg = Debug_Silverlight
|Any CPU
{6969BDCE-D925-43F3-94AC-A531E6DF2591}.Debug_Silverlight
|Any CPU.Build.0 = Debug_Silverlight
|Any CPU
{6969BDCE-D925-43F3-94AC-A531E6DF2591}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{6969BDCE-D925-43F3-94AC-A531E6DF2591}.Debug|Any CPU.Build.0 = Debug|Any CPU
{6969BDCE-D925-43F3-94AC-A531E6DF2591}.Release_Silverlight
2|Any CPU.ActiveCfg = Release_Silverlight2
|Any CPU
{6969BDCE-D925-43F3-94AC-A531E6DF2591}.Release_Silverlight
2|Any CPU.Build.0 = Release_Silverlight2
|Any CPU
{6969BDCE-D925-43F3-94AC-A531E6DF2591}.Release_Silverlight
|Any CPU.ActiveCfg = Release_Silverlight
|Any CPU
{6969BDCE-D925-43F3-94AC-A531E6DF2591}.Release_Silverlight
|Any CPU.Build.0 = Release_Silverlight
|Any CPU
{6969BDCE-D925-43F3-94AC-A531E6DF2591}.Release|Any CPU.ActiveCfg = Release|Any CPU
{6969BDCE-D925-43F3-94AC-A531E6DF2591}.Release|Any CPU.Build.0 = Release|Any CPU
{EE01ED24-3750-4567-9A23-1DB676A15610}.Debug_Silverlight
2
|Any CPU.ActiveCfg = Debug|Any CPU
{EE01ED24-3750-4567-9A23-1DB676A15610}.Debug_Silverlight|Any CPU.ActiveCfg = Debug|Any CPU
{EE01ED24-3750-4567-9A23-1DB676A15610}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{EE01ED24-3750-4567-9A23-1DB676A15610}.Debug|Any CPU.Build.0 = Debug|Any CPU
{EE01ED24-3750-4567-9A23-1DB676A15610}.Release_Silverlight
2
|Any CPU.ActiveCfg = Release|Any CPU
{EE01ED24-3750-4567-9A23-1DB676A15610}.Release_Silverlight|Any CPU.ActiveCfg = Release|Any CPU
{EE01ED24-3750-4567-9A23-1DB676A15610}.Release|Any CPU.ActiveCfg = Release|Any CPU
{EE01ED24-3750-4567-9A23-1DB676A15610}.Release|Any CPU.Build.0 = Release|Any CPU
{EEFFED24-3750-4567-9A23-1DB676A15610}.Debug_Silverlight
2
|Any CPU.ActiveCfg = Debug|Any CPU
{EEFFED24-3750-4567-9A23-1DB676A15610}.Debug_Silverlight|Any CPU.ActiveCfg = Debug|Any CPU
{EEFFED24-3750-4567-9A23-1DB676A15610}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{EEFFED24-3750-4567-9A23-1DB676A15610}.Debug|Any CPU.Build.0 = Debug|Any CPU
{EEFFED24-3750-4567-9A23-1DB676A15610}.Release_Silverlight
2
|Any CPU.ActiveCfg = Release|Any CPU
{EEFFED24-3750-4567-9A23-1DB676A15610}.Release_Silverlight|Any CPU.ActiveCfg = Release|Any CPU
{EEFFED24-3750-4567-9A23-1DB676A15610}.Release|Any CPU.ActiveCfg = Release|Any CPU
{EEFFED24-3750-4567-9A23-1DB676A15610}.Release|Any CPU.Build.0 = Release|Any CPU
{231391AF-449C-4A39-986C-AD7F270F4750}.Debug_Silverlight
2|Any CPU.ActiveCfg = Debug_Silverlight2
|Any CPU
{231391AF-449C-4A39-986C-AD7F270F4750}.Debug_Silverlight
2|Any CPU.Build.0 = Debug_Silverlight2
|Any CPU
{231391AF-449C-4A39-986C-AD7F270F4750}.Debug_Silverlight
|Any CPU.ActiveCfg = Debug_Silverlight
|Any CPU
{231391AF-449C-4A39-986C-AD7F270F4750}.Debug_Silverlight
|Any CPU.Build.0 = Debug_Silverlight
|Any CPU
{231391AF-449C-4A39-986C-AD7F270F4750}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{231391AF-449C-4A39-986C-AD7F270F4750}.Debug|Any CPU.Build.0 = Debug|Any CPU
{231391AF-449C-4A39-986C-AD7F270F4750}.Release_Silverlight
2|Any CPU.ActiveCfg = Release_Silverlight2
|Any CPU
{231391AF-449C-4A39-986C-AD7F270F4750}.Release_Silverlight
2|Any CPU.Build.0 = Release_Silverlight2
|Any CPU
{231391AF-449C-4A39-986C-AD7F270F4750}.Release_Silverlight
|Any CPU.ActiveCfg = Release_Silverlight
|Any CPU
{231391AF-449C-4A39-986C-AD7F270F4750}.Release_Silverlight
|Any CPU.Build.0 = Release_Silverlight
|Any CPU
{231391AF-449C-4A39-986C-AD7F270F4750}.Release|Any CPU.ActiveCfg = Release|Any CPU
{231391AF-449C-4A39-986C-AD7F270F4750}.Release|Any CPU.Build.0 = Release|Any CPU
{E067A59D-9D0A-4A1F-92B1-38E4457241D1}.Debug_Silverlight
2|Any CPU.ActiveCfg = Debug_Silverlight2
|Any CPU
{E067A59D-9D0A-4A1F-92B1-38E4457241D1}.Debug_Silverlight
2|Any CPU.Build.0 = Debug_Silverlight2
|Any CPU
{E067A59D-9D0A-4A1F-92B1-38E4457241D1}.Debug_Silverlight
|Any CPU.ActiveCfg = Debug_Silverlight
|Any CPU
{E067A59D-9D0A-4A1F-92B1-38E4457241D1}.Debug_Silverlight
|Any CPU.Build.0 = Debug_Silverlight
|Any CPU
{E067A59D-9D0A-4A1F-92B1-38E4457241D1}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{E067A59D-9D0A-4A1F-92B1-38E4457241D1}.Debug|Any CPU.Build.0 = Debug|Any CPU
{E067A59D-9D0A-4A1F-92B1-38E4457241D1}.Release_Silverlight
2|Any CPU.ActiveCfg = Release_Silverlight2
|Any CPU
{E067A59D-9D0A-4A1F-92B1-38E4457241D1}.Release_Silverlight
2|Any CPU.Build.0 = Release_Silverlight2
|Any CPU
{E067A59D-9D0A-4A1F-92B1-38E4457241D1}.Release_Silverlight
|Any CPU.ActiveCfg = Release_Silverlight
|Any CPU
{E067A59D-9D0A-4A1F-92B1-38E4457241D1}.Release_Silverlight
|Any CPU.Build.0 = Release_Silverlight
|Any CPU
{E067A59D-9D0A-4A1F-92B1-38E4457241D1}.Release|Any CPU.ActiveCfg = Release|Any CPU
{E067A59D-9D0A-4A1F-92B1-38E4457241D1}.Release|Any CPU.Build.0 = Release|Any CPU
EndGlobalSection
...
...
src/ProtocolBuffersLite.Test/ProtocolBuffersLite.Test.csproj
View file @
926f4dd3
...
...
@@ -56,6 +56,12 @@
<Compile
Include=
"..\ProtocolBuffers.Test\Properties\AssemblyInfo.cs"
>
<Link>
Properties\AssemblyInfo.cs
</Link>
</Compile>
<Compile
Include=
"..\ProtocolBuffers.Test\TestRpcForMimeTypes.cs"
>
<Link>
TestRpcForMimeTypes.cs
</Link>
</Compile>
<Compile
Include=
"..\ProtocolBuffers.Test\TestRpcGenerator.cs"
>
<Link>
TestRpcGenerator.cs
</Link>
</Compile>
<Compile
Include=
"AbstractBuilderLiteTest.cs"
/>
<Compile
Include=
"AbstractMessageLiteTest.cs"
/>
<Compile
Include=
"ExtendableBuilderLiteTest.cs"
/>
...
...
@@ -67,8 +73,6 @@
<Compile
Include=
"TestProtos\UnitTestImportLiteProtoFile.cs"
/>
<Compile
Include=
"TestProtos\UnitTestLiteProtoFile.cs"
/>
<Compile
Include=
"TestProtos\UnitTestRpcInteropLite.cs"
/>
<Compile
Include=
"TestRpcForMimeTypes.cs"
/>
<Compile
Include=
"TestRpcGenerator.cs"
/>
</ItemGroup>
<ItemGroup>
<ProjectReference
Include=
"..\ProtocolBuffers.Serialization\ProtocolBuffersLite.Serialization.csproj"
>
...
...
src/ProtocolBuffersLite.Test/TestRpcForMimeTypes.cs
deleted
100644 → 0
View file @
3ede2921
#region Copyright notice and license
// Protocol Buffers - Google's data interchange format
// Copyright 2008 Google Inc. All rights reserved.
// http://github.com/jskeet/dotnet-protobufs/
// Original C++/Java/Python code:
// http://code.google.com/p/protobuf/
//
// Redistribution and use in source and binary forms, with or without
// modification, are permitted provided that the following conditions are
// met:
//
// * Redistributions of source code must retain the above copyright
// notice, this list of conditions and the following disclaimer.
// * Redistributions in binary form must reproduce the above
// copyright notice, this list of conditions and the following disclaimer
// in the documentation and/or other materials provided with the
// distribution.
// * Neither the name of Google Inc. nor the names of its
// contributors may be used to endorse or promote products derived from
// this software without specific prior written permission.
//
// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#endregion
using
System
;
using
Google.ProtocolBuffers
;
using
Google.ProtocolBuffers.Serialization.Http
;
using
Google.ProtocolBuffers.TestProtos
;
using
NUnit.Framework
;
using
System.IO
;
using
Google.ProtocolBuffers.Serialization
;
using
System.Text
;
namespace
Google.ProtocolBuffers
{
/// <summary>
/// This class verifies the correct code is generated from unittest_rpc_interop.proto and provides a small demonstration
/// of using the new IRpcDispatch to write a client/server
/// </summary>
[
TestFixture
]
public
class
TestRpcForMimeTypes
{
/// <summary>
/// A sample implementation of the ISearchService for testing
/// </summary>
private
class
ExampleSearchImpl
:
ISearchService
{
SearchResponse
ISearchService
.
Search
(
SearchRequest
searchRequest
)
{
if
(
searchRequest
.
CriteriaCount
==
0
)
{
throw
new
ArgumentException
(
"No criteria specified."
,
new
InvalidOperationException
());
}
SearchResponse
.
Builder
resp
=
SearchResponse
.
CreateBuilder
();
foreach
(
string
criteria
in
searchRequest
.
CriteriaList
)
{
resp
.
AddResults
(
SearchResponse
.
Types
.
ResultItem
.
CreateBuilder
().
SetName
(
criteria
).
SetUrl
(
"http://search.com"
).
Build
());
}
return
resp
.
Build
();
}
SearchResponse
ISearchService
.
RefineSearch
(
RefineSearchRequest
refineSearchRequest
)
{
SearchResponse
.
Builder
resp
=
refineSearchRequest
.
PreviousResults
.
ToBuilder
();
foreach
(
string
criteria
in
refineSearchRequest
.
CriteriaList
)
{
resp
.
AddResults
(
SearchResponse
.
Types
.
ResultItem
.
CreateBuilder
().
SetName
(
criteria
).
SetUrl
(
"http://refine.com"
).
Build
());
}
return
resp
.
Build
();
}
}
/// <summary>
/// An example extraction of the wire protocol
/// </summary>
private
interface
IHttpTransfer
{
void
Execute
(
string
method
,
string
contentType
,
Stream
input
,
string
acceptType
,
Stream
output
);
}
/// <summary>
/// An example of a server responding to a web/http request
/// </summary>
private
class
ExampleHttpServer
:
IHttpTransfer
{
public
readonly
MessageFormatOptions
Options
=
new
MessageFormatOptions
{
ExtensionRegistry
=
ExtensionRegistry
.
Empty
,
FormattedOutput
=
true
,
XmlReaderOptions
=
XmlReaderOptions
.
ReadNestedArrays
,
XmlReaderRootElementName
=
"request"
,
XmlWriterOptions
=
XmlWriterOptions
.
OutputNestedArrays
,
XmlWriterRootElementName
=
"response"
};
private
readonly
IRpcServerStub
_stub
;
public
ExampleHttpServer
(
ISearchService
implementation
)
{
//on the server, we create a dispatch to call the appropriate method by name
IRpcDispatch
dispatch
=
new
SearchService
.
Dispatch
(
implementation
);
//we then wrap that dispatch in a server stub which will deserialize the wire bytes to the message
//type appropriate for the method name being invoked.
_stub
=
new
SearchService
.
ServerStub
(
dispatch
);
}
void
IHttpTransfer
.
Execute
(
string
method
,
string
contentType
,
Stream
input
,
string
acceptType
,
Stream
output
)
{
//Extension for: Google.ProtocolBuffers.Serialization.Http.ServiceExtensions.HttpCallMethod(_stub,
_stub
.
HttpCallMethod
(
method
,
Options
,
contentType
,
input
,
acceptType
,
output
);
}
}
/// <summary>
/// An example of a client sending a wire request
/// </summary>
private
class
ExampleClient
:
IRpcDispatch
{
public
readonly
MessageFormatOptions
Options
=
new
MessageFormatOptions
{
ExtensionRegistry
=
ExtensionRegistry
.
Empty
,
FormattedOutput
=
true
,
XmlReaderOptions
=
XmlReaderOptions
.
ReadNestedArrays
,
XmlReaderRootElementName
=
"response"
,
XmlWriterOptions
=
XmlWriterOptions
.
OutputNestedArrays
,
XmlWriterRootElementName
=
"request"
};
private
readonly
IHttpTransfer
_wire
;
private
readonly
string
_mimeType
;
public
ExampleClient
(
IHttpTransfer
wire
,
string
mimeType
)
{
_wire
=
wire
;
_mimeType
=
mimeType
;
}
TMessage
IRpcDispatch
.
CallMethod
<
TMessage
,
TBuilder
>(
string
method
,
IMessageLite
request
,
IBuilderLite
<
TMessage
,
TBuilder
>
response
)
{
MemoryStream
input
=
new
MemoryStream
();
MemoryStream
output
=
new
MemoryStream
();
//Write to _mimeType format
request
.
WriteTo
(
Options
,
_mimeType
,
input
);
input
.
Position
=
0
;
_wire
.
Execute
(
method
,
_mimeType
,
input
,
_mimeType
,
output
);
//Read from _mimeType format
output
.
Position
=
0
;
response
.
MergeFrom
(
Options
,
_mimeType
,
output
);
return
response
.
Build
();
}
}
/// <summary>
/// Test sending and recieving messages via text/json
/// </summary>
[
Test
]
public
void
TestClientServerWithJsonFormat
()
{
ExampleHttpServer
server
=
new
ExampleHttpServer
(
new
ExampleSearchImpl
());
//obviously if this was a 'real' transport we would not use the server, rather the server would be listening, the client transmitting
IHttpTransfer
wire
=
server
;
ISearchService
client
=
new
SearchService
(
new
ExampleClient
(
wire
,
"text/json"
));
//now the client has a real, typed, interface to work with:
SearchResponse
result
=
client
.
Search
(
SearchRequest
.
CreateBuilder
().
AddCriteria
(
"Test"
).
Build
());
Assert
.
AreEqual
(
1
,
result
.
ResultsCount
);
Assert
.
AreEqual
(
"Test"
,
result
.
ResultsList
[
0
].
Name
);
Assert
.
AreEqual
(
"http://search.com"
,
result
.
ResultsList
[
0
].
Url
);
//The test part of this, call the only other method
result
=
client
.
RefineSearch
(
RefineSearchRequest
.
CreateBuilder
().
SetPreviousResults
(
result
).
AddCriteria
(
"Refine"
).
Build
());
Assert
.
AreEqual
(
2
,
result
.
ResultsCount
);
Assert
.
AreEqual
(
"Test"
,
result
.
ResultsList
[
0
].
Name
);
Assert
.
AreEqual
(
"http://search.com"
,
result
.
ResultsList
[
0
].
Url
);
Assert
.
AreEqual
(
"Refine"
,
result
.
ResultsList
[
1
].
Name
);
Assert
.
AreEqual
(
"http://refine.com"
,
result
.
ResultsList
[
1
].
Url
);
}
/// <summary>
/// Test sending and recieving messages via text/json
/// </summary>
[
Test
]
public
void
TestClientServerWithXmlFormat
()
{
ExampleHttpServer
server
=
new
ExampleHttpServer
(
new
ExampleSearchImpl
());
//obviously if this was a 'real' transport we would not use the server, rather the server would be listening, the client transmitting
IHttpTransfer
wire
=
server
;
ISearchService
client
=
new
SearchService
(
new
ExampleClient
(
wire
,
"text/xml"
));
//now the client has a real, typed, interface to work with:
SearchResponse
result
=
client
.
Search
(
SearchRequest
.
CreateBuilder
().
AddCriteria
(
"Test"
).
Build
());
Assert
.
AreEqual
(
1
,
result
.
ResultsCount
);
Assert
.
AreEqual
(
"Test"
,
result
.
ResultsList
[
0
].
Name
);
Assert
.
AreEqual
(
"http://search.com"
,
result
.
ResultsList
[
0
].
Url
);
//The test part of this, call the only other method
result
=
client
.
RefineSearch
(
RefineSearchRequest
.
CreateBuilder
().
SetPreviousResults
(
result
).
AddCriteria
(
"Refine"
).
Build
());
Assert
.
AreEqual
(
2
,
result
.
ResultsCount
);
Assert
.
AreEqual
(
"Test"
,
result
.
ResultsList
[
0
].
Name
);
Assert
.
AreEqual
(
"http://search.com"
,
result
.
ResultsList
[
0
].
Url
);
Assert
.
AreEqual
(
"Refine"
,
result
.
ResultsList
[
1
].
Name
);
Assert
.
AreEqual
(
"http://refine.com"
,
result
.
ResultsList
[
1
].
Url
);
}
/// <summary>
/// Test sending and recieving messages via text/json
/// </summary>
[
Test
]
public
void
TestClientServerWithProtoFormat
()
{
ExampleHttpServer
server
=
new
ExampleHttpServer
(
new
ExampleSearchImpl
());
//obviously if this was a 'real' transport we would not use the server, rather the server would be listening, the client transmitting
IHttpTransfer
wire
=
server
;
ISearchService
client
=
new
SearchService
(
new
ExampleClient
(
wire
,
"application/x-protobuf"
));
//now the client has a real, typed, interface to work with:
SearchResponse
result
=
client
.
Search
(
SearchRequest
.
CreateBuilder
().
AddCriteria
(
"Test"
).
Build
());
Assert
.
AreEqual
(
1
,
result
.
ResultsCount
);
Assert
.
AreEqual
(
"Test"
,
result
.
ResultsList
[
0
].
Name
);
Assert
.
AreEqual
(
"http://search.com"
,
result
.
ResultsList
[
0
].
Url
);
//The test part of this, call the only other method
result
=
client
.
RefineSearch
(
RefineSearchRequest
.
CreateBuilder
().
SetPreviousResults
(
result
).
AddCriteria
(
"Refine"
).
Build
());
Assert
.
AreEqual
(
2
,
result
.
ResultsCount
);
Assert
.
AreEqual
(
"Test"
,
result
.
ResultsList
[
0
].
Name
);
Assert
.
AreEqual
(
"http://search.com"
,
result
.
ResultsList
[
0
].
Url
);
Assert
.
AreEqual
(
"Refine"
,
result
.
ResultsList
[
1
].
Name
);
Assert
.
AreEqual
(
"http://refine.com"
,
result
.
ResultsList
[
1
].
Url
);
}
/// <summary>
/// Test sending and recieving messages via text/json
/// </summary>
[
Test
]
public
void
TestClientServerWithCustomFormat
()
{
ExampleHttpServer
server
=
new
ExampleHttpServer
(
new
ExampleSearchImpl
());
//Setup our custom mime-type format as the only format supported:
server
.
Options
.
MimeInputTypes
.
Clear
();
server
.
Options
.
MimeInputTypes
.
Add
(
"foo/bar"
,
CodedInputStream
.
CreateInstance
);
server
.
Options
.
MimeOutputTypes
.
Clear
();
server
.
Options
.
MimeOutputTypes
.
Add
(
"foo/bar"
,
CodedOutputStream
.
CreateInstance
);
//obviously if this was a 'real' transport we would not use the server, rather the server would be listening, the client transmitting
IHttpTransfer
wire
=
server
;
ExampleClient
exclient
=
new
ExampleClient
(
wire
,
"foo/bar"
);
//Add our custom mime-type format
exclient
.
Options
.
MimeInputTypes
.
Add
(
"foo/bar"
,
CodedInputStream
.
CreateInstance
);
exclient
.
Options
.
MimeOutputTypes
.
Add
(
"foo/bar"
,
CodedOutputStream
.
CreateInstance
);
ISearchService
client
=
new
SearchService
(
exclient
);
//now the client has a real, typed, interface to work with:
SearchResponse
result
=
client
.
Search
(
SearchRequest
.
CreateBuilder
().
AddCriteria
(
"Test"
).
Build
());
Assert
.
AreEqual
(
1
,
result
.
ResultsCount
);
Assert
.
AreEqual
(
"Test"
,
result
.
ResultsList
[
0
].
Name
);
Assert
.
AreEqual
(
"http://search.com"
,
result
.
ResultsList
[
0
].
Url
);
//The test part of this, call the only other method
result
=
client
.
RefineSearch
(
RefineSearchRequest
.
CreateBuilder
().
SetPreviousResults
(
result
).
AddCriteria
(
"Refine"
).
Build
());
Assert
.
AreEqual
(
2
,
result
.
ResultsCount
);
Assert
.
AreEqual
(
"Test"
,
result
.
ResultsList
[
0
].
Name
);
Assert
.
AreEqual
(
"http://search.com"
,
result
.
ResultsList
[
0
].
Url
);
Assert
.
AreEqual
(
"Refine"
,
result
.
ResultsList
[
1
].
Name
);
Assert
.
AreEqual
(
"http://refine.com"
,
result
.
ResultsList
[
1
].
Url
);
}
/// <summary>
/// Test sending and recieving messages via text/json
/// </summary>
[
Test
]
public
void
TestServerWithUriFormat
()
{
ExampleHttpServer
server
=
new
ExampleHttpServer
(
new
ExampleSearchImpl
());
//obviously if this was a 'real' transport we would not use the server, rather the server would be listening, the client transmitting
IHttpTransfer
wire
=
server
;
MemoryStream
input
=
new
MemoryStream
(
Encoding
.
UTF8
.
GetBytes
(
"?Criteria=Test&Criteria=Test+of%20URI"
));
MemoryStream
output
=
new
MemoryStream
();
//Call the server
wire
.
Execute
(
"Search"
,
MessageFormatOptions
.
ContentFormUrlEncoded
,
input
,
MessageFormatOptions
.
ContentTypeProtoBuffer
,
output
);
SearchResponse
result
=
SearchResponse
.
ParseFrom
(
output
.
ToArray
());
Assert
.
AreEqual
(
2
,
result
.
ResultsCount
);
Assert
.
AreEqual
(
"Test"
,
result
.
ResultsList
[
0
].
Name
);
Assert
.
AreEqual
(
"http://search.com"
,
result
.
ResultsList
[
0
].
Url
);
Assert
.
AreEqual
(
"Test of URI"
,
result
.
ResultsList
[
1
].
Name
);
Assert
.
AreEqual
(
"http://search.com"
,
result
.
ResultsList
[
1
].
Url
);
}
/// <summary>
/// Test sending and recieving messages via text/json
/// </summary>
[
Test
,
ExpectedException
(
typeof
(
ArgumentOutOfRangeException
))]
public
void
TestInvalidMimeType
()
{
ExampleHttpServer
server
=
new
ExampleHttpServer
(
new
ExampleSearchImpl
());
//obviously if this was a 'real' transport we would not use the server, rather the server would be listening, the client transmitting
IHttpTransfer
wire
=
server
;
MemoryStream
input
=
new
MemoryStream
();
MemoryStream
output
=
new
MemoryStream
();
//Call the server
wire
.
Execute
(
"Search"
,
"bad/mime"
,
input
,
MessageFormatOptions
.
ContentTypeProtoBuffer
,
output
);
Assert
.
Fail
();
}
/// <summary>
/// Test sending and recieving messages via text/json
/// </summary>
[
Test
]
public
void
TestDefaultMimeType
()
{
ExampleHttpServer
server
=
new
ExampleHttpServer
(
new
ExampleSearchImpl
());
//obviously if this was a 'real' transport we would not use the server, rather the server would be listening, the client transmitting
IHttpTransfer
wire
=
server
;
MemoryStream
input
=
new
MemoryStream
(
new
SearchRequest
.
Builder
().
AddCriteria
(
"Test"
).
Build
().
ToByteArray
());
MemoryStream
output
=
new
MemoryStream
();
//With this default set, any invalid/unknown mime-type will be mapped to use that format
server
.
Options
.
DefaultContentType
=
MessageFormatOptions
.
ContentTypeProtoBuffer
;
wire
.
Execute
(
"Search"
,
"foo"
,
input
,
"bar"
,
output
);
SearchResponse
result
=
SearchResponse
.
ParseFrom
(
output
.
ToArray
());
Assert
.
AreEqual
(
1
,
result
.
ResultsCount
);
Assert
.
AreEqual
(
"Test"
,
result
.
ResultsList
[
0
].
Name
);
Assert
.
AreEqual
(
"http://search.com"
,
result
.
ResultsList
[
0
].
Url
);
}
}
}
\ No newline at end of file
src/ProtocolBuffersLite.Test/TestRpcGenerator.cs
deleted
100644 → 0
View file @
3ede2921
#region Copyright notice and license
// Protocol Buffers - Google's data interchange format
// Copyright 2008 Google Inc. All rights reserved.
// http://github.com/jskeet/dotnet-protobufs/
// Original C++/Java/Python code:
// http://code.google.com/p/protobuf/
//
// Redistribution and use in source and binary forms, with or without
// modification, are permitted provided that the following conditions are
// met:
//
// * Redistributions of source code must retain the above copyright
// notice, this list of conditions and the following disclaimer.
// * Redistributions in binary form must reproduce the above
// copyright notice, this list of conditions and the following disclaimer
// in the documentation and/or other materials provided with the
// distribution.
// * Neither the name of Google Inc. nor the names of its
// contributors may be used to endorse or promote products derived from
// this software without specific prior written permission.
//
// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#endregion
using
System
;
using
Google.ProtocolBuffers
;
using
Google.ProtocolBuffers.TestProtos
;
using
NUnit.Framework
;
namespace
Google.ProtocolBuffers
{
/// <summary>
/// This class verifies the correct code is generated from unittest_rpc_interop.proto and provides a small demonstration
/// of using the new IRpcDispatch to write a client/server
/// </summary>
[
TestFixture
]
public
class
TestRpcGenerator
{
/// <summary>
/// A sample implementation of the ISearchService for testing
/// </summary>
private
class
ExampleSearchImpl
:
ISearchService
{
SearchResponse
ISearchService
.
Search
(
SearchRequest
searchRequest
)
{
if
(
searchRequest
.
CriteriaCount
==
0
)
{
throw
new
ArgumentException
(
"No criteria specified."
,
new
InvalidOperationException
());
}
SearchResponse
.
Builder
resp
=
SearchResponse
.
CreateBuilder
();
foreach
(
string
criteria
in
searchRequest
.
CriteriaList
)
{
resp
.
AddResults
(
SearchResponse
.
Types
.
ResultItem
.
CreateBuilder
().
SetName
(
criteria
).
SetUrl
(
"http://search.com"
).
Build
());
}
return
resp
.
Build
();
}
SearchResponse
ISearchService
.
RefineSearch
(
RefineSearchRequest
refineSearchRequest
)
{
SearchResponse
.
Builder
resp
=
refineSearchRequest
.
PreviousResults
.
ToBuilder
();
foreach
(
string
criteria
in
refineSearchRequest
.
CriteriaList
)
{
resp
.
AddResults
(
SearchResponse
.
Types
.
ResultItem
.
CreateBuilder
().
SetName
(
criteria
).
SetUrl
(
"http://refine.com"
).
Build
());
}
return
resp
.
Build
();
}
}
/// <summary>
/// An example extraction of the wire protocol
/// </summary>
private
interface
IWireTransfer
{
byte
[]
Execute
(
string
method
,
byte
[]
message
);
}
/// <summary>
/// An example of a server responding to a wire request
/// </summary>
private
class
ExampleServerHost
:
IWireTransfer
{
private
readonly
IRpcServerStub
_stub
;
public
ExampleServerHost
(
ISearchService
implementation
)
{
//on the server, we create a dispatch to call the appropriate method by name
IRpcDispatch
dispatch
=
new
SearchService
.
Dispatch
(
implementation
);
//we then wrap that dispatch in a server stub which will deserialize the wire bytes to the message
//type appropriate for the method name being invoked.
_stub
=
new
SearchService
.
ServerStub
(
dispatch
);
}
byte
[]
IWireTransfer
.
Execute
(
string
method
,
byte
[]
message
)
{
//now when we recieve a wire transmission to invoke a method by name with a byte[] or stream payload
//we just simply call the sub:
IMessageLite
response
=
_stub
.
CallMethod
(
method
,
CodedInputStream
.
CreateInstance
(
message
),
ExtensionRegistry
.
Empty
);
//now we return the expected response message:
return
response
.
ToByteArray
();
}
}
/// <summary>
/// An example of a client sending a wire request
/// </summary>
private
class
ExampleClient
:
IRpcDispatch
{
private
readonly
IWireTransfer
_wire
;
public
ExampleClient
(
IWireTransfer
wire
)
{
_wire
=
wire
;
}
TMessage
IRpcDispatch
.
CallMethod
<
TMessage
,
TBuilder
>(
string
method
,
IMessageLite
request
,
IBuilderLite
<
TMessage
,
TBuilder
>
response
)
{
byte
[]
rawResponse
=
_wire
.
Execute
(
method
,
request
.
ToByteArray
());
response
.
MergeFrom
(
rawResponse
);
return
response
.
Build
();
}
}
/// <summary>
/// Put it all together to create one seamless client/server experience full of rich-type goodness ;)
/// All you need to do is send/recieve the method name and message bytes across the wire.
/// </summary>
[
Test
]
public
void
TestClientServerDispatch
()
{
ExampleServerHost
server
=
new
ExampleServerHost
(
new
ExampleSearchImpl
());
//obviously if this was a 'real' transport we would not use the server, rather the server would be listening, the client transmitting
IWireTransfer
wire
=
server
;
ISearchService
client
=
new
SearchService
(
new
ExampleClient
(
wire
));
//now the client has a real, typed, interface to work with:
SearchResponse
result
=
client
.
Search
(
SearchRequest
.
CreateBuilder
().
AddCriteria
(
"Test"
).
Build
());
Assert
.
AreEqual
(
1
,
result
.
ResultsCount
);
Assert
.
AreEqual
(
"Test"
,
result
.
ResultsList
[
0
].
Name
);
Assert
.
AreEqual
(
"http://search.com"
,
result
.
ResultsList
[
0
].
Url
);
//The test part of this, call the only other method
result
=
client
.
RefineSearch
(
RefineSearchRequest
.
CreateBuilder
().
SetPreviousResults
(
result
).
AddCriteria
(
"Refine"
).
Build
());
Assert
.
AreEqual
(
2
,
result
.
ResultsCount
);
Assert
.
AreEqual
(
"Test"
,
result
.
ResultsList
[
0
].
Name
);
Assert
.
AreEqual
(
"http://search.com"
,
result
.
ResultsList
[
0
].
Url
);
Assert
.
AreEqual
(
"Refine"
,
result
.
ResultsList
[
1
].
Name
);
Assert
.
AreEqual
(
"http://refine.com"
,
result
.
ResultsList
[
1
].
Url
);
}
}
}
\ No newline at end of file
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment