Skip to content

Commit eccf1fd

Browse files
committed
cleanup fake
1 parent 9cd8c83 commit eccf1fd

File tree

1 file changed

+23
-27
lines changed

1 file changed

+23
-27
lines changed

build.fsx

Lines changed: 23 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -219,11 +219,12 @@ Target "GitHubRelease" (fun _ ->
219219
)
220220

221221
// --------------------------------------------------------------------------------------
222-
// .NET CLI and .NET Core
222+
// .NET Core and .NET Core SDK
223223

224-
let isDotnetCliInstalled = (try Shell.Exec("dotnet", "--info") = 0 with _ -> false)
224+
let isDotnetSDKInstalled = (try Shell.Exec("dotnet", "--info") = 0 with _ -> false)
225225
let assertExitCodeZero x = if x = 0 then () else failwithf "Command failed with exit code %i" x
226226
let runCmdIn workDir exe = Printf.ksprintf (fun args -> Shell.Exec(exe, args, workDir) |> assertExitCodeZero)
227+
let run exe = runCmdIn "." exe
227228

228229
Target "DotnetCoreCodeGen" (fun _ ->
229230
let lexArgs = "--lexlib Internal.Utilities.Text.Lexing"
@@ -236,15 +237,15 @@ Target "DotnetCoreCodeGen" (fun _ ->
236237
let open3 = "--open Microsoft.FSharp.Compiler"
237238

238239
// dotnet restore
239-
runCmdIn "." "dotnet" "restore -v Information"
240+
run "dotnet" "restore -v Information"
240241

241242
// run tools
242-
let run exe = runCmdIn "src/fsharp/FSharp.Compiler.Service/" exe
243-
let fsLex fslFilePath outFilePath = run "lib/bootstrap/4.0/fslex.exe" @"%s --unicode %s -o %s" fslFilePath lexArgs outFilePath
244-
let fsYacc = run "lib/bootstrap/4.0/fsyacc.exe"
243+
let runInDir exe = runCmdIn "src/fsharp/FSharp.Compiler.Service/" exe
244+
let fsLex fslFilePath outFilePath = runInDir "lib/bootstrap/4.0/fslex.exe" @"%s --unicode %s -o %s" fslFilePath lexArgs outFilePath
245+
let fsYacc = runInDir "lib/bootstrap/4.0/fsyacc.exe"
245246

246-
run "dotnet" "fssrgen ../FSComp.txt ./FSComp.fs ./FSComp.resx"
247-
run "dotnet" "fssrgen ../fsi/FSIstrings.txt ./FSIstrings.fs ./FSIstrings.resx"
247+
runInDir "dotnet" "fssrgen ../FSComp.txt ./FSComp.fs ./FSComp.resx"
248+
runInDir "dotnet" "fssrgen ../fsi/FSIstrings.txt ./FSIstrings.fs ./FSIstrings.resx"
248249
fsLex "../lex.fsl" "lex.fs"
249250
fsLex "../pplex.fsl" "pplex.fs"
250251
fsLex "../../absil/illex.fsl" "illex.fs"
@@ -253,20 +254,15 @@ Target "DotnetCoreCodeGen" (fun _ ->
253254
fsYacc "../pppars.fsy %s %s %s %s -o pppars.fs" lexArgs yaccArgs module3 open3
254255
)
255256

256-
Target "DotnetCoreBuild" (fun _ ->
257-
let run exe = runCmdIn @"src/fsharp/FSharp.Compiler.Service/" exe
258-
run "dotnet" "-v pack -c Release"
259-
260-
let run exe = runCmdIn @"src/fsharp/FSharp.Compiler.Service.ProjectCracker/" exe
261-
run "dotnet" "-v pack -c Release"
262-
263-
let run exe = runCmdIn @"src/fsharp/FSharp.Compiler.Service.ProjectCrackerTool/" exe
264-
run "dotnet" "-v pack -c Release"
257+
Target "Build.NetCore" (fun _ ->
258+
[ "src/fsharp/FSharp.Compiler.Service/";
259+
"src/fsharp/FSharp.Compiler.Service.ProjectCracker/";
260+
"src/fsharp/FSharp.Compiler.Service.ProjectCrackerTool/" ]
261+
|> List.iter (run "dotnet" "-v pack %s -c Release")
265262
)
266263

267-
Target "DotnetCoreTests" (fun _ ->
268-
let run exe = runCmdIn @"tests/FSharp.Compiler.Service.Tests/" exe
269-
run "dotnet" "-v run -c Release"
264+
Target "RunTests.NetCore" (fun _ ->
265+
runCmdIn "tests/service/" "dotnet" "test --result:TestResults.NetCore.xml;format=nunit3"
270266
)
271267

272268
//use dotnet-mergenupkg to merge the .netcore nuget package into the default one
@@ -275,10 +271,10 @@ let mergePackage packageName netcoreTFM =
275271
let netcoreNupkg = sprintf "src/fsharp/%s/bin/Release/%s/%s.%s.nupkg" packageName netcoreTFM packageName (release.AssemblyVersion)
276272

277273
//dotnet-mergenupkg is in the FSharp.Compiler.Service project.json
278-
let run exe = runCmdIn @"src/fsharp/FSharp.Compiler.Service/" exe
279-
run "dotnet" """mergenupkg --source "%s" --other "%s" --framework %s """ (System.IO.Path.GetFullPath nupkg) (System.IO.Path.GetFullPath netcoreNupkg) netcoreTFM
274+
let runInDir exe = runCmdIn @"src/fsharp/FSharp.Compiler.Service/" exe
275+
runInDir "dotnet" """mergenupkg --source "%s" --other "%s" --framework %s """ (System.IO.Path.GetFullPath nupkg) (System.IO.Path.GetFullPath netcoreNupkg) netcoreTFM
280276

281-
Target "AddDotnetCoreToNupkg" (fun _ ->
277+
Target "Nuget.AddNetCore" (fun _ ->
282278
mergePackage "FSharp.Compiler.Service" "netstandard1.6"
283279
mergePackage "FSharp.Compiler.Service.ProjectCracker" "netstandard1.6"
284280
mergePackage "FSharp.Compiler.Service.ProjectCrackerTool" "netcoreapp1.0"
@@ -298,17 +294,17 @@ Target "Release" DoNothing
298294
==> "GenerateFSIStrings"
299295
==> "Prepare"
300296
==> "Build"
301-
=?> ("DotnetCoreCodeGen", isDotnetCliInstalled)
302-
=?> ("DotnetCoreBuild", isDotnetCliInstalled)
297+
=?> ("DotnetCoreCodeGen", isDotnetSDKInstalled)
298+
=?> ("Build.NetCore", isDotnetSDKInstalled)
303299
==> "RunTests"
304-
=?> ("DotnetCoreTests", isDotnetCliInstalled)
300+
=?> ("RunTests.NetCore", isDotnetSDKInstalled)
305301
==> "All"
306302

307303
"All"
308304
==> "PrepareRelease"
309305
==> "SourceLink"
310306
==> "NuGet"
311-
=?> ("AddDotnetCoreToNupkg", isDotnetCliInstalled)
307+
=?> ("Nuget.AddNetCore", isDotnetSDKInstalled)
312308
==> "GitHubRelease"
313309
==> "PublishNuGet"
314310
==> "Release"

0 commit comments

Comments
 (0)