@@ -25,82 +25,14 @@ var artifactsPackagesDirectory = artifactsDirectory.Combine("packages");
2525var srcDirectory = solutionDirectory . Combine ( "src" ) ;
2626var testsDirectory = solutionDirectory . Combine ( "tests" ) ;
2727var outputDirectory = solutionDirectory . Combine ( "build" ) ;
28- var toolsDirectory = solutionDirectory . Combine ( "tools" ) ;
29- var toolsHugoDirectory = toolsDirectory . Combine ( "Hugo" ) ;
30- var mongoDbDriverPackageName = "MongoDB.Driver" ;
3128
3229var solutionFile = solutionDirectory . CombineWithFilePath ( "CSharpDriver.sln" ) ;
3330var solutionFullPath = solutionFile . FullPath ;
3431
3532Task( "Default" )
3633 . IsDependentOn ( "Test" ) ;
3734
38- Task( "Release" )
39- . IsDependentOn ( "Build" )
40- . IsDependentOn ( "Package" ) ;
41-
42- Task( "Restore" )
43- . Does ( ( ) =>
44- {
45- // disable parallel restore to work around apparent bugs in restore
46- var restoreSettings = new DotNetRestoreSettings
47- {
48- DisableParallel = true
49- } ;
50- DotNetRestore ( solutionFullPath , restoreSettings ) ;
51- } ) ;
52-
53- Task( "Build" )
54- . IsDependentOn ( "Restore" )
55- . Does < BuildConfig > ( ( buildConfig ) =>
56- {
57- var settings = new DotNetBuildSettings
58- {
59- NoRestore = true ,
60- Configuration = configuration ,
61- EnvironmentVariables = new Dictionary < string , string >
62- {
63- { "Version" , gitVersion . LegacySemVer } ,
64- { "SourceRevisionId" , gitVersion . Sha }
65- }
66- } ;
67-
68- DotNetBuild ( solutionFullPath , settings ) ;
69- } ) ;
70-
71- Task( "BuildArtifacts" )
72- . IsDependentOn ( "Build" )
73- . Does ( ( ) =>
74- {
75- foreach ( var targetFramework in new [ ] { "net472" , "netstandard2.0" , "netstandard2.1" } )
76- {
77- var toDirectory = artifactsBinDirectory . Combine ( targetFramework ) ;
78- CleanDirectory ( toDirectory ) ;
79-
80- var projects = new [ ] { "MongoDB.Bson" , "MongoDB.Driver" } ;
81- foreach ( var project in projects )
82- {
83- var fromDirectory = srcDirectory . Combine ( project ) . Combine ( "bin" ) . Combine ( configuration ) . Combine ( targetFramework ) ;
84-
85- var fileNames = new List < string > ( ) ;
86- foreach ( var extension in new [ ] { "dll" , "pdb" , "xml" } )
87- {
88- var fileName = $ "{ project } .{ extension } ";
89- fileNames . Add ( fileName ) ;
90- }
91-
92- foreach ( var fileName in fileNames )
93- {
94- var fromFile = fromDirectory . CombineWithFilePath ( fileName ) ;
95- var toFile = toDirectory . CombineWithFilePath ( fileName ) ;
96- CopyFile ( fromFile , toFile ) ;
97- }
98- }
99- }
100- } ) ;
101-
10235Task( "Test" )
103- . IsDependentOn ( "Build" )
10436 . DoesForEach (
10537 items : GetFiles ( "./**/*.Tests.csproj" ) . Where ( name => ! name . ToString ( ) . Contains ( "Atlas" ) ) ,
10638 action : ( BuildConfig buildConfig , Path testProject ) =>
@@ -121,68 +53,58 @@ Task("Test")
12153 . DeferOnError ( ) ;
12254
12355Task( "TestAwsAuthentication" )
124- . IsDependentOn ( "Build" )
12556 . DoesForEach (
12657 items : GetFiles ( "./**/MongoDB.Driver.Tests.csproj" ) ,
12758 action : ( BuildConfig buildConfig , Path testProject ) =>
12859 RunTests ( buildConfig , testProject , filter : "Category=\" AwsMechanism\" " ) ) ;
12960
13061Task( "TestPlainAuthentication" )
131- . IsDependentOn ( "Build" )
13262 . DoesForEach (
13363 items : GetFiles ( "./**/MongoDB.Driver.Tests.csproj" ) ,
13464 action : ( BuildConfig buildConfig , Path testProject ) =>
13565 RunTests ( buildConfig , testProject , filter : "Category=\" PlainMechanism\" " ) ) ;
13666
13767Task( "TestAtlasConnectivity" )
138- . IsDependentOn ( "Build" )
13968 . DoesForEach (
14069 items : GetFiles ( "./**/AtlasConnectivity.Tests.csproj" ) ,
14170 action : ( BuildConfig buildConfig , Path testProject ) => RunTests ( buildConfig , testProject ) ) ;
14271
14372Task( "TestAtlasSearch" )
144- . IsDependentOn ( "Build" )
14573 . DoesForEach (
14674 items : GetFiles ( "./**/MongoDB.Driver.Tests.csproj" ) ,
14775 action : ( BuildConfig buildConfig , Path testProject ) =>
14876 RunTests ( buildConfig , testProject , filter : "Category=\" AtlasSearch\" " ) ) ;
14977
15078Task( "TestAtlasSearchIndexHelpers" )
151- . IsDependentOn ( "Build" )
15279 . DoesForEach (
15380 items : GetFiles ( "./**/MongoDB.Driver.Tests.csproj" ) ,
15481 action : ( BuildConfig buildConfig , Path testProject ) =>
15582 RunTests ( buildConfig , testProject , filter : "Category=\" AtlasSearchIndexHelpers\" " ) ) ;
15683
15784Task( "TestOcsp" )
158- . IsDependentOn ( "Build" )
15985 . DoesForEach (
16086 items : GetFiles ( "./**/MongoDB.Driver.Tests.csproj" ) ,
16187 action : ( BuildConfig buildConfig , Path testProject ) =>
16288 RunTests ( buildConfig , testProject , filter : "Category=\" OCSP\" " ) ) ;
16389
16490Task( "TestGssapi" )
165- . IsDependentOn ( "Build" )
16691 . DoesForEach (
16792 items : GetFiles ( "./**/MongoDB.Driver.Tests.csproj" ) ,
16893 action : ( BuildConfig buildConfig , Path testProject ) =>
16994 RunTests ( buildConfig , testProject , filter : "Category=\" GssapiMechanism\" " ) ) ;
17095
17196Task( "TestMongoDbOidc" )
172- . IsDependentOn ( "Build" )
17397 . DoesForEach (
17498 items : GetFiles ( "./**/MongoDB.Driver.Tests.csproj" ) ,
17599 action : ( BuildConfig buildConfig , Path testProject ) =>
176100 RunTests ( buildConfig , testProject , filter : "Category=\" MongoDbOidc\" " ) ) ;
177101
178102Task( "TestLibMongoCrypt" )
179- . IsDependentOn ( "Build" )
180103 . DoesForEach (
181104 items : GetFiles ( "./**/MongoDB.Driver.Encryption.Tests.csproj" ) ,
182105 action : ( BuildConfig buildConfig , Path testProject ) => RunTests ( buildConfig , testProject ) ) ;
183106
184107Task( "TestLoadBalanced" )
185- . IsDependentOn ( "Build" )
186108 . DoesForEach (
187109 items : GetFiles ( "./**/*.Tests.csproj" ) ,
188110 action : ( BuildConfig buildConfig , Path testProject ) =>
@@ -217,91 +139,17 @@ Task("TestCsfleWithGcpKms")
217139 RunTests ( buildConfig , testProject , filter : "Category=\" CsfleGCPKMS\" " ) ) ;
218140
219141Task( "TestX509" )
220- . IsDependentOn ( "Build" )
221142 . DoesForEach (
222143 items : GetFiles ( "./**/MongoDB.Driver.Tests.csproj" ) ,
223144 action : ( BuildConfig buildConfig , Path testProject ) =>
224145 RunTests ( buildConfig , testProject , filter : "Category=\" X509\" " ) ) ;
225146
226147Task( "TestSocks5Proxy" )
227- . IsDependentOn ( "Build" )
228148 . DoesForEach (
229149 items : GetFiles ( "./**/*.Tests.csproj" ) ,
230150 action : ( BuildConfig buildConfig , Path testProject ) =>
231151 RunTests ( buildConfig , testProject , filter : "Category=\" Socks5Proxy\" " ) ) ;
232152
233- Task( "Package" )
234- . IsDependentOn ( "PackageNugetPackages" ) ;
235-
236- Task( "PackageNugetPackages" )
237- . IsDependentOn ( "Build" )
238- . Does < BuildConfig > ( ( buildConfig ) =>
239- {
240- EnsureDirectoryExists ( artifactsPackagesDirectory ) ;
241- CleanDirectory ( artifactsPackagesDirectory ) ;
242-
243- var projects = new [ ]
244- {
245- "MongoDB.Bson" ,
246- "MongoDB.Driver" ,
247- "MongoDB.Driver.Encryption"
248- } ;
249-
250- foreach ( var project in projects )
251- {
252- var projectPath = $ "{ srcDirectory } \\ { project } \\ { project } .csproj";
253- var settings = new DotNetPackSettings
254- {
255- Configuration = configuration ,
256- OutputDirectory = artifactsPackagesDirectory ,
257- NoBuild = true , // SetContinuousIntegrationBuild is enabled for nupkg on the Build step
258- IncludeSymbols = true ,
259- MSBuildSettings = new DotNetMSBuildSettings ( )
260- // configure deterministic build for better compatibility with debug symbols (used in Package/Build tasks). Affects: *.snupkg
261- . SetContinuousIntegrationBuild ( continuousIntegrationBuild : true )
262- . WithProperty ( "PackageVersion" , buildConfig . PackageVersion )
263- } ;
264- DotNetPack ( projectPath , settings ) ;
265- }
266- } ) ;
267-
268- Task( "PushToNuGet" )
269- . Does ( ( ) =>
270- {
271- var nugetApiKey = EnvironmentVariable ( "NUGETAPIKEY" ) ;
272- if ( nugetApiKey == null )
273- {
274- throw new Exception ( "NUGETAPIKEY environment variable missing" ) ;
275- }
276-
277- var packageFiles = new List < FilePath > ( ) ;
278-
279- var projects = new [ ]
280- {
281- "MongoDB.Bson" ,
282- "MongoDB.Driver"
283- } ;
284-
285- foreach ( var project in projects )
286- {
287- var packageFileName = $ "{ project } .{ gitVersion . LegacySemVer } .nupkg";
288- var packageFile = artifactsPackagesDirectory . CombineWithFilePath ( packageFileName ) ;
289- packageFiles . Add ( packageFile ) ;
290- }
291-
292- NuGetPush ( packageFiles , new NuGetPushSettings
293- {
294- ApiKey = nugetApiKey ,
295- Source = "https://api.nuget.org/v3/index.json"
296- } ) ;
297- } ) ;
298-
299- Task( "DumpGitVersion" )
300- . Does ( ( ) =>
301- {
302- Information ( gitVersion . Dump ( ) ) ;
303- } ) ;
304-
305153Task( "SmokeTests" )
306154 . DoesForEach (
307155 GetFiles ( "./**/SmokeTests/**/*.SmokeTests*.csproj" ) ,
0 commit comments