@@ -13,12 +13,12 @@ open Fake.DocFxHelper
1313let configuration = " Release"
1414
1515// Configuration values for tests
16- let testNetFrameworkVersion = " net472"
1716let testNetCoreVersion = " netcoreapp3.1"
17+ let testNetVersion = " net5.0"
1818
1919// Metadata used when signing packages and DLLs
20- let signingName = " My Library "
21- let signingDescription = " My REALLY COOL Library "
20+ let signingName = " Akka.MultiNode.TestAdapter "
21+ let signingDescription = " Akka.NET Multi-node Test Adapter; used for executing tests written with Akka.Remote.TestKit "
2222let signingUrl = " https://signing.is.cool/"
2323
2424// Read release notes and version
@@ -58,19 +58,24 @@ Target "Clean" (fun _ ->
5858 CleanDir outputPerfTests
5959 CleanDir outputNuGet
6060 CleanDir " docs/_site"
61+
62+ CleanDirs !! " ./**/bin"
63+ CleanDirs !! " ./**/obj"
6164)
6265
6366Target " AssemblyInfo" ( fun _ ->
6467 XmlPokeInnerText " ./src/common.props" " //Project/PropertyGroup/VersionPrefix" releaseNotes.AssemblyVersion
6568 XmlPokeInnerText " ./src/common.props" " //Project/PropertyGroup/PackageReleaseNotes" ( releaseNotes.Notes |> String.concat " \n " )
6669)
6770
68- Target " Build" ( fun _ ->
71+ Target " Build" ( fun _ ->
72+ let additionalArgs = if versionSuffix.Length > 0 then [ sprintf " /p:VersionSuffix=%s " versionSuffix] else []
6973 DotNetCli.Build
7074 ( fun p ->
7175 { p with
7276 Project = solutionFile
73- Configuration = configuration }) // "Rebuild"
77+ Configuration = configuration
78+ AdditionalArgs = additionalArgs }) // "Rebuild"
7479)
7580
7681
@@ -96,25 +101,46 @@ module internal ResultHandling =
96101 >> Option.iter ( failBuildWithMessage errorLevel)
97102
98103Target " RunTests" ( fun _ ->
99- let projects =
100- match ( isWindows) with
101- | true -> !! " ./src/**/*.Tests.csproj"
102- | _ -> !! " ./src/**/*.Tests.csproj" // if you need to filter specs for Linux vs. Windows, do it here
104+ let projects = match ( isWindows) with
105+ | true -> !! " ./src/**/*.Tests.*sproj"
106+ | _ -> !! " ./src/**/*.Tests.*sproj" // if you need to filter specs for Linux vs. Windows, do it here
103107
104108 let runSingleProject project =
105109 let arguments =
106- match ( isWindows ) with
107- | true -> ( sprintf " test -c Release --no-build --logger:trx --logger:\" console;verbosity=normal\" --results-directory %s " ( outputTests) )
108- | false -> ( sprintf " test -c Release --no-build --logger:trx --logger:\" console;verbosity=normal\" --results-directory %s --framework %s " outputTests testNetCoreVersion)
110+ match ( hasTeamCity ) with
111+ | true -> ( sprintf " test -c Release --no-build --logger:trx --logger:\" console;verbosity=normal\" --framework %s -- results-directory \" %s \" -- -parallel none -teamcity " testNetCoreVersion outputTests)
112+ | false -> ( sprintf " test -c Release --no-build --logger:trx --logger:\" console;verbosity=normal\" --framework %s --results-directory \" %s \" -- -parallel none " testNetCoreVersion outputTests )
109113
110114 let result = ExecProcess( fun info ->
111115 info.FileName <- " dotnet"
112116 info.WorkingDirectory <- ( Directory.GetParent project) .FullName
113- info.Arguments <- arguments) ( TimeSpan.FromMinutes 30.0 )
114-
115- ResultHandling.failBuildIfXUnitReportedError TestRunnerErrorLevel.Error result
117+ info.Arguments <- arguments) ( TimeSpan.FromMinutes 30.0 )
118+
119+ ResultHandling.failBuildIfXUnitReportedError TestRunnerErrorLevel.Error result
120+
121+ CreateDir outputTests
122+ projects |> Seq.iter ( runSingleProject)
123+ )
124+
125+ Target " RunTestsNet" ( fun _ ->
126+ let projects = match ( isWindows) with
127+ | true -> !! " ./src/**/*.Tests.*sproj"
128+ | _ -> !! " ./src/**/*.Tests.*sproj" // if you need to filter specs for Linux vs. Windows, do it here
129+
130+ let runSingleProject project =
131+ let arguments =
132+ match ( hasTeamCity) with
133+ | true -> ( sprintf " test -c Release --no-build --logger:trx --logger:\" console;verbosity=normal\" --framework %s --results-directory \" %s \" -- -parallel none -teamcity" testNetVersion outputTests)
134+ | false -> ( sprintf " test -c Release --no-build --logger:trx --logger:\" console;verbosity=normal\" --framework %s --results-directory \" %s \" -- -parallel none" testNetVersion outputTests)
135+
136+ let result = ExecProcess( fun info ->
137+ info.FileName <- " dotnet"
138+ info.WorkingDirectory <- ( Directory.GetParent project) .FullName
139+ info.Arguments <- arguments) ( TimeSpan.FromMinutes 30.0 )
116140
117- projects |> Seq.iter ( log)
141+ ResultHandling.failBuildIfXUnitReportedError TestRunnerErrorLevel.Error result
142+
143+ CreateDir outputTests
118144 projects |> Seq.iter ( runSingleProject)
119145)
120146
@@ -201,8 +227,7 @@ Target "CreateNuget" (fun _ ->
201227 let projects = !! " src/**/*.csproj"
202228 -- " src/**/*Tests.csproj" // Don't publish unit tests
203229 -- " src/**/*Tests*.csproj"
204- -- " src/**/*.MultiNode.TestRunner.csproj" // Do not publish MNTR nuget packages
205- -- " src/**/*.MultiNode.TestAdapter.csproj"
230+ -- " src/**/*.MultiNode.TestAdapter.csproj" // Do not publish MNTR nuget packages
206231 -- " src/**/*.MultiNode.NodeRunner.csproj"
207232 -- " src/**/*.MultiNode.Shared.csproj"
208233 -- " src/**/*.MultiNode.TestRunner.Shared.csproj"
@@ -221,14 +246,15 @@ Target "CreateNuget" (fun _ ->
221246)
222247
223248Target " PublishMntr" ( fun _ ->
224- let executableProjects = !! " ./src/**/Akka.MultiNode.TestRunner.csproj" ++ " ./src/**/Akka.MultiNode.TestAdapter.csproj"
225-
249+ let executableProjects = !! " ./src/**/Akka.MultiNode.TestAdapter.csproj"
250+ let additionalArgs = if versionSuffix.Length > 0 then [ sprintf " /p:VersionSuffix=%s " versionSuffix] else []
251+
226252 executableProjects |> Seq.iter ( fun project ->
227253 DotNetCli.Restore
228254 ( fun p ->
229255 { p with
230256 Project = project
231- AdditionalArgs = [ sprintf " /p:VersionSuffix= %s " versionSuffix ] })
257+ AdditionalArgs = additionalArgs })
232258 )
233259
234260 executableProjects |> Seq.iter ( fun project ->
@@ -237,17 +263,16 @@ Target "PublishMntr" (fun _ ->
237263 { p with
238264 Project = project
239265 Configuration = configuration
240- Framework = testNetFrameworkVersion
266+ Framework = testNetCoreVersion
241267 VersionSuffix = versionSuffix }))
242268
243- // Windows .NET Core
244269 executableProjects |> Seq.iter ( fun project ->
245270 DotNetCli.Publish
246271 ( fun p ->
247272 { p with
248273 Project = project
249274 Configuration = configuration
250- Framework = testNetCoreVersion
275+ Framework = testNetVersion
251276 VersionSuffix = versionSuffix }))
252277)
253278
@@ -264,13 +289,11 @@ Target "CreateMntrNuget" (fun _ ->
264289 nuspecPath
265290
266291 let nuspecTemplates = [
267- " ./src/Akka.MultiNode.TestRunner/Akka.MultiNode.TestRunner.nuspec.template" ;
268292 " ./src/Akka.MultiNode.TestAdapter/Akka.MultiNode.TestAdapter.nuspec.template"
269293 ]
270294 let nuspecFiles = List.map ( generateNuspec) nuspecTemplates
271295
272- let executableProjects = !! " ./src/**/Akka.MultiNode.TestRunner.csproj"
273- ++ " ./src/**/Akka.MultiNode.TestAdapter.csproj"
296+ let executableProjects = !! " ./src/**/Akka.MultiNode.TestAdapter.csproj"
274297
275298 executableProjects |> Seq.iter ( fun project ->
276299 DotNetCli.Pack
@@ -368,17 +391,19 @@ Target "Nuget" DoNothing
368391
369392// tests dependencies
370393" Build" ==> " RunTests"
394+ " Build" ==> " RunTestsNet"
371395
372396// nuget dependencies
373397" BuildRelease" ==> " CreateMntrNuget" ==> " CreateNuget"
374398" CreateNuget" ==> " SignPackages" ==> " PublishNuget" ==> " Nuget"
375399
376400// docs
377- " Clean " ==> " BuildRelease" ==> " Docfx"
401+ " BuildRelease" ==> " Docfx"
378402
379403// all
380404" BuildRelease" ==> " All"
381405" RunTests" ==> " All"
406+ " RunTestsNet" ==> " All"
382407" NBench" ==> " All"
383408" Nuget" ==> " All"
384409
0 commit comments