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
e1f146bc
Commit
e1f146bc
authored
Jul 14, 2016
by
Jon Skeet
Committed by
GitHub
Jul 14, 2016
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #1785 from jskeet/merge-csharp
Merge C# changes from master to 3.0.0-beta4
parents
4e0d0513
b5ce5251
Hide whitespace changes
Inline
Side-by-side
Showing
46 changed files
with
544 additions
and
889 deletions
+544
-889
.travis.yml
.travis.yml
+7
-5
Makefile.am
Makefile.am
+10
-16
appveyor.bat
appveyor.bat
+6
-3
appveyor.yml
appveyor.yml
+6
-0
Makefile.am
conformance/Makefile.am
+1
-1
.gitignore
csharp/.gitignore
+8
-13
build_packages.bat
csharp/build_packages.bat
+2
-5
buildall.sh
csharp/buildall.sh
+7
-8
AddressBook.csproj
csharp/src/AddressBook/AddressBook.csproj
+0
-76
AddressBook.xproj
csharp/src/AddressBook/AddressBook.xproj
+20
-0
AssemblyInfo.cs
csharp/src/AddressBook/Properties/AssemblyInfo.cs
+0
-18
SampleUsage.cs
csharp/src/AddressBook/SampleUsage.cs
+1
-1
app.config
csharp/src/AddressBook/app.config
+0
-3
project.json
csharp/src/AddressBook/project.json
+20
-0
App.config
csharp/src/Google.Protobuf.Conformance/App.config
+0
-7
Google.Protobuf.Conformance.csproj
...e.Protobuf.Conformance/Google.Protobuf.Conformance.csproj
+0
-62
Google.Protobuf.Conformance.xproj
...le.Protobuf.Conformance/Google.Protobuf.Conformance.xproj
+20
-0
AssemblyInfo.cs
...rc/Google.Protobuf.Conformance/Properties/AssemblyInfo.cs
+0
-48
project.json
csharp/src/Google.Protobuf.Conformance/project.json
+19
-0
Google.Protobuf.JsonDump.csproj
.../Google.Protobuf.JsonDump/Google.Protobuf.JsonDump.csproj
+0
-69
Google.Protobuf.JsonDump.xproj
...c/Google.Protobuf.JsonDump/Google.Protobuf.JsonDump.xproj
+20
-0
Program.cs
csharp/src/Google.Protobuf.JsonDump/Program.cs
+2
-1
AssemblyInfo.cs
...p/src/Google.Protobuf.JsonDump/Properties/AssemblyInfo.cs
+0
-19
app.config
csharp/src/Google.Protobuf.JsonDump/app.config
+0
-3
project.json
csharp/src/Google.Protobuf.JsonDump/project.json
+19
-0
RepeatedFieldTest.cs
...src/Google.Protobuf.Test/Collections/RepeatedFieldTest.cs
+88
-2
FieldCodecTest.cs
csharp/src/Google.Protobuf.Test/FieldCodecTest.cs
+2
-1
Google.Protobuf.Test.csproj
csharp/src/Google.Protobuf.Test/Google.Protobuf.Test.csproj
+0
-144
Google.Protobuf.Test.xproj
csharp/src/Google.Protobuf.Test/Google.Protobuf.Test.xproj
+20
-0
AppManifest.xml
csharp/src/Google.Protobuf.Test/Properties/AppManifest.xml
+0
-6
AssemblyInfo.cs
csharp/src/Google.Protobuf.Test/Properties/AssemblyInfo.cs
+0
-20
AnyTest.cs
csharp/src/Google.Protobuf.Test/WellKnownTypes/AnyTest.cs
+1
-1
FieldMaskTest.cs
.../src/Google.Protobuf.Test/WellKnownTypes/FieldMaskTest.cs
+2
-2
packages.config
csharp/src/Google.Protobuf.Test/packages.config
+0
-6
project.json
csharp/src/Google.Protobuf.Test/project.json
+45
-0
Google.Protobuf.sln
csharp/src/Google.Protobuf.sln
+27
-38
MapField.cs
csharp/src/Google.Protobuf/Collections/MapField.cs
+15
-16
RepeatedField.cs
csharp/src/Google.Protobuf/Collections/RepeatedField.cs
+68
-45
Google.Protobuf.csproj
csharp/src/Google.Protobuf/Google.Protobuf.csproj
+0
-169
Google.Protobuf.nuspec
csharp/src/Google.Protobuf/Google.Protobuf.nuspec
+0
-54
Google.Protobuf.xproj
csharp/src/Google.Protobuf/Google.Protobuf.xproj
+20
-0
AssemblyInfo.cs
csharp/src/Google.Protobuf/Properties/AssemblyInfo.cs
+0
-18
packages.config
csharp/src/Google.Protobuf/packages.config
+0
-5
project.json
csharp/src/Google.Protobuf/project.json
+65
-0
Dockerfile
jenkins/docker/Dockerfile
+7
-0
tests.sh
tests.sh
+16
-4
No files found.
.travis.yml
View file @
e1f146bc
...
...
@@ -14,7 +14,6 @@ script:
env
:
-
CONFIG=cpp
-
CONFIG=cpp_distcheck
-
CONFIG=csharp
-
CONFIG=golang
-
CONFIG=java_jdk6
-
CONFIG=java_jdk7
...
...
@@ -52,10 +51,6 @@ matrix:
env
:
CONFIG=javanano_jdk7
-
os
:
osx
env
:
CONFIG=javanano_oracle7
# Requires installing mono, currently travis.sh is doing that with apt-get
# which doesn't work on OS X.
-
os
:
osx
env
:
CONFIG=csharp
# Requires installing golang, currently travis.sh is doing that with apt-get
# which doesn't work on OS X.
-
os
:
osx
...
...
@@ -70,6 +65,13 @@ matrix:
env
:
CONFIG=objectivec_osx
-
os
:
linux
env
:
CONFIG=objectivec_cocoapods_integration
# The dotnet environment requires Ubuntu 14.04 or 16.04. This
# configuration is effectively an "extra" one, outside the
# autogenerated matrix.
include
:
-
os
:
linux
env
:
CONFIG=csharp
dist
:
trusty
allow_failures
:
# These currently do not work on OS X but are being worked on by @haberman.
-
os
:
osx
...
...
Makefile.am
View file @
e1f146bc
...
...
@@ -59,22 +59,19 @@ csharp_EXTRA_DIST= \
csharp/keys/README.md
\
csharp/protos/unittest_issues.proto
\
csharp/src/AddressBook/AddPerson.cs
\
csharp/src/AddressBook/AddressBook.csproj
\
csharp/src/AddressBook/Addressbook.cs
\
csharp/src/AddressBook/AddressBook.xproj
\
csharp/src/AddressBook/ListPeople.cs
\
csharp/src/AddressBook/Program.cs
\
csharp/src/AddressBook/Properties/AssemblyInfo.cs
\
csharp/src/AddressBook/SampleUsage.cs
\
csharp/src/AddressBook/app.config
\
csharp/src/Google.Protobuf.Conformance/App.config
\
csharp/src/AddressBook/project.json
\
csharp/src/Google.Protobuf.Conformance/Conformance.cs
\
csharp/src/Google.Protobuf.Conformance/Google.Protobuf.Conformance.
csproj
\
csharp/src/Google.Protobuf.Conformance/Google.Protobuf.Conformance.
xproj
\
csharp/src/Google.Protobuf.Conformance/Program.cs
\
csharp/src/Google.Protobuf.Conformance/
Properties/AssemblyInfo.cs
\
csharp/src/Google.Protobuf.JsonDump/Google.Protobuf.JsonDump.
csproj
\
csharp/src/Google.Protobuf.Conformance/
project.json
\
csharp/src/Google.Protobuf.JsonDump/Google.Protobuf.JsonDump.
xproj
\
csharp/src/Google.Protobuf.JsonDump/Program.cs
\
csharp/src/Google.Protobuf.JsonDump/Properties/AssemblyInfo.cs
\
csharp/src/Google.Protobuf.JsonDump/app.config
\
csharp/src/Google.Protobuf.JsonDump/project.json
\
csharp/src/Google.Protobuf.Test/ByteStringTest.cs
\
csharp/src/Google.Protobuf.Test/CodedInputStreamExtensions.cs
\
csharp/src/Google.Protobuf.Test/CodedInputStreamTest.cs
\
...
...
@@ -87,13 +84,11 @@ csharp_EXTRA_DIST= \
csharp/src/Google.Protobuf.Test/EqualityTester.cs
\
csharp/src/Google.Protobuf.Test/FieldCodecTest.cs
\
csharp/src/Google.Protobuf.Test/GeneratedMessageTest.cs
\
csharp/src/Google.Protobuf.Test/Google.Protobuf.Test.
csproj
\
csharp/src/Google.Protobuf.Test/Google.Protobuf.Test.
xproj
\
csharp/src/Google.Protobuf.Test/IssuesTest.cs
\
csharp/src/Google.Protobuf.Test/JsonFormatterTest.cs
\
csharp/src/Google.Protobuf.Test/JsonParserTest.cs
\
csharp/src/Google.Protobuf.Test/JsonTokenizerTest.cs
\
csharp/src/Google.Protobuf.Test/Properties/AppManifest.xml
\
csharp/src/Google.Protobuf.Test/Properties/AssemblyInfo.cs
\
csharp/src/Google.Protobuf.Test/Reflection/DescriptorsTest.cs
\
csharp/src/Google.Protobuf.Test/Reflection/FieldAccessTest.cs
\
csharp/src/Google.Protobuf.Test/Reflection/TypeRegistryTest.cs
\
...
...
@@ -110,7 +105,7 @@ csharp_EXTRA_DIST= \
csharp/src/Google.Protobuf.Test/WellKnownTypes/DurationTest.cs
\
csharp/src/Google.Protobuf.Test/WellKnownTypes/TimestampTest.cs
\
csharp/src/Google.Protobuf.Test/WellKnownTypes/WrappersTest.cs
\
csharp/src/Google.Protobuf.Test/p
ackages.config
\
csharp/src/Google.Protobuf.Test/p
roject.json
\
csharp/src/Google.Protobuf.sln
\
csharp/src/Google.Protobuf/ByteArray.cs
\
csharp/src/Google.Protobuf/ByteString.cs
\
...
...
@@ -124,8 +119,7 @@ csharp_EXTRA_DIST= \
csharp/src/Google.Protobuf/Compatibility/TypeExtensions.cs
\
csharp/src/Google.Protobuf/FieldCodec.cs
\
csharp/src/Google.Protobuf/FrameworkPortability.cs
\
csharp/src/Google.Protobuf/Google.Protobuf.csproj
\
csharp/src/Google.Protobuf/Google.Protobuf.nuspec
\
csharp/src/Google.Protobuf/Google.Protobuf.xproj
\
csharp/src/Google.Protobuf/IDeepCloneable.cs
\
csharp/src/Google.Protobuf/IMessage.cs
\
csharp/src/Google.Protobuf/InvalidJsonException.cs
\
...
...
@@ -183,7 +177,7 @@ csharp_EXTRA_DIST= \
csharp/src/Google.Protobuf/WellKnownTypes/Wrappers.cs
\
csharp/src/Google.Protobuf/WellKnownTypes/WrappersPartial.cs
\
csharp/src/Google.Protobuf/WireFormat.cs
\
csharp/src/Google.Protobuf/p
ackages.config
\
csharp/src/Google.Protobuf/p
roject.json
\
csharp/src/packages/repositories.config
java_EXTRA_DIST
=
\
...
...
appveyor.bat
View file @
e1f146bc
...
...
@@ -19,9 +19,12 @@ goto :EOF
:build_csharp
echo Building C#
cd csharp\src
nuget restore
msbuild Google.Protobuf.sln /p:Platform="Any CPU" /logger:"C:\Program Files\AppVeyor\BuildAgent\Appveyor.MSBuildLogger.dll" || goto error
nunit-console Google.Protobuf.Test\bin\%configuration%\Google.Protobuf.Test.dll || goto error
dotnet restore
dotnet build -c %configuration% Google.Protobuf Google.Protobuf.Test Google.Protobuf.Conformance || goto error
echo Testing C#
dotnet test -c %configuration% Google.Protobuf.Test || goto error
goto :EOF
:error
...
...
appveyor.yml
View file @
e1f146bc
...
...
@@ -14,10 +14,16 @@ environment:
-
language
:
csharp
# Our build scripts run tests automatically; we don't want AppVeyor
# to try to detect them itself.
test
:
off
install
:
-
ps
:
Start-FileDownload https://googlemock.googlecode.com/files/gmock-1.7.0.zip
-
7z x gmock-1.7.0.zip
-
rename gmock-1.7.0 gmock
-
ps
:
Start-FileDownload https://go.microsoft.com/fwlink/?LinkID=809122 -FileName dotnetsdk.exe
-
dotnetsdk.exe /install /quiet /norestart
before_build
:
-
if %platform%==Win32 set generator=Visual Studio 12
...
...
conformance/Makefile.am
View file @
e1f146bc
...
...
@@ -246,7 +246,7 @@ conformance-java-lite: javac_middleman_lite
conformance-csharp
:
$(other_language_protoc_outputs)
@
echo
"Writing shortcut script conformance-csharp..."
@
echo
'#! /bin/sh'
>
conformance-csharp
@
echo
'
mono ../csharp/src/Google.Protobuf.Conformance/bin/Release/Google.Protobuf.Conformance.exe
"$$@"'
>>
conformance-csharp
@
echo
'
dotnet ../csharp/src/Google.Protobuf.Conformance/bin/Release/netcoreapp1.0/Google.Protobuf.Conformance.dll
"$$@"'
>>
conformance-csharp
@
chmod
+x conformance-csharp
# Targets for actually running tests.
...
...
csharp/.gitignore
View file @
e1f146bc
#
# Untracked directories
#
src/AddressBook/bin
src/AddressBook/obj
src/Google.Protobuf/bin/
src/Google.Protobuf/obj/
src/Google.Protobuf.Conformance/bin/
src/Google.Protobuf.Conformance/obj/
src/Google.Protobuf.Test/bin/
src/Google.Protobuf.Test/obj/
src/Google.Protobuf.JsonDump/bin/
src/Google.Protobuf.JsonDump/obj/
# Output
bin
obj
project.lock.json
TestResult.xml
# Possibly legacy now?
mono/bin
mono/tmp
mono/protoc
...
...
@@ -23,6 +17,7 @@ lib/NUnit
#
# Untracked files
#
.vs
*.user
*.suo
*.nupkg
...
...
csharp/build_packages.bat
View file @
e1f146bc
@rem Builds Google.Protobuf NuGet packages
@rem Adjust the location of nuget.exe
set NUGET=C:\nuget\nuget.exe
@rem Build src/Google.Protobuf.sln solution in Release configuration first.
%NUGET% pack src\Google.Protobuf\Google.Protobuf.nuspec -Symbols || goto :error
dotnet restore src
dotnet pack -c Release src\Google.Protobuf || goto :error
goto :EOF
...
...
csharp/buildall.sh
View file @
e1f146bc
#!/bin/bash
# Use mono to build solution and run all tests.
# Adjust these to reflect the location of nunit-console in your system.
NUNIT_CONSOLE
=
nunit-console
# The rest you can leave intact
CONFIG
=
Release
SRC
=
$(
dirname
$0
)
/src
set
-ex
echo
Building
the solution
.
xbuild /p:Configuration
=
$CONFIG
$SRC
/Google.Protobuf.sln
echo
Building
relevant projects
.
dotnet build
-c
$CONFIG
$SRC
/Google.Protobuf
$SRC
/Google.Protobuf.Test
$SRC
/Google.Protobuf.Conformance
echo
Running tests.
$NUNIT_CONSOLE
$SRC
/Google.Protobuf.Test/bin/
$CONFIG
/Google.Protobuf.Test.dll
# Only test netcoreapp1.0, which uses the .NET Core runtime.
# If we want to test the .NET 4.5 version separately, we could
# run Mono explicitly. However, we don't have any differences between
# the .NET 4.5 and netstandard1.0 assemblies.
dotnet
test
-c
$CONFIG
-f
netcoreapp1.0
$SRC
/Google.Protobuf.Test
csharp/src/AddressBook/AddressBook.csproj
deleted
100644 → 0
View file @
4e0d0513
<?xml version="1.0" encoding="utf-8"?>
<Project
ToolsVersion=
"4.0"
DefaultTargets=
"Build"
xmlns=
"http://schemas.microsoft.com/developer/msbuild/2003"
>
<PropertyGroup>
<Configuration
Condition=
" '$(Configuration)' == '' "
>
Debug
</Configuration>
<Platform
Condition=
" '$(Platform)' == '' "
>
AnyCPU
</Platform>
<ProductVersion>
9.0.30729
</ProductVersion>
<SchemaVersion>
2.0
</SchemaVersion>
<ProjectGuid>
{A31F5FB2-4FF3-432A-B35B-5CD203606311}
</ProjectGuid>
<OutputType>
Exe
</OutputType>
<AppDesignerFolder>
Properties
</AppDesignerFolder>
<RootNamespace>
Google.Protobuf.Examples.AddressBook
</RootNamespace>
<AssemblyName>
AddressBook
</AssemblyName>
<TargetFrameworkVersion>
v4.5
</TargetFrameworkVersion>
<FileAlignment>
512
</FileAlignment>
<StartupObject>
Google.Protobuf.Examples.AddressBook.Program
</StartupObject>
<TargetFrameworkProfile>
</TargetFrameworkProfile>
</PropertyGroup>
<PropertyGroup
Condition=
" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' "
>
<DebugSymbols>
true
</DebugSymbols>
<DebugType>
full
</DebugType>
<Optimize>
false
</Optimize>
<OutputPath>
bin\Debug
</OutputPath>
<IntermediateOutputPath>
obj\Debug\
</IntermediateOutputPath>
<DefineConstants>
DEBUG;TRACE
</DefineConstants>
<ErrorReport>
prompt
</ErrorReport>
<WarningLevel>
4
</WarningLevel>
<NoStdLib>
true
</NoStdLib>
<GenerateSerializationAssemblies>
Off
</GenerateSerializationAssemblies>
<Prefer32Bit>
false
</Prefer32Bit>
</PropertyGroup>
<PropertyGroup
Condition=
" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' "
>
<DebugType>
pdbonly
</DebugType>
<Optimize>
true
</Optimize>
<OutputPath>
bin\Release
</OutputPath>
<IntermediateOutputPath>
obj\Release\
</IntermediateOutputPath>
<DefineConstants>
TRACE
</DefineConstants>
<ErrorReport>
prompt
</ErrorReport>
<WarningLevel>
4
</WarningLevel>
<NoStdLib>
true
</NoStdLib>
<GenerateSerializationAssemblies>
Off
</GenerateSerializationAssemblies>
<Prefer32Bit>
false
</Prefer32Bit>
</PropertyGroup>
<ItemGroup>
<Reference
Include=
"mscorlib"
/>
<Reference
Include=
"System"
/>
<Reference
Include=
"System.Data"
/>
<Reference
Include=
"System.Xml"
/>
</ItemGroup>
<ItemGroup>
<Compile
Include=
"AddPerson.cs"
/>
<Compile
Include=
"Addressbook.cs"
/>
<Compile
Include=
"SampleUsage.cs"
/>
<Compile
Include=
"ListPeople.cs"
/>
<Compile
Include=
"Program.cs"
/>
<Compile
Include=
"Properties\AssemblyInfo.cs"
/>
</ItemGroup>
<ItemGroup>
<ProjectReference
Include=
"..\Google.Protobuf\Google.Protobuf.csproj"
>
<Project>
{6908BDCE-D925-43F3-94AC-A531E6DF2591}
</Project>
<Name>
Google.Protobuf
</Name>
</ProjectReference>
</ItemGroup>
<ItemGroup>
<None
Include=
"app.config"
/>
</ItemGroup>
<Import
Project=
"$(MSBuildToolsPath)\Microsoft.CSharp.targets"
/>
<!-- 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">
</Target>
<Target Name="AfterBuild">
</Target>
-->
</Project>
\ No newline at end of file
csharp/src/AddressBook/AddressBook.xproj
0 → 100644
View file @
e1f146bc
<?xml version="1.0" encoding="utf-8"?>
<Project
ToolsVersion=
"14.0"
DefaultTargets=
"Build"
xmlns=
"http://schemas.microsoft.com/developer/msbuild/2003"
>
<PropertyGroup>
<VisualStudioVersion
Condition=
"'$(VisualStudioVersion)' == ''"
>
14.0
</VisualStudioVersion>
<VSToolsPath
Condition=
"'$(VSToolsPath)' == ''"
>
$(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v$(VisualStudioVersion)
</VSToolsPath>
</PropertyGroup>
<Import
Project=
"$(VSToolsPath)\DotNet\Microsoft.DotNet.Props"
Condition=
"'$(VSToolsPath)' != ''"
/>
<PropertyGroup
Label=
"Globals"
>
<ProjectGuid>
afb63919-1e05-43b4-802a-8fb8c9b2f463
</ProjectGuid>
<RootNamespace>
AddressBook
</RootNamespace>
<BaseIntermediateOutputPath
Condition=
"'$(BaseIntermediateOutputPath)'=='' "
>
.\obj
</BaseIntermediateOutputPath>
<OutputPath
Condition=
"'$(OutputPath)'=='' "
>
.\bin\
</OutputPath>
</PropertyGroup>
<PropertyGroup>
<SchemaVersion>
2.0
</SchemaVersion>
</PropertyGroup>
<Import
Project=
"$(VSToolsPath)\DotNet\Microsoft.DotNet.targets"
Condition=
"'$(VSToolsPath)' != ''"
/>
</Project>
\ No newline at end of file
csharp/src/AddressBook/Properties/AssemblyInfo.cs
deleted
100644 → 0
View file @
4e0d0513
using
System.Reflection
;
using
System.Runtime.InteropServices
;
// General Information about an assembly is controlled through the following
// set of attributes. Change these attribute values to modify the information
// associated with an assembly.
[assembly: AssemblyTitle("AddressBook")]
[assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("")]
[assembly: AssemblyProduct("AddressBook")]
[assembly: AssemblyCopyright("Copyright © 2015")]
[assembly: AssemblyTrademark("")]
[assembly: AssemblyCulture("")]
[assembly: AssemblyVersion("3.0.0.0")]
[assembly: AssemblyFileVersion("3.0.0.0")]
csharp/src/AddressBook/SampleUsage.cs
View file @
e1f146bc
...
...
@@ -66,7 +66,7 @@ namespace Google.Protobuf.Examples.AddressBook
// The message performs a deep-comparison on equality:
if
(
restored
.
People
.
Count
!=
1
||
!
person
.
Equals
(
restored
.
People
[
0
]))
{
throw
new
Application
Exception
(
"There is a bad person in here!"
);
throw
new
Exception
(
"There is a bad person in here!"
);
}
}
}
...
...
csharp/src/AddressBook/app.config
deleted
100644 → 0
View file @
4e0d0513
<?
xml
version
=
"1.0"
?>
<
configuration
>
<
startup
><
supportedRuntime
version
=
"v4.0"
sku
=
".NETFramework,Version=v4.5"
/></
startup
></
configuration
>
csharp/src/AddressBook/project.json
0 → 100644
View file @
e1f146bc
{
"buildOptions"
:
{
"debugType"
:
"portable"
,
"emitEntryPoint"
:
true
,
"additionalArguments"
:
[
"/main:Google.Protobuf.Examples.AddressBook.Program"
]
},
"dependencies"
:
{
"Google.Protobuf"
:
{
"target"
:
"project"
}
},
"frameworks"
:
{
"netcoreapp1.0"
:
{
"dependencies"
:
{
"Microsoft.NETCore.App"
:
{
"type"
:
"platform"
,
"version"
:
"1.0.0"
}
}
}
}
}
csharp/src/Google.Protobuf.Conformance/App.config
deleted
100644 → 0
View file @
4e0d0513
<?
xml
version
=
"1.0"
encoding
=
"utf-8"
?>
<
configuration
>
<
startup
>
<
supportedRuntime
version
=
"v4.0"
sku
=
".NETFramework,Version=v4.5"
/>
</
startup
>
</
configuration
>
\ No newline at end of file
csharp/src/Google.Protobuf.Conformance/Google.Protobuf.Conformance.csproj
deleted
100644 → 0
View file @
4e0d0513
<?xml version="1.0" encoding="utf-8"?>
<Project
ToolsVersion=
"14.0"
DefaultTargets=
"Build"
xmlns=
"http://schemas.microsoft.com/developer/msbuild/2003"
>
<Import
Project=
"$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props"
Condition=
"Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')"
/>
<PropertyGroup>
<Configuration
Condition=
" '$(Configuration)' == '' "
>
Debug
</Configuration>
<Platform
Condition=
" '$(Platform)' == '' "
>
AnyCPU
</Platform>
<ProjectGuid>
{0607D1B8-80D6-4B35-9857-1263C1B32B94}
</ProjectGuid>
<OutputType>
Exe
</OutputType>
<AppDesignerFolder>
Properties
</AppDesignerFolder>
<RootNamespace>
Google.Protobuf.Conformance
</RootNamespace>
<AssemblyName>
Google.Protobuf.Conformance
</AssemblyName>
<TargetFrameworkVersion>
v4.5
</TargetFrameworkVersion>
<FileAlignment>
512
</FileAlignment>
</PropertyGroup>
<PropertyGroup
Condition=
" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' "
>
<PlatformTarget>
AnyCPU
</PlatformTarget>
<DebugSymbols>
true
</DebugSymbols>
<DebugType>
full
</DebugType>
<Optimize>
false
</Optimize>
<OutputPath>
bin\Debug\
</OutputPath>
<DefineConstants>
DEBUG;TRACE
</DefineConstants>
<ErrorReport>
prompt
</ErrorReport>
<WarningLevel>
4
</WarningLevel>
</PropertyGroup>
<PropertyGroup
Condition=
" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' "
>
<PlatformTarget>
AnyCPU
</PlatformTarget>
<DebugType>
pdbonly
</DebugType>
<Optimize>
true
</Optimize>
<OutputPath>
bin\Release\
</OutputPath>
<DefineConstants>
TRACE
</DefineConstants>
<ErrorReport>
prompt
</ErrorReport>
<WarningLevel>
4
</WarningLevel>
</PropertyGroup>
<ItemGroup>
<Reference
Include=
"System"
/>
<Reference
Include=
"System.Core"
/>
<Reference
Include=
"Microsoft.CSharp"
/>
</ItemGroup>
<ItemGroup>
<Compile
Include=
"Conformance.cs"
/>
<Compile
Include=
"Program.cs"
/>
<Compile
Include=
"Properties\AssemblyInfo.cs"
/>
</ItemGroup>
<ItemGroup>
<None
Include=
"App.config"
/>
</ItemGroup>
<ItemGroup>
<ProjectReference
Include=
"..\Google.Protobuf\Google.Protobuf.csproj"
>
<Project>
{6908bdce-d925-43f3-94ac-a531e6df2591}
</Project>
<Name>
Google.Protobuf
</Name>
</ProjectReference>
</ItemGroup>
<Import
Project=
"$(MSBuildToolsPath)\Microsoft.CSharp.targets"
/>
<!-- 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">
</Target>
<Target Name="AfterBuild">
</Target>
-->
</Project>
\ No newline at end of file
csharp/src/Google.Protobuf.Conformance/Google.Protobuf.Conformance.xproj
0 → 100644
View file @
e1f146bc
<?xml version="1.0" encoding="utf-8"?>
<Project
ToolsVersion=
"14.0"
DefaultTargets=
"Build"
xmlns=
"http://schemas.microsoft.com/developer/msbuild/2003"
>
<PropertyGroup>
<VisualStudioVersion
Condition=
"'$(VisualStudioVersion)' == ''"
>
14.0
</VisualStudioVersion>
<VSToolsPath
Condition=
"'$(VSToolsPath)' == ''"
>
$(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v$(VisualStudioVersion)
</VSToolsPath>
</PropertyGroup>
<Import
Project=
"$(VSToolsPath)\DotNet\Microsoft.DotNet.Props"
Condition=
"'$(VSToolsPath)' != ''"
/>
<PropertyGroup
Label=
"Globals"
>
<ProjectGuid>
dddc055b-e185-4181-bab0-072f0f984569
</ProjectGuid>
<RootNamespace>
Google.Protobuf.Conformance
</RootNamespace>
<BaseIntermediateOutputPath
Condition=
"'$(BaseIntermediateOutputPath)'=='' "
>
.\obj
</BaseIntermediateOutputPath>
<OutputPath
Condition=
"'$(OutputPath)'=='' "
>
.\bin\
</OutputPath>
</PropertyGroup>
<PropertyGroup>
<SchemaVersion>
2.0
</SchemaVersion>
</PropertyGroup>
<Import
Project=
"$(VSToolsPath)\DotNet\Microsoft.DotNet.targets"
Condition=
"'$(VSToolsPath)' != ''"
/>
</Project>
\ No newline at end of file
csharp/src/Google.Protobuf.Conformance/Properties/AssemblyInfo.cs
deleted
100644 → 0
View file @
4e0d0513
#
region
Copyright
notice
and
license
// Protocol Buffers - Google's data interchange format
// Copyright 2015 Google Inc. All rights reserved.
// https://developers.google.com/protocol-buffers/
//
// 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.Reflection
;
// General Information about an assembly is controlled through the following
// set of attributes. Change these attribute values to modify the information
// associated with an assembly.
[assembly: AssemblyTitle("Google.Protobuf.Conformance")]
[assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("")]
[assembly: AssemblyProduct("Google.Protobuf.Conformance")]
[assembly: AssemblyCopyright("Copyright © 2015")]
[assembly: AssemblyTrademark("")]
[assembly: AssemblyCulture("")]
[assembly: AssemblyVersion("3.0.0.0")]
[assembly: AssemblyFileVersion("3.0.0.0")]
csharp/src/Google.Protobuf.Conformance/project.json
0 → 100644
View file @
e1f146bc
{
"buildOptions"
:
{
"debugType"
:
"portable"
,
"emitEntryPoint"
:
true
},
"dependencies"
:
{
"Google.Protobuf"
:
{
"target"
:
"project"
}
},
"frameworks"
:
{
"netcoreapp1.0"
:
{
"dependencies"
:
{
"Microsoft.NETCore.App"
:
{
"type"
:
"platform"
,
"version"
:
"1.0.0"
}
}
}
}
}
csharp/src/Google.Protobuf.JsonDump/Google.Protobuf.JsonDump.csproj
deleted
100644 → 0
View file @
4e0d0513
<?xml version="1.0" encoding="utf-8"?>
<Project
ToolsVersion=
"4.0"
DefaultTargets=
"Build"
xmlns=
"http://schemas.microsoft.com/developer/msbuild/2003"
>
<PropertyGroup>
<Configuration
Condition=
" '$(Configuration)' == '' "
>
Debug
</Configuration>
<Platform
Condition=
" '$(Platform)' == '' "
>
AnyCPU
</Platform>
<ProductVersion>
9.0.30729
</ProductVersion>
<SchemaVersion>
2.0
</SchemaVersion>
<ProjectGuid>
{D7282E99-2DC3-405B-946F-177DB2FD2AE2}
</ProjectGuid>
<OutputType>
Exe
</OutputType>
<AppDesignerFolder>
Properties
</AppDesignerFolder>
<RootNamespace>
Google.Protobuf.JsonDump
</RootNamespace>
<AssemblyName>
Google.Protobuf.JsonDump
</AssemblyName>
<TargetFrameworkVersion>
v4.5
</TargetFrameworkVersion>
<FileAlignment>
512
</FileAlignment>
<TargetFrameworkProfile>
</TargetFrameworkProfile>
</PropertyGroup>
<PropertyGroup
Condition=
" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' "
>
<DebugSymbols>
true
</DebugSymbols>
<DebugType>
full
</DebugType>
<Optimize>
false
</Optimize>
<OutputPath>
bin\Debug
</OutputPath>
<IntermediateOutputPath>
obj\Debug\
</IntermediateOutputPath>
<DefineConstants>
DEBUG;TRACE
</DefineConstants>
<ErrorReport>
prompt
</ErrorReport>
<WarningLevel>
4
</WarningLevel>
<NoStdLib>
true
</NoStdLib>
<GenerateSerializationAssemblies>
Off
</GenerateSerializationAssemblies>
<Prefer32Bit>
false
</Prefer32Bit>
</PropertyGroup>
<PropertyGroup
Condition=
" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' "
>
<DebugType>
pdbonly
</DebugType>
<Optimize>
true
</Optimize>
<OutputPath>
bin\Release
</OutputPath>
<IntermediateOutputPath>
obj\Release\
</IntermediateOutputPath>
<DefineConstants>
TRACE
</DefineConstants>
<ErrorReport>
prompt
</ErrorReport>
<WarningLevel>
4
</WarningLevel>
<NoStdLib>
true
</NoStdLib>
<GenerateSerializationAssemblies>
Off
</GenerateSerializationAssemblies>
<Prefer32Bit>
false
</Prefer32Bit>
</PropertyGroup>
<ItemGroup>
<Reference
Include=
"mscorlib"
/>
<Reference
Include=
"System"
/>
</ItemGroup>
<ItemGroup>
<Compile
Include=
"Program.cs"
/>
<Compile
Include=
"Properties\AssemblyInfo.cs"
/>
</ItemGroup>
<ItemGroup>
<ProjectReference
Include=
"..\Google.Protobuf\Google.Protobuf.csproj"
>
<Project>
{6908BDCE-D925-43F3-94AC-A531E6DF2591}
</Project>
<Name>
Google.Protobuf
</Name>
</ProjectReference>
</ItemGroup>
<ItemGroup>
<None
Include=
"app.config"
/>
</ItemGroup>
<Import
Project=
"$(MSBuildToolsPath)\Microsoft.CSharp.targets"
/>
<!-- 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">
</Target>
<Target Name="AfterBuild">
</Target>
-->
</Project>
\ No newline at end of file
csharp/src/Google.Protobuf.JsonDump/Google.Protobuf.JsonDump.xproj
0 → 100644
View file @
e1f146bc
<?xml version="1.0" encoding="utf-8"?>
<Project
ToolsVersion=
"14.0"
DefaultTargets=
"Build"
xmlns=
"http://schemas.microsoft.com/developer/msbuild/2003"
>
<PropertyGroup>
<VisualStudioVersion
Condition=
"'$(VisualStudioVersion)' == ''"
>
14.0
</VisualStudioVersion>
<VSToolsPath
Condition=
"'$(VSToolsPath)' == ''"
>
$(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v$(VisualStudioVersion)
</VSToolsPath>
</PropertyGroup>
<Import
Project=
"$(VSToolsPath)\DotNet\Microsoft.DotNet.Props"
Condition=
"'$(VSToolsPath)' != ''"
/>
<PropertyGroup
Label=
"Globals"
>
<ProjectGuid>
9695e08f-9829-497d-b95c-b38f28d48690
</ProjectGuid>
<RootNamespace>
Google.Protobuf.JsonDump
</RootNamespace>
<BaseIntermediateOutputPath
Condition=
"'$(BaseIntermediateOutputPath)'=='' "
>
.\obj
</BaseIntermediateOutputPath>
<OutputPath
Condition=
"'$(OutputPath)'=='' "
>
.\bin\
</OutputPath>
</PropertyGroup>
<PropertyGroup>
<SchemaVersion>
2.0
</SchemaVersion>
</PropertyGroup>
<Import
Project=
"$(VSToolsPath)\DotNet\Microsoft.DotNet.targets"
Condition=
"'$(VSToolsPath)' != ''"
/>
</Project>
\ No newline at end of file
csharp/src/Google.Protobuf.JsonDump/Program.cs
View file @
e1f146bc
...
...
@@ -32,6 +32,7 @@
using
System
;
using
System.IO
;
using
System.Reflection
;
namespace
Google.Protobuf.ProtoDump
{
...
...
@@ -55,7 +56,7 @@ namespace Google.Protobuf.ProtoDump
Console
.
Error
.
WriteLine
(
"Unable to load type {0}."
,
args
[
0
]);
return
1
;
}
if
(!
typeof
(
IMessage
).
IsAssignableFrom
(
type
))
if
(!
typeof
(
IMessage
).
GetTypeInfo
().
IsAssignableFrom
(
type
))
{
Console
.
Error
.
WriteLine
(
"Type {0} doesn't implement IMessage."
,
args
[
0
]);
return
1
;
...
...
csharp/src/Google.Protobuf.JsonDump/Properties/AssemblyInfo.cs
deleted
100644 → 0
View file @
4e0d0513
using
System.Reflection
;
using
System.Runtime.CompilerServices
;
using
System.Runtime.InteropServices
;
// General Information about an assembly is controlled through the following
// set of attributes. Change these attribute values to modify the information
// associated with an assembly.
[assembly: AssemblyTitle("ProtoDump")]
[assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("")]
[assembly: AssemblyProduct("ProtoDump")]
[assembly: AssemblyCopyright("Copyright © 2015")]
[assembly: AssemblyTrademark("")]
[assembly: AssemblyCulture("")]
[assembly: AssemblyVersion("3.0.0.0")]
[assembly: AssemblyFileVersion("3.0.0.0")]
csharp/src/Google.Protobuf.JsonDump/app.config
deleted
100644 → 0
View file @
4e0d0513
<?
xml
version
=
"1.0"
encoding
=
"utf-8"
?>
<
configuration
>
<
startup
><
supportedRuntime
version
=
"v4.0"
sku
=
".NETFramework,Version=v4.5"
/></
startup
></
configuration
>
csharp/src/Google.Protobuf.JsonDump/project.json
0 → 100644
View file @
e1f146bc
{
"buildOptions"
:
{
"debugType"
:
"portable"
,
"emitEntryPoint"
:
true
},
"dependencies"
:
{
"Google.Protobuf"
:
{
"target"
:
"project"
}
},
"frameworks"
:
{
"netcoreapp1.0"
:
{
"dependencies"
:
{
"Microsoft.NETCore.App"
:
{
"type"
:
"platform"
,
"version"
:
"1.0.0"
}
}
}
}
}
csharp/src/Google.Protobuf.Test/Collections/RepeatedFieldTest.cs
View file @
e1f146bc
...
...
@@ -75,10 +75,96 @@ namespace Google.Protobuf.Collections
}
[
Test
]
public
void
Add_RepeatedField
()
public
void
AddRange_SlowPath
()
{
var
list
=
new
RepeatedField
<
string
>();
list
.
AddRange
(
new
[]
{
"foo"
,
"bar"
}.
Select
(
x
=>
x
));
Assert
.
AreEqual
(
2
,
list
.
Count
);
Assert
.
AreEqual
(
"foo"
,
list
[
0
]);
Assert
.
AreEqual
(
"bar"
,
list
[
1
]);
}
[
Test
]
public
void
AddRange_SlowPath_NullsProhibited_ReferenceType
()
{
var
list
=
new
RepeatedField
<
string
>();
// It's okay for this to throw ArgumentNullException if necessary.
// It's not ideal, but not awful.
Assert
.
Catch
<
ArgumentException
>(()
=>
list
.
AddRange
(
new
[]
{
"foo"
,
null
}.
Select
(
x
=>
x
)));
}
[
Test
]
public
void
AddRange_SlowPath_NullsProhibited_NullableValueType
()
{
var
list
=
new
RepeatedField
<
int
?>();
// It's okay for this to throw ArgumentNullException if necessary.
// It's not ideal, but not awful.
Assert
.
Catch
<
ArgumentException
>(()
=>
list
.
AddRange
(
new
[]
{
20
,
(
int
?)
null
}.
Select
(
x
=>
x
)));
}
[
Test
]
public
void
AddRange_Optimized_NonNullableValueType
()
{
var
list
=
new
RepeatedField
<
int
>();
list
.
AddRange
(
new
List
<
int
>
{
20
,
30
});
Assert
.
AreEqual
(
2
,
list
.
Count
);
Assert
.
AreEqual
(
20
,
list
[
0
]);
Assert
.
AreEqual
(
30
,
list
[
1
]);
}
[
Test
]
public
void
AddRange_Optimized_ReferenceType
()
{
var
list
=
new
RepeatedField
<
string
>();
list
.
AddRange
(
new
List
<
string
>
{
"foo"
,
"bar"
});
Assert
.
AreEqual
(
2
,
list
.
Count
);
Assert
.
AreEqual
(
"foo"
,
list
[
0
]);
Assert
.
AreEqual
(
"bar"
,
list
[
1
]);
}
[
Test
]
public
void
AddRange_Optimized_NullableValueType
()
{
var
list
=
new
RepeatedField
<
int
?>();
list
.
AddRange
(
new
List
<
int
?>
{
20
,
30
});
Assert
.
AreEqual
(
2
,
list
.
Count
);
Assert
.
AreEqual
((
int
?)
20
,
list
[
0
]);
Assert
.
AreEqual
((
int
?)
30
,
list
[
1
]);
}
[
Test
]
public
void
AddRange_Optimized_NullsProhibited_ReferenceType
()
{
// We don't just trust that a collection with a nullable element type doesn't contain nulls
var
list
=
new
RepeatedField
<
string
>();
// It's okay for this to throw ArgumentNullException if necessary.
// It's not ideal, but not awful.
Assert
.
Catch
<
ArgumentException
>(()
=>
list
.
AddRange
(
new
List
<
string
>
{
"foo"
,
null
}));
}
[
Test
]
public
void
AddRange_Optimized_NullsProhibited_NullableValueType
()
{
// We don't just trust that a collection with a nullable element type doesn't contain nulls
var
list
=
new
RepeatedField
<
int
?>();
// It's okay for this to throw ArgumentNullException if necessary.
// It's not ideal, but not awful.
Assert
.
Catch
<
ArgumentException
>(()
=>
list
.
AddRange
(
new
List
<
int
?>
{
20
,
null
}));
}
[
Test
]
public
void
AddRange_AlreadyNotEmpty
()
{
var
list
=
new
RepeatedField
<
int
>
{
1
,
2
,
3
};
list
.
AddRange
(
new
List
<
int
>
{
4
,
5
,
6
});
CollectionAssert
.
AreEqual
(
new
[]
{
1
,
2
,
3
,
4
,
5
,
6
},
list
);
}
[
Test
]
public
void
AddRange_RepeatedField
()
{
var
list
=
new
RepeatedField
<
string
>
{
"original"
};
list
.
Add
(
new
RepeatedField
<
string
>
{
"foo"
,
"bar"
});
list
.
Add
Range
(
new
RepeatedField
<
string
>
{
"foo"
,
"bar"
});
Assert
.
AreEqual
(
3
,
list
.
Count
);
Assert
.
AreEqual
(
"original"
,
list
[
0
]);
Assert
.
AreEqual
(
"foo"
,
list
[
1
]);
...
...
csharp/src/Google.Protobuf.Test/FieldCodecTest.cs
View file @
e1f146bc
...
...
@@ -32,6 +32,7 @@
using
System.Collections.Generic
;
using
System.IO
;
using
System.Reflection
;
using
Google.Protobuf.TestProtos
;
using
NUnit.Framework
;
...
...
@@ -162,7 +163,7 @@ namespace Google.Protobuf
codedOutput
.
Flush
();
Assert
.
AreEqual
(
0
,
stream
.
Position
);
Assert
.
AreEqual
(
0
,
codec
.
CalculateSizeWithTag
(
codec
.
DefaultValue
));
if
(
typeof
(
T
).
IsValueType
)
if
(
typeof
(
T
).
GetTypeInfo
().
IsValueType
)
{
Assert
.
AreEqual
(
default
(
T
),
codec
.
DefaultValue
);
}
...
...
csharp/src/Google.Protobuf.Test/Google.Protobuf.Test.csproj
deleted
100644 → 0
View file @
4e0d0513
<?xml version="1.0" encoding="utf-8"?>
<Project
ToolsVersion=
"4.0"
DefaultTargets=
"Build"
xmlns=
"http://schemas.microsoft.com/developer/msbuild/2003"
>
<PropertyGroup>
<Configuration
Condition=
" '$(Configuration)' == '' "
>
Debug
</Configuration>
<Platform
Condition=
" '$(Platform)' == '' "
>
AnyCPU
</Platform>
<ProductVersion>
9.0.30729
</ProductVersion>
<SchemaVersion>
2.0
</SchemaVersion>
<ProjectGuid>
{DD01ED24-3750-4567-9A23-1DB676A15610}
</ProjectGuid>
<OutputType>
Library
</OutputType>
<AppDesignerFolder>
Properties
</AppDesignerFolder>
<RootNamespace>
Google.Protobuf
</RootNamespace>
<AssemblyName>
Google.Protobuf.Test
</AssemblyName>
<TargetFrameworkVersion>
v4.5
</TargetFrameworkVersion>
<FileAlignment>
512
</FileAlignment>
<OldToolsVersion>
3.5
</OldToolsVersion>
<TargetFrameworkProfile>
</TargetFrameworkProfile>
<NuGetPackageImportStamp>
</NuGetPackageImportStamp>
</PropertyGroup>
<PropertyGroup
Condition=
" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' "
>
<DebugSymbols>
true
</DebugSymbols>
<DebugType>
full
</DebugType>
<Optimize>
false
</Optimize>
<OutputPath>
bin\Debug
</OutputPath>
<IntermediateOutputPath>
obj\Debug\
</IntermediateOutputPath>
<DefineConstants>
DEBUG;TRACE;$(EnvironmentFlavor);$(EnvironmentTemplate)
</DefineConstants>
<ErrorReport>
prompt
</ErrorReport>
<WarningLevel>
4
</WarningLevel>
<NoStdLib>
true
</NoStdLib>
<GenerateSerializationAssemblies>
Off
</GenerateSerializationAssemblies>
<Prefer32Bit>
false
</Prefer32Bit>
</PropertyGroup>
<PropertyGroup
Condition=
" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' "
>
<DebugType>
pdbonly
</DebugType>
<Optimize>
true
</Optimize>
<OutputPath>
bin\Release
</OutputPath>
<IntermediateOutputPath>
obj\Release\
</IntermediateOutputPath>
<DefineConstants>
TRACE;$(EnvironmentFlavor);$(EnvironmentTemplate)
</DefineConstants>
<ErrorReport>
prompt
</ErrorReport>
<WarningLevel>
4
</WarningLevel>
<NoStdLib>
true
</NoStdLib>
<GenerateSerializationAssemblies>
Off
</GenerateSerializationAssemblies>
<Prefer32Bit>
false
</Prefer32Bit>
</PropertyGroup>
<PropertyGroup
Condition=
" '$(Configuration)|$(Platform)' == 'ReleaseSigned|AnyCPU' "
>
<DebugType>
pdbonly
</DebugType>
<Optimize>
true
</Optimize>
<OutputPath>
bin\ReleaseSigned
</OutputPath>
<IntermediateOutputPath>
obj\ReleaseSigned\
</IntermediateOutputPath>
<DefineConstants>
TRACE;$(EnvironmentFlavor);$(EnvironmentTemplate)
</DefineConstants>
<ErrorReport>
prompt
</ErrorReport>
<WarningLevel>
4
</WarningLevel>
<NoStdLib>
true
</NoStdLib>
<GenerateSerializationAssemblies>
Off
</GenerateSerializationAssemblies>
<Prefer32Bit>
false
</Prefer32Bit>
<SignAssembly>
True
</SignAssembly>
<AssemblyOriginatorKeyFile>
..\..\keys\Google.Protobuf.snk
</AssemblyOriginatorKeyFile>
</PropertyGroup>
<ItemGroup>
<Reference
Include=
"mscorlib"
/>
<Reference
Include=
"nunit.core, Version=2.6.4.14350, Culture=neutral, PublicKeyToken=96d09a1eb7f44a77, processorArchitecture=MSIL"
>
<HintPath>
..\packages\NUnitTestAdapter.2.0.0\lib\nunit.core.dll
</HintPath>
<Private>
True
</Private>
</Reference>
<Reference
Include=
"nunit.core.interfaces, Version=2.6.4.14350, Culture=neutral, PublicKeyToken=96d09a1eb7f44a77, processorArchitecture=MSIL"
>
<HintPath>
..\packages\NUnitTestAdapter.2.0.0\lib\nunit.core.interfaces.dll
</HintPath>
<Private>
True
</Private>
</Reference>
<Reference
Include=
"nunit.framework, Version=2.6.4.14350, Culture=neutral, PublicKeyToken=96d09a1eb7f44a77, processorArchitecture=MSIL"
>
<HintPath>
..\packages\NUnit.2.6.4\lib\nunit.framework.dll
</HintPath>
<Private>
True
</Private>
</Reference>
<Reference
Include=
"nunit.util, Version=2.6.4.14350, Culture=neutral, PublicKeyToken=96d09a1eb7f44a77, processorArchitecture=MSIL"
>
<HintPath>
..\packages\NUnitTestAdapter.2.0.0\lib\nunit.util.dll
</HintPath>
<Private>
True
</Private>
</Reference>
<Reference
Include=
"NUnit.VisualStudio.TestAdapter, Version=2.0.0.0, Culture=neutral, PublicKeyToken=4cb40d35494691ac, processorArchitecture=MSIL"
>
<HintPath>
..\packages\NUnitTestAdapter.2.0.0\lib\NUnit.VisualStudio.TestAdapter.dll
</HintPath>
<Private>
True
</Private>
</Reference>
<Reference
Include=
"System"
/>
<Reference
Include=
"System.Xml"
/>
</ItemGroup>
<ItemGroup>
<Compile
Include=
"ByteStringTest.cs"
/>
<Compile
Include=
"CodedInputStreamExtensions.cs"
/>
<Compile
Include=
"CodedInputStreamTest.cs"
/>
<Compile
Include=
"CodedOutputStreamTest.cs"
/>
<Compile
Include=
"Compatibility\PropertyInfoExtensionsTest.cs"
/>
<Compile
Include=
"Compatibility\TypeExtensionsTest.cs"
/>
<Compile
Include=
"EqualityTester.cs"
/>
<Compile
Include=
"FieldCodecTest.cs"
/>
<Compile
Include=
"GeneratedMessageTest.cs"
/>
<Compile
Include=
"Collections\MapFieldTest.cs"
/>
<Compile
Include=
"Collections\RepeatedFieldTest.cs"
/>
<Compile
Include=
"JsonFormatterTest.cs"
/>
<Compile
Include=
"JsonParserTest.cs"
/>
<Compile
Include=
"JsonTokenizerTest.cs"
/>
<Compile
Include=
"Reflection\DescriptorsTest.cs"
/>
<Compile
Include=
"Reflection\FieldAccessTest.cs"
/>
<Compile
Include=
"Reflection\TypeRegistryTest.cs"
/>
<Compile
Include=
"SampleEnum.cs"
/>
<Compile
Include=
"SampleMessages.cs"
/>
<Compile
Include=
"TestProtos\ForeignMessagePartial.cs"
/>
<Compile
Include=
"TestProtos\MapUnittestProto3.cs"
/>
<Compile
Include=
"TestProtos\UnittestImportProto3.cs"
/>
<Compile
Include=
"TestProtos\UnittestImportPublicProto3.cs"
/>
<Compile
Include=
"TestProtos\UnittestIssues.cs"
/>
<Compile
Include=
"TestProtos\UnittestProto3.cs"
/>
<Compile
Include=
"DeprecatedMemberTest.cs"
/>
<Compile
Include=
"IssuesTest.cs"
/>
<Compile
Include=
"Properties\AssemblyInfo.cs"
/>
<Compile
Include=
"TestCornerCases.cs"
/>
<Compile
Include=
"TestProtos\UnittestWellKnownTypes.cs"
/>
<Compile
Include=
"WellKnownTypes\AnyTest.cs"
/>
<Compile
Include=
"WellKnownTypes\DurationTest.cs"
/>
<Compile
Include=
"WellKnownTypes\FieldMaskTest.cs"
/>
<Compile
Include=
"WellKnownTypes\TimestampTest.cs"
/>
<Compile
Include=
"WellKnownTypes\WrappersTest.cs"
/>
</ItemGroup>
<ItemGroup>
<ProjectReference
Include=
"..\Google.Protobuf\Google.Protobuf.csproj"
>
<Project>
{6908BDCE-D925-43F3-94AC-A531E6DF2591}
</Project>
<Name>
Google.Protobuf
</Name>
</ProjectReference>
</ItemGroup>
<ItemGroup>
<None
Include=
"packages.config"
/>
</ItemGroup>
<ItemGroup>
<Service
Include=
"{82A7F48D-3B50-4B1E-B82E-3ADA8210C358}"
/>
</ItemGroup>
<ItemGroup
/>
<Import
Project=
"$(MSBuildToolsPath)\Microsoft.CSharp.targets"
/>
<!-- 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">
</Target>
<Target Name="AfterBuild">
</Target>
-->
</Project>
\ No newline at end of file
csharp/src/Google.Protobuf.Test/Google.Protobuf.Test.xproj
0 → 100644
View file @
e1f146bc
<?xml version="1.0" encoding="utf-8"?>
<Project
ToolsVersion=
"14.0"
DefaultTargets=
"Build"
xmlns=
"http://schemas.microsoft.com/developer/msbuild/2003"
>
<PropertyGroup>
<VisualStudioVersion
Condition=
"'$(VisualStudioVersion)' == ''"
>
14.0
</VisualStudioVersion>
<VSToolsPath
Condition=
"'$(VSToolsPath)' == ''"
>
$(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v$(VisualStudioVersion)
</VSToolsPath>
</PropertyGroup>
<Import
Project=
"$(VSToolsPath)\DotNet\Microsoft.DotNet.Props"
Condition=
"'$(VSToolsPath)' != ''"
/>
<PropertyGroup
Label=
"Globals"
>
<ProjectGuid>
580eb013-d3c7-4578-b845-015f4a3b0591
</ProjectGuid>
<RootNamespace>
Google.Protobuf.Test
</RootNamespace>
<BaseIntermediateOutputPath
Condition=
"'$(BaseIntermediateOutputPath)'=='' "
>
.\obj
</BaseIntermediateOutputPath>
<OutputPath
Condition=
"'$(OutputPath)'=='' "
>
.\bin\
</OutputPath>
</PropertyGroup>
<PropertyGroup>
<SchemaVersion>
2.0
</SchemaVersion>
</PropertyGroup>
<Import
Project=
"$(VSToolsPath)\DotNet\Microsoft.DotNet.targets"
Condition=
"'$(VSToolsPath)' != ''"
/>
</Project>
\ No newline at end of file
csharp/src/Google.Protobuf.Test/Properties/AppManifest.xml
deleted
100644 → 0
View file @
4e0d0513
<Deployment
xmlns=
"http://schemas.microsoft.com/client/2007/deployment"
xmlns:x=
"http://schemas.microsoft.com/winfx/2006/xaml"
>
<Deployment.Parts>
</Deployment.Parts>
</Deployment>
csharp/src/Google.Protobuf.Test/Properties/AssemblyInfo.cs
deleted
100644 → 0
View file @
4e0d0513
using
System
;
using
System.Reflection
;
using
System.Runtime.CompilerServices
;
using
System.Runtime.InteropServices
;
// General Information about an assembly is controlled through the following
// set of attributes. Change these attribute values to modify the information
// associated with an assembly.
[assembly: AssemblyTitle("Google.Protobuf.Test")]
[assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("")]
[assembly: AssemblyProduct("Google.Protobuf.Test")]
[assembly: AssemblyCopyright("Copyright © 2015")]
[assembly: AssemblyTrademark("")]
[assembly: AssemblyCulture("")]
[assembly: AssemblyVersion("3.0.0.0")]
[assembly: AssemblyFileVersion("3.0.0.0")]
csharp/src/Google.Protobuf.Test/WellKnownTypes/AnyTest.cs
View file @
e1f146bc
...
...
@@ -96,7 +96,7 @@ namespace Google.Protobuf.WellKnownTypes
var
message
=
SampleMessages
.
CreateFullTestAllTypes
();
var
any
=
Any
.
Pack
(
message
);
var
text
=
any
.
ToString
();
Assert
.
That
(
text
,
Is
.
StringContaining
(
"\"@value\": \""
+
message
.
ToByteString
().
ToBase64
()
+
"\""
));
Assert
.
That
(
text
,
Does
.
Contain
(
"\"@value\": \""
+
message
.
ToByteString
().
ToBase64
()
+
"\""
));
}
[
Test
]
...
...
csharp/src/Google.Protobuf.Test/WellKnownTypes/FieldMaskTest.cs
View file @
e1f146bc
...
...
@@ -46,8 +46,8 @@ namespace Google.Protobuf.WellKnownTypes
var
mask
=
new
FieldMask
{
Paths
=
{
input
}
};
var
text
=
mask
.
ToString
();
// More specific test below
Assert
.
That
(
text
,
Is
.
StringContaining
(
"@warning"
));
Assert
.
That
(
text
,
Is
.
StringContaining
(
input
));
Assert
.
That
(
text
,
Does
.
Contain
(
"@warning"
));
Assert
.
That
(
text
,
Does
.
Contain
(
input
));
}
[
Test
]
...
...
csharp/src/Google.Protobuf.Test/packages.config
deleted
100644 → 0
View file @
4e0d0513
<?
xml
version
=
"1.0"
encoding
=
"utf-8"
?>
<
packages
>
<
package
id
=
"NUnit"
version
=
"2.6.4"
targetFramework
=
"net45"
userInstalled
=
"true"
/>
<
package
id
=
"NUnitTestAdapter"
version
=
"2.0.0"
targetFramework
=
"net45"
userInstalled
=
"true"
/>
</
packages
>
\ No newline at end of file
csharp/src/Google.Protobuf.Test/project.json
0 → 100644
View file @
e1f146bc
{
"buildOptions"
:
{
"debugType"
:
"portable"
,
"keyFile"
:
"../../keys/Google.Protobuf.snk"
},
"configurations"
:
{
"Debug"
:
{
"buildOptions"
:
{
"define"
:
[
"DEBUG"
,
"TRACE"
]
}
},
"Release"
:
{
"buildOptions"
:
{
"define"
:
[
"RELEASE"
,
"TRACE"
],
"optimize"
:
true
}
}
},
"dependencies"
:
{
"Google.Protobuf"
:
{
"target"
:
"project"
},
"NUnit"
:
"3.4.0"
,
"dotnet-test-nunit"
:
"3.4.0-alpha-2"
,
},
"testRunner"
:
"nunit"
,
"frameworks"
:
{
"netcoreapp1.0"
:
{
"imports"
:
[
"dnxcore50"
,
"netcoreapp1.0"
,
"portable-net45+win8"
],
"buildOptions"
:
{
"define"
:
[
"PCL"
]
},
"dependencies"
:
{
"Microsoft.NETCore.App"
:
{
"version"
:
"1.0.0"
,
"type"
:
"platform"
},
"System.Console"
:
"4.0.0"
}
}
}
}
\ No newline at end of file
csharp/src/Google.Protobuf.sln
View file @
e1f146bc
Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio
2015
VisualStudioVersion = 14.0.2
4720.0
# Visual Studio
14
VisualStudioVersion = 14.0.2
5420.1
MinimumVisualStudioVersion = 14.0.24720.0
Project("{
FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Google.Protobuf", "Google.Protobuf\Google.Protobuf.csproj", "{6908BDCE-D925-43F3-94AC-A531E6DF2591
}"
Project("{
8BB2217D-0F2D-49D1-97BC-3654ED321F3B}") = "AddressBook", "AddressBook\AddressBook.xproj", "{AFB63919-1E05-43B4-802A-8FB8C9B2F463
}"
EndProject
Project("{
FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Google.Protobuf.Test", "Google.Protobuf.Test\Google.Protobuf.Test.csproj", "{DD01ED24-3750-4567-9A23-1DB676A15610
}"
Project("{
8BB2217D-0F2D-49D1-97BC-3654ED321F3B}") = "Google.Protobuf", "Google.Protobuf\Google.Protobuf.xproj", "{9B576380-726D-4142-8238-60A43AB0E35A
}"
EndProject
Project("{
FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "AddressBook", "AddressBook\AddressBook.csproj", "{A31F5FB2-4FF3-432A-B35B-5CD20360631
1}"
Project("{
8BB2217D-0F2D-49D1-97BC-3654ED321F3B}") = "Google.Protobuf.Test", "Google.Protobuf.Test\Google.Protobuf.Test.xproj", "{580EB013-D3C7-4578-B845-015F4A3B059
1}"
EndProject
Project("{
FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Google.Protobuf.JsonDump", "Google.Protobuf.JsonDump\Google.Protobuf.JsonDump.csproj", "{D7282E99-2DC3-405B-946F-177DB2FD2AE2
}"
Project("{
8BB2217D-0F2D-49D1-97BC-3654ED321F3B}") = "Google.Protobuf.Conformance", "Google.Protobuf.Conformance\Google.Protobuf.Conformance.xproj", "{DDDC055B-E185-4181-BAB0-072F0F984569
}"
EndProject
Project("{
FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Google.Protobuf.Conformance", "Google.Protobuf.Conformance\Google.Protobuf.Conformance.csproj", "{0607D1B8-80D6-4B35-9857-1263C1B32B94
}"
Project("{
8BB2217D-0F2D-49D1-97BC-3654ED321F3B}") = "Google.Protobuf.JsonDump", "Google.Protobuf.JsonDump\Google.Protobuf.JsonDump.xproj", "{9695E08F-9829-497D-B95C-B38F28D48690
}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
Release|Any CPU = Release|Any CPU
ReleaseSigned|Any CPU = ReleaseSigned|Any CPU
EndGlobalSection
GlobalSection(ProjectConfigurationPlatforms) = postSolution
{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|Any CPU.ActiveCfg = Release|Any CPU
{6908BDCE-D925-43F3-94AC-A531E6DF2591}.Release|Any CPU.Build.0 = Release|Any CPU
{6908BDCE-D925-43F3-94AC-A531E6DF2591}.ReleaseSigned|Any CPU.ActiveCfg = ReleaseSigned|Any CPU
{6908BDCE-D925-43F3-94AC-A531E6DF2591}.ReleaseSigned|Any CPU.Build.0 = ReleaseSigned|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|Any CPU.ActiveCfg = Release|Any CPU
{DD01ED24-3750-4567-9A23-1DB676A15610}.Release|Any CPU.Build.0 = Release|Any CPU
{DD01ED24-3750-4567-9A23-1DB676A15610}.ReleaseSigned|Any CPU.ActiveCfg = ReleaseSigned|Any CPU
{DD01ED24-3750-4567-9A23-1DB676A15610}.ReleaseSigned|Any CPU.Build.0 = ReleaseSigned|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|Any CPU.ActiveCfg = Release|Any CPU
{A31F5FB2-4FF3-432A-B35B-5CD203606311}.Release|Any CPU.Build.0 = Release|Any CPU
{A31F5FB2-4FF3-432A-B35B-5CD203606311}.ReleaseSigned|Any CPU.ActiveCfg = Release|Any CPU
{A31F5FB2-4FF3-432A-B35B-5CD203606311}.ReleaseSigned|Any CPU.Build.0 = Release|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|Any CPU.ActiveCfg = Release|Any CPU
{D7282E99-2DC3-405B-946F-177DB2FD2AE2}.Release|Any CPU.Build.0 = Release|Any CPU
{D7282E99-2DC3-405B-946F-177DB2FD2AE2}.ReleaseSigned|Any CPU.ActiveCfg = Release|Any CPU
{D7282E99-2DC3-405B-946F-177DB2FD2AE2}.ReleaseSigned|Any CPU.Build.0 = Release|Any CPU
{0607D1B8-80D6-4B35-9857-1263C1B32B94}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{0607D1B8-80D6-4B35-9857-1263C1B32B94}.Debug|Any CPU.Build.0 = Debug|Any CPU
{0607D1B8-80D6-4B35-9857-1263C1B32B94}.Release|Any CPU.ActiveCfg = Release|Any CPU
{0607D1B8-80D6-4B35-9857-1263C1B32B94}.Release|Any CPU.Build.0 = Release|Any CPU
{0607D1B8-80D6-4B35-9857-1263C1B32B94}.ReleaseSigned|Any CPU.ActiveCfg = Release|Any CPU
{0607D1B8-80D6-4B35-9857-1263C1B32B94}.ReleaseSigned|Any CPU.Build.0 = Release|Any CPU
{AFB63919-1E05-43B4-802A-8FB8C9B2F463}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{AFB63919-1E05-43B4-802A-8FB8C9B2F463}.Debug|Any CPU.Build.0 = Debug|Any CPU
{AFB63919-1E05-43B4-802A-8FB8C9B2F463}.Release|Any CPU.ActiveCfg = Release|Any CPU
{AFB63919-1E05-43B4-802A-8FB8C9B2F463}.Release|Any CPU.Build.0 = Release|Any CPU
{9B576380-726D-4142-8238-60A43AB0E35A}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{9B576380-726D-4142-8238-60A43AB0E35A}.Debug|Any CPU.Build.0 = Debug|Any CPU
{9B576380-726D-4142-8238-60A43AB0E35A}.Release|Any CPU.ActiveCfg = Release|Any CPU
{9B576380-726D-4142-8238-60A43AB0E35A}.Release|Any CPU.Build.0 = Release|Any CPU
{580EB013-D3C7-4578-B845-015F4A3B0591}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{580EB013-D3C7-4578-B845-015F4A3B0591}.Debug|Any CPU.Build.0 = Debug|Any CPU
{580EB013-D3C7-4578-B845-015F4A3B0591}.Release|Any CPU.ActiveCfg = Release|Any CPU
{580EB013-D3C7-4578-B845-015F4A3B0591}.Release|Any CPU.Build.0 = Release|Any CPU
{DDDC055B-E185-4181-BAB0-072F0F984569}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{DDDC055B-E185-4181-BAB0-072F0F984569}.Debug|Any CPU.Build.0 = Debug|Any CPU
{DDDC055B-E185-4181-BAB0-072F0F984569}.Release|Any CPU.ActiveCfg = Release|Any CPU
{DDDC055B-E185-4181-BAB0-072F0F984569}.Release|Any CPU.Build.0 = Release|Any CPU
{9695E08F-9829-497D-B95C-B38F28D48690}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{9695E08F-9829-497D-B95C-B38F28D48690}.Debug|Any CPU.Build.0 = Debug|Any CPU
{9695E08F-9829-497D-B95C-B38F28D48690}.Release|Any CPU.ActiveCfg = Release|Any CPU
{9695E08F-9829-497D-B95C-B38F28D48690}.Release|Any CPU.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
...
...
csharp/src/Google.Protobuf/Collections/MapField.cs
View file @
e1f146bc
...
...
@@ -30,14 +30,13 @@
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#endregion
using
Google.Protobuf.Compatibility
;
using
Google.Protobuf.Reflection
;
using
System
;
using
System.Collections
;
using
System.Collections.Generic
;
using
System.IO
;
using
System.Linq
;
using
System.Text
;
using
Google.Protobuf.Compatibility
;
namespace
Google.Protobuf.Collections
{
...
...
@@ -113,7 +112,7 @@ namespace Google.Protobuf.Collections
// Validation of arguments happens in ContainsKey and the indexer
if
(
ContainsKey
(
key
))
{
throw
new
ArgumentException
(
"Key already exists in map"
,
"key"
);
throw
new
ArgumentException
(
"Key already exists in map"
,
nameof
(
key
)
);
}
this
[
key
]
=
value
;
}
...
...
@@ -125,7 +124,7 @@ namespace Google.Protobuf.Collections
/// <returns><c>true</c> if the map contains the given key; <c>false</c> otherwise.</returns>
public
bool
ContainsKey
(
TKey
key
)
{
ProtoPreconditions
.
CheckNotNullUnconstrained
(
key
,
"key"
);
ProtoPreconditions
.
CheckNotNullUnconstrained
(
key
,
nameof
(
key
)
);
return
map
.
ContainsKey
(
key
);
}
...
...
@@ -142,7 +141,7 @@ namespace Google.Protobuf.Collections
/// <returns><c>true</c> if the map contained the given key before the entry was removed; <c>false</c> otherwise.</returns>
public
bool
Remove
(
TKey
key
)
{
ProtoPreconditions
.
CheckNotNullUnconstrained
(
key
,
"key"
);
ProtoPreconditions
.
CheckNotNullUnconstrained
(
key
,
nameof
(
key
)
);
LinkedListNode
<
KeyValuePair
<
TKey
,
TValue
>>
node
;
if
(
map
.
TryGetValue
(
key
,
out
node
))
{
...
...
@@ -190,7 +189,7 @@ namespace Google.Protobuf.Collections
{
get
{
ProtoPreconditions
.
CheckNotNullUnconstrained
(
key
,
"key"
);
ProtoPreconditions
.
CheckNotNullUnconstrained
(
key
,
nameof
(
key
)
);
TValue
value
;
if
(
TryGetValue
(
key
,
out
value
))
{
...
...
@@ -200,11 +199,11 @@ namespace Google.Protobuf.Collections
}
set
{
ProtoPreconditions
.
CheckNotNullUnconstrained
(
key
,
"key"
);
ProtoPreconditions
.
CheckNotNullUnconstrained
(
key
,
nameof
(
key
)
);
// value == null check here is redundant, but avoids boxing.
if
(
value
==
null
)
{
ProtoPreconditions
.
CheckNotNullUnconstrained
(
value
,
"value"
);
ProtoPreconditions
.
CheckNotNullUnconstrained
(
value
,
nameof
(
value
)
);
}
LinkedListNode
<
KeyValuePair
<
TKey
,
TValue
>>
node
;
var
pair
=
new
KeyValuePair
<
TKey
,
TValue
>(
key
,
value
);
...
...
@@ -236,7 +235,7 @@ namespace Google.Protobuf.Collections
/// <param name="entries">The entries to add to the map.</param>
public
void
Add
(
IDictionary
<
TKey
,
TValue
>
entries
)
{
ProtoPreconditions
.
CheckNotNull
(
entries
,
"entries"
);
ProtoPreconditions
.
CheckNotNull
(
entries
,
nameof
(
entries
)
);
foreach
(
var
pair
in
entries
)
{
Add
(
pair
.
Key
,
pair
.
Value
);
...
...
@@ -315,7 +314,7 @@ namespace Google.Protobuf.Collections
{
if
(
item
.
Key
==
null
)
{
throw
new
ArgumentException
(
"Key is null"
,
"item"
);
throw
new
ArgumentException
(
"Key is null"
,
nameof
(
item
)
);
}
LinkedListNode
<
KeyValuePair
<
TKey
,
TValue
>>
node
;
if
(
map
.
TryGetValue
(
item
.
Key
,
out
node
)
&&
...
...
@@ -503,7 +502,7 @@ namespace Google.Protobuf.Collections
void
IDictionary
.
Remove
(
object
key
)
{
ProtoPreconditions
.
CheckNotNull
(
key
,
"key"
);
ProtoPreconditions
.
CheckNotNull
(
key
,
nameof
(
key
)
);
if
(!(
key
is
TKey
))
{
return
;
...
...
@@ -532,7 +531,7 @@ namespace Google.Protobuf.Collections
{
get
{
ProtoPreconditions
.
CheckNotNull
(
key
,
"key"
);
ProtoPreconditions
.
CheckNotNull
(
key
,
nameof
(
key
)
);
if
(!(
key
is
TKey
))
{
return
null
;
...
...
@@ -714,11 +713,11 @@ namespace Google.Protobuf.Collections
{
if
(
arrayIndex
<
0
)
{
throw
new
ArgumentOutOfRangeException
(
"arrayIndex"
);
throw
new
ArgumentOutOfRangeException
(
nameof
(
arrayIndex
)
);
}
if
(
arrayIndex
+
Count
>=
array
.
Length
)
{
throw
new
ArgumentException
(
"Not enough space in the array"
,
"array"
);
throw
new
ArgumentException
(
"Not enough space in the array"
,
nameof
(
array
)
);
}
foreach
(
var
item
in
this
)
{
...
...
@@ -745,11 +744,11 @@ namespace Google.Protobuf.Collections
{
if
(
index
<
0
)
{
throw
new
ArgumentOutOfRangeException
(
"index"
);
throw
new
ArgumentOutOfRangeException
(
nameof
(
index
)
);
}
if
(
index
+
Count
>=
array
.
Length
)
{
throw
new
ArgumentException
(
"Not enough space in the array"
,
"array"
);
throw
new
ArgumentException
(
"Not enough space in the array"
,
nameof
(
array
)
);
}
foreach
(
var
item
in
this
)
{
...
...
csharp/src/Google.Protobuf/Collections/RepeatedField.cs
View file @
e1f146bc
...
...
@@ -34,7 +34,6 @@ using System;
using
System.Collections
;
using
System.Collections.Generic
;
using
System.IO
;
using
System.Text
;
namespace
Google.Protobuf.Collections
{
...
...
@@ -227,10 +226,7 @@ namespace Google.Protobuf.Collections
/// <param name="item">The item to add.</param>
public
void
Add
(
T
item
)
{
if
(
item
==
null
)
{
throw
new
ArgumentNullException
(
"item"
);
}
ProtoPreconditions
.
CheckNotNullUnconstrained
(
item
,
nameof
(
item
));
EnsureSize
(
count
+
1
);
array
[
count
++]
=
item
;
}
...
...
@@ -285,46 +281,82 @@ namespace Google.Protobuf.Collections
/// <summary>
/// Gets the number of elements contained in the collection.
/// </summary>
public
int
Count
{
get
{
return
count
;
}
}
public
int
Count
=>
count
;
/// <summary>
/// Gets a value indicating whether the collection is read-only.
/// </summary>
public
bool
IsReadOnly
{
get
{
return
false
;
}
}
// TODO: Remove this overload and just handle it in the one below, at execution time?
public
bool
IsReadOnly
=>
false
;
/// <summary>
/// Adds all of the specified values into this collection.
/// </summary>
/// <param name="values">The values to add to this collection.</param>
public
void
Add
(
RepeatedField
<
T
>
values
)
public
void
Add
Range
(
IEnumerable
<
T
>
values
)
{
if
(
values
==
null
)
ProtoPreconditions
.
CheckNotNull
(
values
,
nameof
(
values
));
// Optimization 1: If the collection we're adding is already a RepeatedField<T>,
// we know the values are valid.
var
otherRepeatedField
=
values
as
RepeatedField
<
T
>;
if
(
otherRepeatedField
!=
null
)
{
throw
new
ArgumentNullException
(
"values"
);
EnsureSize
(
count
+
otherRepeatedField
.
count
);
Array
.
Copy
(
otherRepeatedField
.
array
,
0
,
array
,
count
,
otherRepeatedField
.
count
);
count
+=
otherRepeatedField
.
count
;
return
;
}
// Optimization 2: The collection is an ICollection, so we can expand
// just once and ask the collection to copy itself into the array.
var
collection
=
values
as
ICollection
;
if
(
collection
!=
null
)
{
var
extraCount
=
collection
.
Count
;
// For reference types and nullable value types, we need to check that there are no nulls
// present. (This isn't a thread-safe approach, but we don't advertise this is thread-safe.)
// We expect the JITter to optimize this test to true/false, so it's effectively conditional
// specialization.
if
(
default
(
T
)
==
null
)
{
// TODO: Measure whether iterating once to check and then letting the collection copy
// itself is faster or slower than iterating and adding as we go. For large
// collections this will not be great in terms of cache usage... but the optimized
// copy may be significantly faster than doing it one at a time.
foreach
(
var
item
in
collection
)
{
if
(
item
==
null
)
{
throw
new
ArgumentException
(
"Sequence contained null element"
,
nameof
(
values
));
}
}
}
EnsureSize
(
count
+
extraCount
);
collection
.
CopyTo
(
array
,
count
);
count
+=
extraCount
;
return
;
}
// We *could* check for ICollection<T> as well, but very very few collections implement
// ICollection<T> but not ICollection. (HashSet<T> does, for one...)
// Fall back to a slower path of adding items one at a time.
foreach
(
T
item
in
values
)
{
Add
(
item
);
}
EnsureSize
(
count
+
values
.
count
);
// We know that all the values will be valid, because it's a RepeatedField.
Array
.
Copy
(
values
.
array
,
0
,
array
,
count
,
values
.
count
);
count
+=
values
.
count
;
}
/// <summary>
/// Adds all of the specified values into this collection.
/// Adds all of the specified values into this collection. This method is present to
/// allow repeated fields to be constructed from queries within collection initializers.
/// Within non-collection-initializer code, consider using the equivalent <see cref="AddRange"/>
/// method instead for clarity.
/// </summary>
/// <param name="values">The values to add to this collection.</param>
public
void
Add
(
IEnumerable
<
T
>
values
)
{
if
(
values
==
null
)
{
throw
new
ArgumentNullException
(
"values"
);
}
// TODO: Check for ICollection and get the Count, to optimize?
foreach
(
T
item
in
values
)
{
Add
(
item
);
}
AddRange
(
values
);
}
/// <summary>
...
...
@@ -418,10 +450,7 @@ namespace Google.Protobuf.Collections
/// <returns>The zero-based index of the item, or -1 if it is not found.</returns>
public
int
IndexOf
(
T
item
)
{
if
(
item
==
null
)
{
throw
new
ArgumentNullException
(
"item"
);
}
ProtoPreconditions
.
CheckNotNullUnconstrained
(
item
,
nameof
(
item
));
EqualityComparer
<
T
>
comparer
=
EqualityComparer
<
T
>.
Default
;
for
(
int
i
=
0
;
i
<
count
;
i
++)
{
...
...
@@ -440,13 +469,10 @@ namespace Google.Protobuf.Collections
/// <param name="item">The item to insert.</param>
public
void
Insert
(
int
index
,
T
item
)
{
if
(
item
==
null
)
{
throw
new
ArgumentNullException
(
"item"
);
}
ProtoPreconditions
.
CheckNotNullUnconstrained
(
item
,
nameof
(
item
));
if
(
index
<
0
||
index
>
count
)
{
throw
new
ArgumentOutOfRangeException
(
"index"
);
throw
new
ArgumentOutOfRangeException
(
nameof
(
index
)
);
}
EnsureSize
(
count
+
1
);
Array
.
Copy
(
array
,
index
,
array
,
index
+
1
,
count
-
index
);
...
...
@@ -462,7 +488,7 @@ namespace Google.Protobuf.Collections
{
if
(
index
<
0
||
index
>=
count
)
{
throw
new
ArgumentOutOfRangeException
(
"index"
);
throw
new
ArgumentOutOfRangeException
(
nameof
(
index
)
);
}
Array
.
Copy
(
array
,
index
+
1
,
array
,
index
,
count
-
index
-
1
);
count
--;
...
...
@@ -494,7 +520,7 @@ namespace Google.Protobuf.Collections
{
if
(
index
<
0
||
index
>=
count
)
{
throw
new
ArgumentOutOfRangeException
(
"index"
);
throw
new
ArgumentOutOfRangeException
(
nameof
(
index
)
);
}
return
array
[
index
];
}
...
...
@@ -502,27 +528,24 @@ namespace Google.Protobuf.Collections
{
if
(
index
<
0
||
index
>=
count
)
{
throw
new
ArgumentOutOfRangeException
(
"index"
);
}
if
(
value
==
null
)
{
throw
new
ArgumentNullException
(
"value"
);
throw
new
ArgumentOutOfRangeException
(
nameof
(
index
));
}
ProtoPreconditions
.
CheckNotNullUnconstrained
(
value
,
nameof
(
value
));
array
[
index
]
=
value
;
}
}
#
region
Explicit
interface
implementation
for
IList
and
ICollection
.
bool
IList
.
IsFixedSize
{
get
{
return
false
;
}
}
bool
IList
.
IsFixedSize
=>
false
;
void
ICollection
.
CopyTo
(
Array
array
,
int
index
)
{
Array
.
Copy
(
this
.
array
,
0
,
array
,
index
,
count
);
}
bool
ICollection
.
IsSynchronized
{
get
{
return
false
;
}
}
bool
ICollection
.
IsSynchronized
=>
false
;
object
ICollection
.
SyncRoot
{
get
{
return
this
;
}
}
object
ICollection
.
SyncRoot
=>
this
;
object
IList
.
this
[
int
index
]
{
...
...
csharp/src/Google.Protobuf/Google.Protobuf.csproj
deleted
100644 → 0
View file @
4e0d0513
<?xml version="1.0" encoding="utf-8"?>
<Project
ToolsVersion=
"4.0"
DefaultTargets=
"Build"
xmlns=
"http://schemas.microsoft.com/developer/msbuild/2003"
>
<PropertyGroup>
<Configuration
Condition=
" '$(Configuration)' == '' "
>
Debug
</Configuration>
<Platform
Condition=
" '$(Platform)' == '' "
>
AnyCPU
</Platform>
<ProductVersion>
9.0.30729
</ProductVersion>
<SchemaVersion>
2.0
</SchemaVersion>
<ProjectGuid>
{6908BDCE-D925-43F3-94AC-A531E6DF2591}
</ProjectGuid>
<OutputType>
Library
</OutputType>
<AppDesignerFolder>
Properties
</AppDesignerFolder>
<RootNamespace>
Google.Protobuf
</RootNamespace>
<AssemblyName>
Google.Protobuf
</AssemblyName>
<ProjectTypeGuids>
{786C830F-07A1-408B-BD7F-6EE04809D6DB};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}
</ProjectTypeGuids>
<TargetFrameworkProfile>
Profile259
</TargetFrameworkProfile>
<TargetFrameworkVersion>
v4.5
</TargetFrameworkVersion>
<FileAlignment>
512
</FileAlignment>
<OldToolsVersion>
3.5
</OldToolsVersion>
<MinimumVisualStudioVersion>
10.0
</MinimumVisualStudioVersion>
<NuGetPackageImportStamp>
</NuGetPackageImportStamp>
</PropertyGroup>
<PropertyGroup
Condition=
" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' "
>
<DebugSymbols>
true
</DebugSymbols>
<DebugType>
full
</DebugType>
<Optimize>
false
</Optimize>
<OutputPath>
bin\Debug
</OutputPath>
<IntermediateOutputPath>
obj\Debug\
</IntermediateOutputPath>
<DocumentationFile>
bin\Debug\Google.Protobuf.xml
</DocumentationFile>
<NoWarn>
</NoWarn>
<DefineConstants>
DEBUG;TRACE
</DefineConstants>
<ErrorReport>
prompt
</ErrorReport>
<WarningLevel>
4
</WarningLevel>
<NoStdLib>
true
</NoStdLib>
<GenerateSerializationAssemblies>
Off
</GenerateSerializationAssemblies>
<TreatWarningsAsErrors>
true
</TreatWarningsAsErrors>
</PropertyGroup>
<PropertyGroup
Condition=
" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' "
>
<DebugType>
pdbonly
</DebugType>
<Optimize>
true
</Optimize>
<OutputPath>
bin\Release
</OutputPath>
<IntermediateOutputPath>
obj\Release\
</IntermediateOutputPath>
<DocumentationFile>
$(OutputPath)\$(AssemblyName).xml
</DocumentationFile>
<NoWarn>
</NoWarn>
<DefineConstants>
TRACE
</DefineConstants>
<ErrorReport>
prompt
</ErrorReport>
<WarningLevel>
4
</WarningLevel>
<NoStdLib>
true
</NoStdLib>
<GenerateSerializationAssemblies>
Off
</GenerateSerializationAssemblies>
<TreatWarningsAsErrors>
true
</TreatWarningsAsErrors>
</PropertyGroup>
<PropertyGroup
Condition=
" '$(Configuration)|$(Platform)' == 'ReleaseSigned|AnyCPU' "
>
<DebugType>
pdbonly
</DebugType>
<Optimize>
true
</Optimize>
<OutputPath>
bin\ReleaseSigned
</OutputPath>
<IntermediateOutputPath>
obj\ReleaseSigned\
</IntermediateOutputPath>
<DocumentationFile>
$(OutputPath)\$(AssemblyName).xml
</DocumentationFile>
<NoWarn>
</NoWarn>
<DefineConstants>
TRACE;SIGNED
</DefineConstants>
<ErrorReport>
prompt
</ErrorReport>
<WarningLevel>
4
</WarningLevel>
<NoStdLib>
true
</NoStdLib>
<GenerateSerializationAssemblies>
Off
</GenerateSerializationAssemblies>
<SignAssembly>
True
</SignAssembly>
<AssemblyOriginatorKeyFile>
..\..\keys\Google.Protobuf.snk
</AssemblyOriginatorKeyFile>
<TreatWarningsAsErrors>
true
</TreatWarningsAsErrors>
</PropertyGroup>
<ItemGroup>
<Reference
Include=
"mscorlib"
/>
<Reference
Include=
"System"
/>
<Reference
Include=
"System.Xml"
/>
</ItemGroup>
<ItemGroup>
<Compile
Include=
"ByteArray.cs"
/>
<Compile
Include=
"ByteString.cs"
/>
<Compile
Include=
"CodedOutputStream.ComputeSize.cs"
/>
<Compile
Include=
"CodedInputStream.cs"
/>
<Compile
Include=
"CodedOutputStream.cs"
/>
<Compile
Include=
"Collections\MapField.cs"
/>
<Compile
Include=
"Collections\ReadOnlyDictionary.cs"
/>
<Compile
Include=
"Collections\RepeatedField.cs"
/>
<Compile
Include=
"Compatibility\PropertyInfoExtensions.cs"
/>
<Compile
Include=
"Compatibility\TypeExtensions.cs"
/>
<Compile
Include=
"FieldCodec.cs"
/>
<Compile
Include=
"FrameworkPortability.cs"
/>
<Compile
Include=
"ICustomDiagnosticMessage.cs"
/>
<Compile
Include=
"IDeepCloneable.cs"
/>
<Compile
Include=
"InvalidJsonException.cs"
/>
<Compile
Include=
"JsonFormatter.cs"
/>
<Compile
Include=
"JsonParser.cs"
/>
<Compile
Include=
"JsonToken.cs"
/>
<Compile
Include=
"JsonTokenizer.cs"
/>
<Compile
Include=
"MessageExtensions.cs"
/>
<Compile
Include=
"IMessage.cs"
/>
<Compile
Include=
"InvalidProtocolBufferException.cs"
/>
<Compile
Include=
"LimitedInputStream.cs"
/>
<Compile
Include=
"MessageParser.cs"
/>
<Compile
Include=
"Properties\AssemblyInfo.cs"
/>
<Compile
Include=
"Reflection\Descriptor.cs"
/>
<Compile
Include=
"Reflection\DescriptorBase.cs"
/>
<Compile
Include=
"Reflection\DescriptorPool.cs"
/>
<Compile
Include=
"Reflection\DescriptorUtil.cs"
/>
<Compile
Include=
"Reflection\DescriptorValidationException.cs"
/>
<Compile
Include=
"Reflection\EnumDescriptor.cs"
/>
<Compile
Include=
"Reflection\EnumValueDescriptor.cs"
/>
<Compile
Include=
"Reflection\FieldAccessorBase.cs"
/>
<Compile
Include=
"Reflection\FieldDescriptor.cs"
/>
<Compile
Include=
"Reflection\FieldType.cs"
/>
<Compile
Include=
"Reflection\FileDescriptor.cs"
/>
<Compile
Include=
"Reflection\GeneratedClrTypeInfo.cs"
/>
<Compile
Include=
"Reflection\IDescriptor.cs"
/>
<Compile
Include=
"Reflection\IFieldAccessor.cs"
/>
<Compile
Include=
"Reflection\MapFieldAccessor.cs"
/>
<Compile
Include=
"Reflection\MessageDescriptor.cs"
/>
<Compile
Include=
"Reflection\MethodDescriptor.cs"
/>
<Compile
Include=
"Reflection\OneofAccessor.cs"
/>
<Compile
Include=
"Reflection\OneofDescriptor.cs"
/>
<Compile
Include=
"Reflection\OriginalNameAttribute.cs"
/>
<Compile
Include=
"Reflection\PackageDescriptor.cs"
/>
<Compile
Include=
"Reflection\PartialClasses.cs"
/>
<Compile
Include=
"Reflection\ReflectionUtil.cs"
/>
<Compile
Include=
"Reflection\RepeatedFieldAccessor.cs"
/>
<Compile
Include=
"Reflection\ServiceDescriptor.cs"
/>
<Compile
Include=
"Reflection\SingleFieldAccessor.cs"
/>
<Compile
Include=
"ProtoPreconditions.cs"
/>
<Compile
Include=
"Reflection\TypeRegistry.cs"
/>
<Compile
Include=
"WellKnownTypes\Any.cs"
/>
<Compile
Include=
"WellKnownTypes\AnyPartial.cs"
/>
<Compile
Include=
"WellKnownTypes\Api.cs"
/>
<Compile
Include=
"WellKnownTypes\Duration.cs"
/>
<Compile
Include=
"WellKnownTypes\DurationPartial.cs"
/>
<Compile
Include=
"WellKnownTypes\Empty.cs"
/>
<Compile
Include=
"WellKnownTypes\FieldMask.cs"
/>
<Compile
Include=
"WellKnownTypes\FieldMaskPartial.cs"
/>
<Compile
Include=
"WellKnownTypes\SourceContext.cs"
/>
<Compile
Include=
"WellKnownTypes\Struct.cs"
/>
<Compile
Include=
"WellKnownTypes\TimeExtensions.cs"
/>
<Compile
Include=
"WellKnownTypes\Timestamp.cs"
/>
<Compile
Include=
"WellKnownTypes\TimestampPartial.cs"
/>
<Compile
Include=
"WellKnownTypes\Type.cs"
/>
<Compile
Include=
"WellKnownTypes\ValuePartial.cs"
/>
<Compile
Include=
"WellKnownTypes\Wrappers.cs"
/>
<Compile
Include=
"WellKnownTypes\WrappersPartial.cs"
/>
<Compile
Include=
"WireFormat.cs"
/>
</ItemGroup>
<ItemGroup>
<None
Include=
"Google.Protobuf.nuspec"
/>
<None
Include=
"packages.config"
/>
</ItemGroup>
<ItemGroup
/>
<Import
Project=
"$(MSBuildExtensionsPath32)\Microsoft\Portable\$(TargetFrameworkVersion)\Microsoft.Portable.CSharp.targets"
/>
<Import
Project=
"..\packages\NuSpec.ReferenceGenerator.1.4.1\build\portable-net45+win+wpa81+wp80+MonoAndroid10+xamarinios10+MonoTouch10\NuSpec.ReferenceGenerator.targets"
Condition=
"Exists('..\packages\NuSpec.ReferenceGenerator.1.4.1\build\portable-net45+win+wpa81+wp80+MonoAndroid10+xamarinios10+MonoTouch10\NuSpec.ReferenceGenerator.targets')"
/>
<Target
Name=
"EnsureNuGetPackageBuildImports"
BeforeTargets=
"PrepareForBuild"
>
<PropertyGroup>
<ErrorText>
This project references NuGet package(s) that are missing on this computer. Use NuGet Package Restore to download them. For more information, see http://go.microsoft.com/fwlink/?LinkID=322105. The missing file is {0}.
</ErrorText>
</PropertyGroup>
<Error
Condition=
"!Exists('..\packages\NuSpec.ReferenceGenerator.1.4.1\build\portable-net45+win+wpa81+wp80+MonoAndroid10+xamarinios10+MonoTouch10\NuSpec.ReferenceGenerator.targets')"
Text=
"$([System.String]::Format('$(ErrorText)', '..\packages\NuSpec.ReferenceGenerator.1.4.1\build\portable-net45+win+wpa81+wp80+MonoAndroid10+xamarinios10+MonoTouch10\NuSpec.ReferenceGenerator.targets'))"
/>
</Target>
<!-- 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">
</Target>
<Target Name="AfterBuild">
</Target>
-->
</Project>
\ No newline at end of file
csharp/src/Google.Protobuf/Google.Protobuf.nuspec
deleted
100644 → 0
View file @
4e0d0513
<?xml version="1.0" encoding="utf-8"?>
<package>
<metadata>
<id>
Google.Protobuf
</id>
<title>
Google Protocol Buffers C#
</title>
<summary>
C# runtime library for Protocol Buffers - Google's data interchange format.
</summary>
<description>
See project site for more info.
</description>
<version>
3.0.0-beta4
</version>
<authors>
Google Inc.
</authors>
<owners>
protobuf-packages
</owners>
<licenseUrl>
https://github.com/google/protobuf/blob/master/LICENSE
</licenseUrl>
<projectUrl>
https://github.com/google/protobuf
</projectUrl>
<requireLicenseAcceptance>
false
</requireLicenseAcceptance>
<releaseNotes>
C# proto3 support
</releaseNotes>
<copyright>
Copyright 2015, Google Inc.
</copyright>
<tags>
Protocol Buffers Binary Serialization Format Google proto proto3
</tags>
<dependencies>
<!-- Dependencies for older, monolithic-assembly platforms -->
<group
targetFramework=
"net45"
/>
<group
targetFramework=
"wp8"
/>
<group
targetFramework=
"win8"
/>
<group
targetFramework=
"wpa81"
/>
<group
targetFramework=
"xamarin.ios"
/>
<group
targetFramework=
"monotouch"
/>
<group
targetFramework=
"monoandroid"
/>
<!-- Dependencies for newer, more granular platforms (.NET Core etc) -->
<group
targetFramework=
"dotnet"
>
<dependency
id=
"System.Collections"
version=
"4.0.0"
/>
<dependency
id=
"System.Diagnostics.Debug"
version=
"4.0.0"
/>
<dependency
id=
"System.Globalization"
version=
"4.0.0"
/>
<dependency
id=
"System.IO"
version=
"4.0.0"
/>
<dependency
id=
"System.Linq"
version=
"4.0.0"
/>
<dependency
id=
"System.Linq.Expressions"
version=
"4.0.0"
/>
<dependency
id=
"System.ObjectModel"
version=
"4.0.0"
/>
<dependency
id=
"System.Reflection"
version=
"4.0.0"
/>
<dependency
id=
"System.Reflection.Extensions"
version=
"4.0.0"
/>
<dependency
id=
"System.Runtime"
version=
"4.0.0"
/>
<dependency
id=
"System.Runtime.Extensions"
version=
"4.0.0"
/>
<dependency
id=
"System.Text.Encoding"
version=
"4.0.0"
/>
<dependency
id=
"System.Text.RegularExpressions"
version=
"4.0.0"
/>
<dependency
id=
"System.Threading"
version=
"4.0.0"
/>
</group>
</dependencies>
</metadata>
<files>
<file
src=
"bin/ReleaseSigned/Google.Protobuf.dll"
target=
"lib/portable-net45+netcore45+wpa81+wp8"
/>
<file
src=
"bin/ReleaseSigned/Google.Protobuf.pdb"
target=
"lib/portable-net45+netcore45+wpa81+wp8"
/>
<file
src=
"bin/ReleaseSigned/Google.Protobuf.xml"
target=
"lib/portable-net45+netcore45+wpa81+wp8"
/>
<file
src=
"bin/ReleaseSigned/Google.Protobuf.dll"
target=
"lib/dotnet"
/>
<file
src=
"bin/ReleaseSigned/Google.Protobuf.pdb"
target=
"lib/dotnet"
/>
<file
src=
"bin/ReleaseSigned/Google.Protobuf.xml"
target=
"lib/dotnet"
/>
<file
src=
"**\*.cs"
target=
"src"
/>
</files>
</package>
csharp/src/Google.Protobuf/Google.Protobuf.xproj
0 → 100644
View file @
e1f146bc
<?xml version="1.0" encoding="utf-8"?>
<Project
ToolsVersion=
"14.0"
DefaultTargets=
"Build"
xmlns=
"http://schemas.microsoft.com/developer/msbuild/2003"
>
<PropertyGroup>
<VisualStudioVersion
Condition=
"'$(VisualStudioVersion)' == ''"
>
14.0
</VisualStudioVersion>
<VSToolsPath
Condition=
"'$(VSToolsPath)' == ''"
>
$(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v$(VisualStudioVersion)
</VSToolsPath>
</PropertyGroup>
<Import
Project=
"$(VSToolsPath)\DotNet\Microsoft.DotNet.Props"
Condition=
"'$(VSToolsPath)' != ''"
/>
<PropertyGroup
Label=
"Globals"
>
<ProjectGuid>
9b576380-726d-4142-8238-60a43ab0e35a
</ProjectGuid>
<RootNamespace>
Google.Protobuf
</RootNamespace>
<BaseIntermediateOutputPath
Condition=
"'$(BaseIntermediateOutputPath)'=='' "
>
.\obj
</BaseIntermediateOutputPath>
<OutputPath
Condition=
"'$(OutputPath)'=='' "
>
.\bin\
</OutputPath>
</PropertyGroup>
<PropertyGroup>
<SchemaVersion>
2.0
</SchemaVersion>
</PropertyGroup>
<Import
Project=
"$(VSToolsPath)\DotNet\Microsoft.DotNet.targets"
Condition=
"'$(VSToolsPath)' != ''"
/>
</Project>
\ No newline at end of file
csharp/src/Google.Protobuf/Properties/AssemblyInfo.cs
View file @
e1f146bc
...
...
@@ -30,7 +30,6 @@
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#endregion
using
System.Reflection
;
using
System.Runtime.CompilerServices
;
using
System.Security
;
...
...
@@ -38,30 +37,13 @@ using System.Security;
// set of attributes. Change these attribute values to modify the information
// associated with an assembly.
[assembly: AssemblyTitle("Google.Protobuf")]
[assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("")]
[assembly: AssemblyProduct("Google.Protobuf")]
[assembly: AssemblyCopyright("Copyright © 2015")]
[assembly: AssemblyTrademark("")]
[assembly: AssemblyCulture("")]
#if !NCRUNCH
[assembly: AllowPartiallyTrustedCallers]
#endif
#if SIGNED
[
assembly
:
InternalsVisibleTo
(
"Google.Protobuf.Test, PublicKey="
+
"002400000480000094000000060200000024000052534131000400000100010025800fbcfc63a1"
+
"7c66b303aae80b03a6beaa176bb6bef883be436f2a1579edd80ce23edf151a1f4ced97af83abcd"
+
"981207041fd5b2da3b498346fcfcd94910d52f25537c4a43ce3fbe17dc7d43e6cbdb4d8f1242dc"
+
"b6bd9b5906be74da8daa7d7280f97130f318a16c07baf118839b156299a48522f9fae2371c9665"
+
"c5ae9cb6"
)]
#else
[assembly: InternalsVisibleTo("Google.Protobuf.Test")]
#endif
[assembly: AssemblyVersion("3.0.0.0")]
[assembly: AssemblyFileVersion("3.0.0.0")]
[assembly: AssemblyInformationalVersion("3.0.0-beta4")]
csharp/src/Google.Protobuf/packages.config
deleted
100644 → 0
View file @
4e0d0513
<?
xml
version
=
"1.0"
encoding
=
"utf-8"
?>
<
packages
>
<
package
id
=
"NuSpec.ReferenceGenerator"
version
=
"1.4.1"
targetFramework
=
"portable45-net45+win8+wp8+wpa81"
developmentDependency
=
"true"
/>
</
packages
>
\ No newline at end of file
csharp/src/Google.Protobuf/project.json
0 → 100644
View file @
e1f146bc
{
"version"
:
"3.0.0-beta4"
,
"title"
:
"Google Protocol Buffers"
,
"description"
:
"See project site for more info."
,
"authors"
:
[
"Google Inc."
],
"copyright"
:
"Copyright 2015, Google Inc."
,
"packOptions"
:
{
"summary"
:
"C# runtime library for Protocol Buffers - Google's data interchange format."
,
"tags"
:
[
"Protocol"
,
"Buffers"
,
"Binary"
,
"Serialization"
,
"Format"
,
"Google"
,
"proto"
,
"proto3"
],
"owners"
:
[
"protobuf-packages"
],
"licenseUrl"
:
"https://github.com/google/protobuf/blob/master/LICENSE"
,
"projectUrl"
:
"https://github.com/google/protobuf"
,
"releaseNotes"
:
"C# proto3 support"
,
"requireLicenseAcceptance"
:
false
,
"repository"
:
{
"url"
:
"https://github.com/nodatime/nodatime.git"
}
},
"buildOptions"
:
{
"debugType"
:
"portable"
,
"keyFile"
:
"../../keys/Google.Protobuf.snk"
,
"xmlDoc"
:
true
},
"configurations"
:
{
"Debug"
:
{
"buildOptions"
:
{
"define"
:
[
"DEBUG"
,
"TRACE"
]
}
},
"Release"
:
{
"buildOptions"
:
{
"define"
:
[
"RELEASE"
,
"TRACE"
],
"optimize"
:
true
}
}
},
"frameworks"
:
{
//
This
target
allows
the
package
to
be
installed
in
a
.NET
4.5
+
//
project
without
asking
for
myriad
other
dependencies.
"net45"
:
{
},
"netstandard1.0"
:
{
"dependencies"
:
{
"System.Collections"
:
"4.0.11"
,
"System.Diagnostics.Debug"
:
"4.0.11"
,
"System.Globalization"
:
"4.0.11"
,
"System.IO"
:
"4.1.0"
,
"System.Linq"
:
"4.1.0"
,
"System.Linq.Expressions"
:
"4.1.0"
,
"System.ObjectModel"
:
"4.0.12"
,
"System.Reflection"
:
"4.1.0"
,
"System.Reflection.Extensions"
:
"4.0.1"
,
"System.Runtime"
:
"4.1.0"
,
"System.Runtime.Extensions"
:
"4.1.0"
,
"System.Text.Encoding"
:
"4.0.11"
,
"System.Text.RegularExpressions"
:
"4.1.0"
,
"System.Threading"
:
"4.0.11"
}
}
}
}
jenkins/docker/Dockerfile
View file @
e1f146bc
...
...
@@ -23,6 +23,13 @@ run echo "deb http://download.mono-project.com/repo/debian wheezy main" | tee /e
echo
"deb http://download.mono-project.com/repo/debian wheezy-libjpeg62-compat main"
|
tee
-a
/etc/apt/sources.list.d/mono-xamarin.list
&&
\
apt-key adv
--keyserver
keyserver.ubuntu.com
--recv-keys
3FA7E0328081BFF6A14DA29AA6A19B38D3D831EF
# Install dotnet SDK based on https://www.microsoft.com/net/core#debian
# (Ubuntu instructions need apt to support https)
RUN
apt-get update
&&
apt-get
install
-y
curl libunwind8 gettext
&&
\
curl
-sSL
-o
dotnet.tar.gz https://go.microsoft.com/fwlink/?LinkID
=
809130
&&
\
mkdir
-p
/opt/dotnet
&&
tar
zxf dotnet.tar.gz
-C
/opt/dotnet
&&
\
ln
-s
/opt/dotnet/dotnet /usr/local/bin
# Install dependencies. We start with the basic ones require to build protoc
# and the C++ build
RUN
apt-get update
&&
apt-get
install
-y
\
...
...
tests.sh
View file @
e1f146bc
...
...
@@ -57,15 +57,27 @@ build_csharp() {
if
[
"
$TRAVIS
"
==
"true"
]
;
then
# Install latest version of Mono
sudo
apt-key adv
--keyserver
keyserver.ubuntu.com
--recv-keys
3FA7E0328081BFF6A14DA29AA6A19B38D3D831EF
sudo
apt-key adv
--keyserver
keyserver.ubuntu.com
--recv-keys
1397BC53640DB551
echo
"deb http://download.mono-project.com/repo/debian wheezy main"
|
sudo tee
/etc/apt/sources.list.d/mono-xamarin.list
echo
"deb http://download.mono-project.com/repo/debian wheezy-libtiff-compat main"
|
sudo tee
-a
/etc/apt/sources.list.d/mono-xamarin.list
sudo
apt-get update
-qq
sudo
apt-get
install
-qq
mono-devel referenceassemblies-pcl nunit
wget www.nuget.org/NuGet.exe
-O
nuget.exe
NUGET
=
../../nuget.exe
# Then install the dotnet SDK as per Ubuntu 14.04 instructions on dot.net.
sudo
sh
-c
'echo "deb [arch=amd64] https://apt-mo.trafficmanager.net/repos/dotnet/ trusty main" > /etc/apt/sources.list.d/dotnetdev.list'
sudo
apt-key adv
--keyserver
apt-mo.trafficmanager.net
--recv-keys
417A0893
sudo
apt-get update
-qq
sudo
apt-get
install
-qq
dotnet-dev-1.0.0-preview2-003121
fi
(
cd
csharp/src
;
mono
$NUGET
restore
)
# Perform "dotnet new" once to get the setup preprocessing out of the
# way. That spews a lot of output (including backspaces) into logs
# otherwise, and can cause problems. It doesn't matter if this step
# is performed multiple times; it's cheap after the first time anyway.
mkdir
dotnettmp
(
cd
dotnettmp
;
dotnet new
>
/dev/null
)
rm
-rf
dotnettmp
(
cd
csharp/src
;
dotnet restore
)
csharp/buildall.sh
cd
conformance
&&
make test_csharp
&&
cd
..
}
...
...
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