@@ -45,13 +45,13 @@ let outputTests = __SOURCE_DIRECTORY__ @@ "TestResults"
45
45
let outputPerfTests = __ SOURCE_ DIRECTORY__ @@ " PerfResults"
46
46
let outputBinaries = output @@ " binaries"
47
47
let outputNuGet = output @@ " nuget"
48
- let outputBinariesNet45 = outputBinaries @@ " net45"
49
- let outputBinariesNetStandard = outputBinaries @@ " netstandard2.0"
50
- let outputBinariesNet = outputBinaries @@ " net5.0"
48
+
49
+ // Configuration values for builds
50
+ let buildNetFrameworkVersion = " net472"
51
+ let buildNetVersion = " netstandard2.1"
51
52
52
53
// Configuration values for tests
53
- let testNetFrameworkVersion = " net471"
54
- let testNetCoreVersion = " netcoreapp3.1"
54
+ let testNetFrameworkVersion = " net472"
55
55
let testNetVersion = " net7.0"
56
56
57
57
Target " Clean" ( fun _ ->
@@ -61,9 +61,6 @@ Target "Clean" (fun _ ->
61
61
CleanDir outputTests
62
62
CleanDir outputPerfTests
63
63
CleanDir outputNuGet
64
- CleanDir outputBinariesNet45
65
- CleanDir outputBinariesNetStandard
66
- CleanDir outputBinariesNet
67
64
CleanDir " docs/_site"
68
65
69
66
CleanDirs !! " ./**/bin"
@@ -85,6 +82,48 @@ Target "Build" (fun _ ->
85
82
AdditionalArgs = additionalArgs }) // "Rebuild"
86
83
)
87
84
85
+ // Build target that only builds netstandard2.1 library and net7.0 test projects
86
+ // Intended for build platforms that does not support .NET Framework (eg. Linux/MAC)
87
+ Target " BuildNet" ( fun _ ->
88
+ let additionalArgs = if versionSuffix.Length > 0 then [ sprintf " /p:VersionSuffix=%s " versionSuffix] else []
89
+
90
+ let projects =
91
+ match ( isWindows) with
92
+ | true -> !! " ./src/**/*.csproj"
93
+ -- " ./src/**/*.Tests.csproj"
94
+ -- " ./src/examples/**/*.csproj"
95
+ | _ -> !! " ./src/**/*.csproj" // if you need to filter specs for Linux vs. Windows, do it here
96
+ -- " ./src/**/*.Tests.csproj"
97
+ -- " ./src/examples/**/*.csproj"
98
+
99
+ let tests =
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
103
+
104
+ let compileSingleProject project =
105
+ DotNetCli.Build
106
+ ( fun p ->
107
+ { p with
108
+ Project = project
109
+ Configuration = configuration
110
+ Framework = buildNetVersion
111
+ AdditionalArgs = additionalArgs }) // "Rebuild"
112
+
113
+ let compileSingleTest project =
114
+ DotNetCli.Build
115
+ ( fun p ->
116
+ { p with
117
+ Project = project
118
+ Configuration = configuration
119
+ Framework = testNetVersion
120
+ AdditionalArgs = additionalArgs }) // "Rebuild"
121
+
122
+ projects |> Seq.iter ( log)
123
+ projects |> Seq.iter ( compileSingleProject)
124
+ tests |> Seq.iter ( log)
125
+ tests |> Seq.iter ( compileSingleTest)
126
+ )
88
127
89
128
//--------------------------------------------------------------------------------
90
129
// Tests targets
@@ -96,7 +135,6 @@ type Runtime =
96
135
97
136
let getTestAssembly runtime project =
98
137
let assemblyPath = match runtime with
99
- | NetCore -> !! ( " src" @@ " **" @@ " bin" @@ " Release" @@ testNetCoreVersion @@ fileNameWithoutExt project + " .dll" )
100
138
| NetFramework -> !! ( " src" @@ " **" @@ " bin" @@ " Release" @@ testNetFrameworkVersion @@ fileNameWithoutExt project + " .dll" )
101
139
| Net -> !! ( " src" @@ " **" @@ " bin" @@ " Release" @@ testNetVersion @@ fileNameWithoutExt project + " .dll" )
102
140
@@ -147,30 +185,6 @@ Target "RunTests" (fun _ ->
147
185
projects |> Seq.iter ( runSingleProject)
148
186
)
149
187
150
- Target " RunTestsNetCore" ( fun _ ->
151
- let projects =
152
- match ( isWindows) with
153
- | true -> !! " ./src/**/*.Tests.csproj"
154
- | _ -> !! " ./src/**/*.Tests.csproj" // if you need to filter specs for Linux vs. Windows, do it here
155
-
156
- let runSingleProject project =
157
- let arguments =
158
- match ( hasTeamCity) with
159
- | true -> ( sprintf " test -c Release --no-build --logger:trx --logger:\" console;verbosity=normal\" --framework %s --results-directory %s -- -parallel none -teamcity" testNetCoreVersion outputTests)
160
- | false -> ( sprintf " test -c Release --no-build --logger:trx --logger:\" console;verbosity=normal\" --framework %s --results-directory %s -- -parallel none" testNetCoreVersion outputTests)
161
-
162
- let result = ExecProcess( fun info ->
163
- info.FileName <- " dotnet"
164
- info.WorkingDirectory <- ( Directory.GetParent project) .FullName
165
- info.Arguments <- arguments) ( TimeSpan.FromMinutes 30.0 )
166
-
167
- ResultHandling.failBuildIfXUnitReportedError TestRunnerErrorLevel.Error result
168
-
169
- CreateDir outputTests
170
- projects |> Seq.iter ( log)
171
- projects |> Seq.iter ( runSingleProject)
172
- )
173
-
174
188
Target " RunTestsNet" ( fun _ ->
175
189
let projects =
176
190
match ( isWindows) with
@@ -380,15 +394,13 @@ Target "BuildRelease" DoNothing
380
394
Target " All" DoNothing
381
395
Target " Nuget" DoNothing
382
396
Target " RunTestsFull" DoNothing
383
- Target " RunTestsNetCoreFull" DoNothing
384
397
385
398
// build dependencies
386
399
" Clean" ==> " AssemblyInfo" ==> " Build" ==> " BuildRelease"
387
400
388
401
// tests dependencies
389
402
" Build" ==> " RunTests"
390
- " Build" ==> " RunTestsNetCore"
391
- " Build" ==> " RunTestsNet"
403
+ " AssemblyInfo" ==> " BuildNet" ==> " RunTestsNet"
392
404
" Build" ==> " NBench"
393
405
394
406
// nuget dependencies
@@ -401,7 +413,6 @@ Target "RunTestsNetCoreFull" DoNothing
401
413
// all
402
414
" BuildRelease" ==> " All"
403
415
" RunTests" ==> " All"
404
- " RunTestsNetCore" ==> " All"
405
416
" RunTestsNet" ==> " All"
406
417
" NBench" ==> " All"
407
418
" Nuget" ==> " All"
0 commit comments