Skip to content

Commit 188e2c8

Browse files
committed
CSHARP-1564: Build and test MongoDB.Driver.Legacy against .NET Core.
1 parent a3ad7ff commit 188e2c8

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

49 files changed

+432
-70
lines changed

CSharpDriver.Dotnet.sln

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,12 @@ Project("{8BB2217D-0F2D-49D1-97BC-3654ED321F3B}") = "MongoDB.Driver.TestHelpers.
3030
EndProject
3131
Project("{8BB2217D-0F2D-49D1-97BC-3654ED321F3B}") = "MongoDB.Driver.Tests.Dotnet", "tests\MongoDB.Driver.Tests.Dotnet\MongoDB.Driver.Tests.Dotnet.xproj", "{0478B209-1898-4AD3-A09D-4275E6B20974}"
3232
EndProject
33+
Project("{8BB2217D-0F2D-49D1-97BC-3654ED321F3B}") = "MongoDB.Driver.Legacy.Dotnet", "src\MongoDB.Driver.Legacy.Dotnet\MongoDB.Driver.Legacy.Dotnet.xproj", "{0A996882-082C-449A-8530-6E6D4CD52BAA}"
34+
EndProject
35+
Project("{8BB2217D-0F2D-49D1-97BC-3654ED321F3B}") = "MongoDB.Driver.Legacy.TestHelpers.Dotnet", "tests\MongoDB.Driver.Legacy.TestHelpers.Dotnet\MongoDB.Driver.Legacy.TestHelpers.Dotnet.xproj", "{7D946D76-6645-4F67-BCAB-198F78FC8B24}"
36+
EndProject
37+
Project("{8BB2217D-0F2D-49D1-97BC-3654ED321F3B}") = "MongoDB.Driver.Legacy.Tests.Dotnet", "tests\MongoDB.Driver.Legacy.Tests.Dotnet\MongoDB.Driver.Legacy.Tests.Dotnet.xproj", "{7586E8E3-687B-4064-B862-DCD307267B65}"
38+
EndProject
3339
Global
3440
GlobalSection(SolutionConfigurationPlatforms) = preSolution
3541
Debug|Any CPU = Debug|Any CPU
@@ -72,6 +78,18 @@ Global
7278
{0478B209-1898-4AD3-A09D-4275E6B20974}.Debug|Any CPU.Build.0 = Debug|Any CPU
7379
{0478B209-1898-4AD3-A09D-4275E6B20974}.Release|Any CPU.ActiveCfg = Release|Any CPU
7480
{0478B209-1898-4AD3-A09D-4275E6B20974}.Release|Any CPU.Build.0 = Release|Any CPU
81+
{0A996882-082C-449A-8530-6E6D4CD52BAA}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
82+
{0A996882-082C-449A-8530-6E6D4CD52BAA}.Debug|Any CPU.Build.0 = Debug|Any CPU
83+
{0A996882-082C-449A-8530-6E6D4CD52BAA}.Release|Any CPU.ActiveCfg = Release|Any CPU
84+
{0A996882-082C-449A-8530-6E6D4CD52BAA}.Release|Any CPU.Build.0 = Release|Any CPU
85+
{7D946D76-6645-4F67-BCAB-198F78FC8B24}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
86+
{7D946D76-6645-4F67-BCAB-198F78FC8B24}.Debug|Any CPU.Build.0 = Debug|Any CPU
87+
{7D946D76-6645-4F67-BCAB-198F78FC8B24}.Release|Any CPU.ActiveCfg = Release|Any CPU
88+
{7D946D76-6645-4F67-BCAB-198F78FC8B24}.Release|Any CPU.Build.0 = Release|Any CPU
89+
{7586E8E3-687B-4064-B862-DCD307267B65}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
90+
{7586E8E3-687B-4064-B862-DCD307267B65}.Debug|Any CPU.Build.0 = Debug|Any CPU
91+
{7586E8E3-687B-4064-B862-DCD307267B65}.Release|Any CPU.ActiveCfg = Release|Any CPU
92+
{7586E8E3-687B-4064-B862-DCD307267B65}.Release|Any CPU.Build.0 = Release|Any CPU
7593
EndGlobalSection
7694
GlobalSection(SolutionProperties) = preSolution
7795
HideSolutionNode = FALSE
@@ -86,5 +104,8 @@ Global
86104
{98B177EC-39FA-4854-BB6A-55CB837767EE} = {CB619CDE-385F-4D7D-8601-A6482943975C}
87105
{4D0C8048-E009-4CE5-9C7F-40A6E5CD8C7F} = {6D163A80-981C-491A-B519-465342D76568}
88106
{0478B209-1898-4AD3-A09D-4275E6B20974} = {6D163A80-981C-491A-B519-465342D76568}
107+
{0A996882-082C-449A-8530-6E6D4CD52BAA} = {CB619CDE-385F-4D7D-8601-A6482943975C}
108+
{7D946D76-6645-4F67-BCAB-198F78FC8B24} = {6D163A80-981C-491A-B519-465342D76568}
109+
{7586E8E3-687B-4064-B862-DCD307267B65} = {6D163A80-981C-491A-B519-465342D76568}
89110
EndGlobalSection
90111
EndGlobal

CSharpDriver.sln

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11

22
Microsoft Visual Studio Solution File, Format Version 12.00
33
# Visual Studio 14
4-
VisualStudioVersion = 14.0.25123.0
4+
VisualStudioVersion = 14.0.25420.1
55
MinimumVisualStudioVersion = 10.0.40219.1
66
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "MongoDB.Bson", "src\MongoDB.Bson\MongoDB.Bson.csproj", "{0E9A3A2A-49CD-4F6C-847C-DC79B4B65CE6}"
77
EndProject
Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
<?xml version="1.0" encoding="utf-8"?>
2+
<Project ToolsVersion="14.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
3+
<PropertyGroup>
4+
<VisualStudioVersion Condition="'$(VisualStudioVersion)' == ''">14.0</VisualStudioVersion>
5+
<VSToolsPath Condition="'$(VSToolsPath)' == ''">$(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v$(VisualStudioVersion)</VSToolsPath>
6+
</PropertyGroup>
7+
8+
<Import Project="$(VSToolsPath)\DotNet\Microsoft.DotNet.Props" Condition="'$(VSToolsPath)' != ''" />
9+
<PropertyGroup Label="Globals">
10+
<ProjectGuid>0a996882-082c-449a-8530-6e6d4cd52baa</ProjectGuid>
11+
<RootNamespace>MongoDB.Driver.Legacy.Dotnet</RootNamespace>
12+
<BaseIntermediateOutputPath Condition="'$(BaseIntermediateOutputPath)'=='' ">.\obj</BaseIntermediateOutputPath>
13+
<OutputPath Condition="'$(OutputPath)'=='' ">.\bin\</OutputPath>
14+
<TargetFrameworkVersion>v4.5.2</TargetFrameworkVersion>
15+
</PropertyGroup>
16+
17+
<PropertyGroup>
18+
<SchemaVersion>2.0</SchemaVersion>
19+
</PropertyGroup>
20+
<Import Project="$(VSToolsPath)\DotNet\Microsoft.DotNet.targets" Condition="'$(VSToolsPath)' != ''" />
21+
</Project>
Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
{
2+
"version": "1.0.0-*",
3+
4+
"dependencies": {
5+
"MongoDB.Bson.Dotnet": "1.0.0-*",
6+
"MongoDB.Driver.Core.Dotnet": "1.0.0-*",
7+
"MongoDB.Driver.Dotnet": "1.0.0-*",
8+
"NETStandard.Library": "1.6.0",
9+
"System.Net.NameResolution": "4.0.0",
10+
"System.Reflection": "4.1.0"
11+
},
12+
13+
"frameworks": {
14+
"netstandard1.6": {
15+
"imports": "dnxcore50",
16+
"buildOptions": {
17+
"compile": {
18+
"include": [ "../MongoDB.Driver.Legacy/**/*.cs", "../MongoDB.Shared/IncrementalMD5.cs" ]
19+
},
20+
"define": [ "DEBUG", "TRACE", "NETSTANDARD16" ]
21+
}
22+
}
23+
}
24+
}

src/MongoDB.Driver.Legacy/Builders/BuilderBase.cs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
/* Copyright 2010-2015 MongoDB Inc.
1+
/* Copyright 2010-2016 MongoDB Inc.
22
*
33
* Licensed under the Apache License, Version 2.0 (the "License");
44
* you may not use this file except in compliance with the License.
@@ -25,7 +25,9 @@ namespace MongoDB.Driver.Builders
2525
/// <summary>
2626
/// Abstract base class for the builders.
2727
/// </summary>
28+
#if NET45
2829
[Serializable]
30+
#endif
2931
[BsonSerializer(typeof(BuilderBase.Serializer))]
3032
public abstract class BuilderBase : IConvertibleToBsonDocument
3133
{

src/MongoDB.Driver.Legacy/Builders/CollectionOptionsBuilder.cs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
/* Copyright 2010-2015 MongoDB Inc.
1+
/* Copyright 2010-2016 MongoDB Inc.
22
*
33
* Licensed under the Apache License, Version 2.0 (the "License");
44
* you may not use this file except in compliance with the License.
@@ -129,7 +129,9 @@ public static CollectionOptionsBuilder SetValidator(IMongoQuery validator)
129129
/// <summary>
130130
/// A builder for the options used when creating a collection.
131131
/// </summary>
132+
#if NET45
132133
[Serializable]
134+
#endif
133135
[BsonSerializer(typeof(CollectionOptionsBuilder.Serializer))]
134136
public class CollectionOptionsBuilder : BuilderBase, IMongoCollectionOptions
135137
{

src/MongoDB.Driver.Legacy/Builders/FieldsBuilder.cs

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
/* Copyright 2010-2015 MongoDB Inc.
1+
/* Copyright 2010-2016 MongoDB Inc.
22
*
33
* Licensed under the Apache License, Version 2.0 (the "License");
44
* you may not use this file except in compliance with the License.
@@ -108,7 +108,9 @@ public static FieldsBuilder Slice(string name, int skip, int limit)
108108
/// <summary>
109109
/// A builder for specifying which fields of a document the server should return.
110110
/// </summary>
111+
#if NET45
111112
[Serializable]
113+
#endif
112114
[BsonSerializer(typeof(FieldsBuilder.Serializer))]
113115
public class FieldsBuilder : BuilderBase, IMongoFields
114116
{
@@ -309,7 +311,9 @@ public static FieldsBuilder<TDocument> Slice<TValue>(Expression<Func<TDocument,
309311
/// A builder for specifying which fields of a document the server should return.
310312
/// </summary>
311313
/// <typeparam name="TDocument">The type of the document.</typeparam>
314+
#if NET45
312315
[Serializable]
316+
#endif
313317
[BsonSerializer(typeof(FieldsBuilder<>.Serializer))]
314318
public class FieldsBuilder<TDocument> : BuilderBase, IMongoFields
315319
{

src/MongoDB.Driver.Legacy/Builders/GeoHaystackSearchOptionsBuilder.cs

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
/* Copyright 2010-2015 MongoDB Inc.
1+
/* Copyright 2010-2016 MongoDB Inc.
22
*
33
* Licensed under the Apache License, Version 2.0 (the "License");
44
* you may not use this file except in compliance with the License.
@@ -74,7 +74,9 @@ public static GeoHaystackSearchOptionsBuilder SetQuery(string additionalFieldNam
7474
/// <summary>
7575
/// A builder for the options of the GeoHaystackSearch command.
7676
/// </summary>
77+
#if NET45
7778
[Serializable]
79+
#endif
7880
[Obsolete("Use GeoHaystackSearchArgs instead.")]
7981
[BsonSerializer(typeof(GeoHaystackSearchOptionsBuilder.Serializer))]
8082
public class GeoHaystackSearchOptionsBuilder : BuilderBase, IMongoGeoHaystackSearchOptions
@@ -199,7 +201,9 @@ public static GeoHaystackSearchOptionsBuilder<TDocument> SetQuery<TMember>(Expre
199201
/// A builder for the options of the GeoHaystackSearch command.
200202
/// </summary>
201203
/// <typeparam name="TDocument">The type of the document.</typeparam>
204+
#if NET45
202205
[Serializable]
206+
#endif
203207
[Obsolete("Use GeoHaystackSearchArgs instead.")]
204208
[BsonSerializer(typeof(GeoHaystackSearchOptionsBuilder<>.Serializer))]
205209
public class GeoHaystackSearchOptionsBuilder<TDocument> : BuilderBase, IMongoGeoHaystackSearchOptions

src/MongoDB.Driver.Legacy/Builders/GeoNearOptionsBuilder.cs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
/* Copyright 2010-2015 MongoDB Inc.
1+
/* Copyright 2010-2016 MongoDB Inc.
22
*
33
* Licensed under the Apache License, Version 2.0 (the "License");
44
* you may not use this file except in compliance with the License.
@@ -71,7 +71,9 @@ public static GeoNearOptionsBuilder SetSpherical(bool value)
7171
/// <summary>
7272
/// A builder for the options of the GeoNear command.
7373
/// </summary>
74+
#if NET45
7475
[Serializable]
76+
#endif
7577
[Obsolete("Use GeoNearArgs instead.")]
7678
[BsonSerializer(typeof(GeoNearOptionsBuilder.Serializer))]
7779
public class GeoNearOptionsBuilder : BuilderBase, IMongoGeoNearOptions

src/MongoDB.Driver.Legacy/Builders/GroupByBuilder.cs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
/* Copyright 2010-2015 MongoDB Inc.
1+
/* Copyright 2010-2016 MongoDB Inc.
22
*
33
* Licensed under the Apache License, Version 2.0 (the "License");
44
* you may not use this file except in compliance with the License.
@@ -54,7 +54,9 @@ public static GroupByBuilder Keys(params string[] names)
5454
/// <summary>
5555
/// A builder for specifying what the GroupBy command should group by.
5656
/// </summary>
57+
#if NET45
5758
[Serializable]
59+
#endif
5860
[BsonSerializer(typeof(GroupByBuilder.Serializer))]
5961
public class GroupByBuilder : BuilderBase, IMongoGroupBy
6062
{

0 commit comments

Comments
 (0)