Skip to content

Commit a3c80e3

Browse files
NickCravermgravell
authored andcommitted
WIP: MyGet Feed and README updates (protobuf-net#576)
* Builds: add protobuf-net MyGet feed as a push target This will make https://www.myget.org/F/protobuf-net/api/v3/index.json light up for all protobuf-net packages once tests are greed and flowing. * README updates for v3 WIP tweaks to README for v3 and exposing packages more readily since there are multiple now. * Exclude VB and CSharp test projects * Examples.csproj cleanup * One more * Skip long running tests in CI This runs everything locally, but not the huge and disruptive ones in Appveyor - just an idea (and happy to revert) /cc @mgravell
1 parent c4f64bb commit a3c80e3

File tree

9 files changed

+61
-70
lines changed

9 files changed

+61
-70
lines changed

README.md

+16-10
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
# protobuf-net
2-
protobuf-net is a contract based serializer for .NET code, that happens to write data in the "protocol buffers" serialization format engineered by Google. The API, however, is very different to Google's, and follows typical .NET patterns (it is broadly comparable, in usage, to XmlSerializer, DataContractSerializer, etc). It should work for most .NET languages that write standard types and can use attributes.
2+
protobuf-net is a contract based serializer for .NET code, that happens to write data in the "protocol buffers" serialization format engineered by Google. The API, however, is very different to Google's, and follows typical .NET patterns (it is broadly comparable, in usage, to `XmlSerializer`, `DataContractSerializer`, etc). It should work for most .NET languages that write standard types and can use attributes.
3+
4+
[![Build status](https://ci.appveyor.com/api/projects/status/1pj6gk7h37bjn200/branch/master?svg=true)](https://ci.appveyor.com/project/StackExchange/protobuf-net/branch/master)
35

46
## Release Notes
57

@@ -10,17 +12,21 @@ To understand how protobuf-net relates to protobuf [see here](https://protobuf-n
1012
---
1113

1214
## Supported Runtimes
13-
- .NET Framework 2.0+
14-
- .NET Standard 1.0+ (note that 1.0 is very restricted, and suits iOS etc; use the highest .NET Standard that works for your platform)
15-
- UAP 10.0(+?)
16-
17-
It is possible to build for more specific TFMs, but *right now* I've simplified the build to those. If you need help
18-
with a custom build: let me know.
15+
- .NET Framework 4.6.1+
16+
- .NET Standard 2.0+
1917

2018
## Runtime Installation
2119

22-
Packages are available on NuGet: [`protobuf-net`](https://www.nuget.org/packages/protobuf-net). You can use the following command in the Package Manager Console:
23-
`Install-Package protobuf-net`
20+
All stable and some pre-release packages are available on NuGet. CI Builds are available via MyGet (feed URL: `https://www.myget.org/F/protobuf-net/api/v3/index.json `).
21+
22+
You can use the following command in the Package Manager Console:
23+
```ps
24+
Install-Package protobuf-net
25+
```
26+
27+
| Package | NuGet Stable | NuGet Pre-release | Downloads | MyGet |
28+
| ------- | ------------ | ----------------- | --------- | ----- |
29+
| [protobuf-net](https://www.nuget.org/packages/protobuf-net/) | [![protobuf-net](https://img.shields.io/nuget/v/protobuf-net.svg)](https://www.nuget.org/packages/protobuf-net/) | [![protobuf-net](https://img.shields.io/nuget/vpre/protobuf-net.svg)](https://www.nuget.org/packages/protobuf-net/) | [![protobuf-net](https://img.shields.io/nuget/dt/protobuf-net.svg)](https://www.nuget.org/packages/protobuf-net/) | [![protobuf-net MyGet](https://img.shields.io/myget/protobuf-net/vpre/protobuf-net.svg)](https://www.myget.org/feed/protobuf-net/package/nuget/protobuf-net) |
2430

2531
## Basic usage
2632

@@ -123,4 +129,4 @@ In v2, everything that can be done with attributes can also be configured at run
123129

124130
## Support
125131

126-
I try to be responsive to [Stack Overflow questions in the `protobuf-net` tag](https://stackoverflow.com/questions/tagged/protobuf-net), [issues logged on github](https://github.com/protobuf-net/protobuf-net), [email](mailto:marc.gravell@gmail.com), etc. I don't currently offer a paid support channel. If I've helped you, feel free to [buy me a coffee](https://buymeacoff.ee/marcgravell).
132+
I try to be responsive to [Stack Overflow questions in the `protobuf-net` tag](https://stackoverflow.com/questions/tagged/protobuf-net), [issues logged on GitHub](https://github.com/protobuf-net/protobuf-net), [email](mailto:marc.gravell@gmail.com), etc. I don't currently offer a paid support channel. If I've helped you, feel free to [buy me a coffee](https://buymeacoff.ee/marcgravell).

appveyor.yml

+8-1
Original file line numberDiff line numberDiff line change
@@ -19,14 +19,21 @@ nuget:
1919

2020
build_script:
2121
- cmd: dotnet build Build.csproj -c Release /p:CI=true /p:GeneratePackageOnBuild=false
22-
- cmd: dotnet test Build.csproj -c Release
22+
- cmd: dotnet test Build.csproj -c Release /p:CI=true
2323
- cmd: dotnet pack Build.csproj --no-build -c Release /p:Packing=true /p:PackageOutputPath=%CD%\.nupkgs /p:CI=true
2424

2525
test: off
2626
artifacts:
2727
- path: .\.nupkgs\*.nupkg
2828

2929
deploy:
30+
- provider: NuGet
31+
server: https://www.myget.org/F/protobuf-net/api/v2
32+
on:
33+
branch: master
34+
api_key:
35+
secure: PV7ERAltWWLhy7AT2h+Vb5c1BM9/WFgvggb+rKyQ8hDg3fYqpZauYdidOOgt2lp4
36+
symbol_server: https://www.myget.org/F/protobuf-net/symbols/api/v2/package
3037
- provider: NuGet
3138
server: https://www.myget.org/F/stackoverflow/api/v2
3239
on:

src/CSharpTest/CSharpTest.csproj

+1
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
<PropertyGroup>
44
<TargetFramework>netcoreapp2.1</TargetFramework>
55
<LangVersion>7.1</LangVersion>
6+
<IsTestProject>false</IsTestProject>
67
</PropertyGroup>
78
<ItemGroup>
89
<ProjectReference Include="../protobuf-net/protobuf-net.csproj" />

src/Examples/DictionaryTests.cs

+3-1
Original file line numberDiff line numberDiff line change
@@ -263,9 +263,9 @@ static void CheckNested<TInner>(IDictionary<string, TInner> data, string message
263263
Assert.Equal(2, inner.Keys.Count); //, message);
264264
Assert.Equal("pqr", inner["mno"]); //, message);
265265
Assert.Equal("vwx", inner["stu"]); //, message);
266-
267266
}
268267

268+
#if LONG_RUNNING
269269
[Fact]
270270
public void CheckPerformanceNotInsanelyBad()
271271
{
@@ -323,6 +323,8 @@ public void CheckPerformanceNotInsanelyBad()
323323
Log.WriteLine("Encoding: " + watch.ElapsedMilliseconds);
324324

325325
}
326+
#endif
327+
326328
const int LOOP = 500000;
327329
static int BulkTest<T>(TypeModel model, T obj, out int serialize, out int deserialize) where T: class
328330
{

src/Examples/Examples.csproj

+21-53
Original file line numberDiff line numberDiff line change
@@ -1,90 +1,58 @@
11
<Project Sdk="Microsoft.NET.Sdk">
2-
32
<PropertyGroup>
43
<GenerateDocumentationFile>false</GenerateDocumentationFile>
54
<TargetFrameworks>net462;netcoreapp3.0</TargetFrameworks>
6-
<LibImport>net</LibImport>
75
<Configurations>Debug;Release;VS</Configurations>
86
<DefineConstants>NO_CODEGEN;NO_WCF;NO_ENYIM</DefineConstants>
7+
<DefineConstants Condition="$(CI) != 'true'">$(DefineConstants);LONG_RUNNING</DefineConstants>
98
<NoWarn>$(NoWarn);IDE0060;IDE0051;IDE0044;IDE0063;IDE0028;IDE0034;IDE1006;IDE0017;IDE0052;xUnit1004</NoWarn>
109
</PropertyGroup>
1110
<PropertyGroup Condition="$(TargetFramework)=='netcoreapp3.0'">
1211
<DefineConstants>$(DefineConstants);FEAT_COMPILER;NO_NHIBERNATE;COREFX;NO_INTERNAL_CONTEXT;PLAT_SPANS</DefineConstants>
13-
<LibImport>core</LibImport>
1412
</PropertyGroup>
1513
<PropertyGroup Condition="$(TargetFramework)=='net462'">
1614
<DefineConstants>$(DefineConstants);FEAT_COMPILER;FX30;NO_INTERNAL_CONTEXT;PLAT_SPANS;EMIT_DLL</DefineConstants>
1715
</PropertyGroup>
1816
<ItemGroup>
19-
<None Include="..\Tools\nwind.proto.bin">
20-
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
21-
</None>
22-
</ItemGroup>
23-
<ItemGroup>
24-
<PackageReference Include="xunit" Version="2.4.1" />
25-
<PackageReference Include="xunit.runner.visualstudio" Version="2.4.1" />
17+
<ProjectReference Include="..\protobuf-net\protobuf-net.csproj" />
18+
<ProjectReference Include="..\protobuf-net.Reflection\protobuf-net.Reflection.csproj" />
2619
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="16.3.0" />
20+
<PackageReference Include="Newtonsoft.Json" Version="12.0.2" />
21+
<PackageReference Include="Pipelines.Sockets.Unofficial" Version="2.0.25" />
22+
<PackageReference Include="System.Collections.Immutable" Version="1.6.0" />
2723
<PackageReference Include="System.ValueTuple" Version="4.5.0" />
24+
<PackageReference Include="xunit" Version="2.4.1" />
25+
<PackageReference Include="xunit.runner.visualstudio" Version="2.4.1" />
2826
</ItemGroup>
2927
<ItemGroup Condition="$(TargetFramework)=='net462'">
3028
<PackageReference Include="NHibernate" Version="4.1.1.4000" />
3129
<PackageReference Include="Iesi.Collections" Version="4.0.4" />
32-
</ItemGroup>
33-
<ItemGroup Condition="'$(LibImport)' == 'net'">
30+
<PackageReference Include="System.Runtime.CompilerServices.Unsafe" Version="4.6.0" />
3431
<Reference Include="Microsoft.CSharp" />
3532
<Reference Include="PresentationCore" />
3633
<Reference Include="System" />
37-
<PackageReference Include="System.Collections.Immutable" Version="1.6.0" />
38-
<Reference Include="System.configuration" />
34+
<Reference Include="System.Configuration" />
35+
<Reference Include="System.Core" />
3936
<Reference Include="System.Data" />
40-
<Reference Include="System.Data.Linq">
41-
<RequiredTargetFramework>3.5</RequiredTargetFramework>
42-
</Reference>
43-
<Reference Include="System.Drawing" />
37+
<Reference Include="System.Data.Linq" />
38+
<Reference Include="System.Runtime.Serialization" />
4439
<Reference Include="System.Runtime.Serialization.Formatters.Soap" />
4540
<Reference Include="System.Web.Extensions" />
46-
<Reference Include="System.Xml" />
47-
<Reference Include="System.Xml.Linq">
48-
<RequiredTargetFramework>3.5</RequiredTargetFramework>
49-
</Reference>
41+
<Reference Include="System.ServiceModel" />
5042
<Reference Include="WindowsBase" />
51-
<Reference Include="System.ServiceModel">
52-
<RequiredTargetFramework>3.0</RequiredTargetFramework>
53-
</Reference>
54-
<Reference Include="System.Runtime.Serialization">
55-
<RequiredTargetFramework>3.0</RequiredTargetFramework>
56-
</Reference>
57-
<Reference Include="System.ServiceModel.Web">
58-
<RequiredTargetFramework>3.5</RequiredTargetFramework>
59-
</Reference>
60-
<Reference Include="System.Core">
61-
<RequiredTargetFramework>3.5</RequiredTargetFramework>
62-
</Reference>
63-
64-
6543
</ItemGroup>
66-
<ItemGroup Condition="'$(LibImport)'=='core'">
67-
<PackageReference Include="System.Collections.NonGeneric" Version="4.3.0" />
68-
<PackageReference Include="System.Threading" Version="4.3.0" />
69-
<PackageReference Include="System.Threading.Thread" Version="4.3.0" />
70-
<PackageReference Include="System.Threading.ThreadPool" Version="4.3.0" />
44+
<ItemGroup Condition="$(TargetFramework)=='netcoreapp3.0'">
45+
<PackageReference Include="System.Configuration.ConfigurationManager" Version="4.6.0" />
46+
<PackageReference Include="System.Data.SqlClient" Version="4.7.0" />
47+
<PackageReference Include="System.Reflection.TypeExtensions" Version="4.6.0" />
7148
<PackageReference Include="System.Runtime.Serialization.Primitives" Version="4.3.0" />
7249
<PackageReference Include="System.Runtime.Serialization.Xml" Version="4.3.0" />
73-
<PackageReference Include="System.Reflection.TypeExtensions" Version="4.6.0" />
74-
<PackageReference Include="System.Data.SqlClient" Version="4.7.0" />
50+
<PackageReference Include="System.Threading.Thread" Version="4.3.0" />
51+
<PackageReference Include="System.Threading.ThreadPool" Version="4.3.0" />
7552
<PackageReference Include="System.Runtime.Serialization.Formatters" Version="4.3.0" />
7653
<PackageReference Include="System.Runtime.Serialization.Primitives" Version="4.3.0" />
77-
<PackageReference Include="System.Configuration.ConfigurationManager" Version="4.6.0" />
78-
<PackageReference Include="Pipelines.Sockets.Unofficial" Version="2.0.25" />
79-
</ItemGroup>
80-
<ItemGroup Condition="$(TargetFramework)=='net462'">
81-
<PackageReference Include="Pipelines.Sockets.Unofficial" Version="2.0.25" />
82-
<PackageReference Include="System.Runtime.CompilerServices.Unsafe" Version="4.6.0" />
8354
</ItemGroup>
8455
<ItemGroup>
85-
<PackageReference Include="System.Collections.Immutable" Version="1.6.0" />
86-
<ProjectReference Include="..\protobuf-net\protobuf-net.csproj" />
87-
<ProjectReference Include="..\protobuf-net.Reflection\protobuf-net.Reflection.csproj" />
88-
<PackageReference Include="Newtonsoft.Json" Version="12.0.2" />
56+
<None Include="..\Tools\nwind.proto.bin" CopyToOutputDirectory="PreserveNewest" />
8957
</ItemGroup>
9058
</Project>

src/Examples/Issues/SO13162642.cs

+3-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
1-
using Xunit;
1+
#if LONG_RUNNING
2+
using Xunit;
23
using ProtoBuf;
34
using System.Collections.Generic;
45
using System.IO;
@@ -69,3 +70,4 @@ class DTO
6970
}
7071
}
7172
}
73+
#endif

src/Examples/Issues/SO7727355.cs

+3-2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
using System;
2-
using System.Data;
1+
#if LONG_RUNNING
2+
using System;
33
using System.IO;
44
using System.Threading;
55
using Xunit;
@@ -94,3 +94,4 @@ private void PistonThread(object state)
9494
}
9595
}
9696
}
97+
#endif

src/Examples/StupidlyComplexModel.cs

+5-2
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ public class StupidlyComplexModel
1313
private ITestOutputHelper Log { get; }
1414
public StupidlyComplexModel(ITestOutputHelper _log) => Log = _log;
1515

16+
#if LONG_RUNNING
1617
[Fact]
1718
public void TimeStupidlyComplexModel()
1819
{
@@ -23,6 +24,7 @@ public void TimeSimpleModel()
2324
{
2425
TimeModel<SimpleModel>(100);
2526
}
27+
#endif
2628

2729
[ProtoContract]
2830
public class SimpleModel
@@ -68,7 +70,7 @@ private void TimeModel<T>(int count, Action<TypeModel, string> test = null)
6870
typeof(T).Name, watch.ElapsedMilliseconds / count, typeCount, watch.ElapsedMilliseconds, count));
6971
}
7072

71-
73+
#if LONG_RUNNING
7274
[Fact]
7375
public void TestStupidlyComplexModel()
7476
{
@@ -84,6 +86,7 @@ public void TestStupidlyComplexModel()
8486
model.Compile("TestStupidlyComplexModel", "TestStupidlyComplexModel.dll");
8587
PEVerify.AssertValid("TestStupidlyComplexModel.dll");
8688
}
89+
#endif
8790

8891
private void Test(TypeModel model, string test)
8992
{
@@ -3329,4 +3332,4 @@ public class Inner799 { [ProtoMember(1)] public int Value { get; set; } }
33293332
public class Inner800 { [ProtoMember(1)] public int Value { get; set; } }
33303333

33313334
}
3332-
}
3335+
}

src/VBTest/VBTest.vbproj

+1
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
<LangVersion>14</LangVersion>
66
<RootNamespace />
77
<NoWarn>IDE1006</NoWarn>
8+
<IsTestProject>false</IsTestProject>
89
</PropertyGroup>
910
<!--
1011
9: ===3.5

0 commit comments

Comments
 (0)