@@ -219,52 +219,64 @@ 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 )
225225let assertExitCodeZero x = if x = 0 then () else failwithf " Command failed with exit code %i " x
226-
227- Target " DotnetCliCodeGen" ( fun _ ->
228- let fsLex = @" lib/bootstrap/4.0/fslex.exe"
229- let fsYacc = @" lib/bootstrap/4.0/fsyacc.exe"
230- let lexArgs = @" --lexlib Internal.Utilities.Text.Lexing"
231- let yaccArgs = @" --internal --parslib Internal.Utilities.Text.Parsing"
232- let module1 = @" --module Microsoft.FSharp.Compiler.AbstractIL.Internal.AsciiParser"
233- let module2 = @" --module Microsoft.FSharp.Compiler.Parser"
234- let module3 = @" --module Microsoft.FSharp.Compiler.PPParser"
235- let open1 = @" --open Microsoft.FSharp.Compiler.AbstractIL"
236- let open2 = @" --open Microsoft.FSharp.Compiler"
237- let open3 = @" --open Microsoft.FSharp.Compiler"
238-
239- // restore tools
240- let workDir = @" src/fsharp/FSharp.Compiler.Service.netcore/"
241- Shell.Exec( " dotnet" , " restore -v Minimal" , workDir) |> assertExitCodeZero
226+ let runCmdIn workDir exe = Printf.ksprintf ( fun args -> Shell.Exec( exe, args, workDir) |> assertExitCodeZero)
227+ let run exe = runCmdIn " ." exe
228+
229+ Target " DotnetCoreCodeGen" ( fun _ ->
230+ let lexArgs = " --lexlib Internal.Utilities.Text.Lexing"
231+ let yaccArgs = " --internal --parslib Internal.Utilities.Text.Parsing"
232+ let module1 = " --module Microsoft.FSharp.Compiler.AbstractIL.Internal.AsciiParser"
233+ let module2 = " --module Microsoft.FSharp.Compiler.Parser"
234+ let module3 = " --module Microsoft.FSharp.Compiler.PPParser"
235+ let open1 = " --open Microsoft.FSharp.Compiler.AbstractIL"
236+ let open2 = " --open Microsoft.FSharp.Compiler"
237+ let open3 = " --open Microsoft.FSharp.Compiler"
238+
239+ // dotnet restore
240+ run " dotnet" " restore -v Information"
242241
243242 // run tools
244- Shell.Exec( " dotnet" , " fssrgen ../FSComp.txt ./FSComp.fs ./FSComp.resx" , workDir) |> assertExitCodeZero
245- Shell.Exec( " dotnet" , " fssrgen ../fsi/FSIstrings.txt ./FSIstrings.fs ./FSIstrings.resx" , workDir) |> assertExitCodeZero
246- Shell.Exec( fsLex, @" ../lex.fsl --unicode" + lexArgs + " -o lex.fs" , workDir) |> assertExitCodeZero
247- Shell.Exec( fsLex, @" ../pplex.fsl --unicode" + lexArgs + " -o pplex.fs" , workDir) |> assertExitCodeZero
248- Shell.Exec( fsLex, @" ../../absil/illex.fsl --unicode" + lexArgs + " -o illex.fs" , workDir) |> assertExitCodeZero
249- Shell.Exec( fsYacc, @" ../../absil/ilpars.fsy" + lexArgs + yaccArgs + module1 + open1 + " -o ilpars.fs" , workDir) |> assertExitCodeZero
250- Shell.Exec( fsYacc, @" ../pars.fsy" + lexArgs + yaccArgs + module2 + open2 + " -o pars.fs" , workDir) |> assertExitCodeZero
251- Shell.Exec( fsYacc, @" ../pppars.fsy" + lexArgs + yaccArgs + module3 + open3 + " -o pppars.fs" , workDir) |> assertExitCodeZero
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"
246+
247+ runInDir " dotnet" " fssrgen ../FSComp.txt ./FSComp.fs ./FSComp.resx"
248+ runInDir " dotnet" " fssrgen ../fsi/FSIstrings.txt ./FSIstrings.fs ./FSIstrings.resx"
249+ fsLex " ../lex.fsl" " lex.fs"
250+ fsLex " ../pplex.fsl" " pplex.fs"
251+ fsLex " ../../absil/illex.fsl" " illex.fs"
252+ fsYacc " ../../absil/ilpars.fsy %s %s %s %s -o ilpars.fs" lexArgs yaccArgs module1 open1
253+ fsYacc " ../pars.fsy %s %s %s %s -o pars.fs" lexArgs yaccArgs module2 open2
254+ fsYacc " ../pppars.fsy %s %s %s %s -o pppars.fs" lexArgs yaccArgs module3 open3
252255)
253256
254- Target " DotnetCliBuild" ( fun _ ->
255- let workDir = @" src/fsharp/FSharp.Compiler.Service.netcore/"
256- Shell.Exec( " dotnet" , " restore -v Information" , workDir) |> assertExitCodeZero
257- Shell.Exec( " dotnet" , " -v pack -c Release -o ../../../" + buildDir, workDir) |> assertExitCodeZero
258-
259- let workDir = @" src/fsharp/FSharp.Compiler.Service.ProjectCracker.netcore/"
260- Shell.Exec( " dotnet" , " restore -v Information" , workDir) |> assertExitCodeZero
261- Shell.Exec( " dotnet" , " -v pack -c Release -o ../../../" + buildDir, workDir) |> assertExitCodeZero
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" )
262262)
263263
264- Target " DotnetCliTests" ( fun _ ->
265- let workDir = @" tests/FSharp.Compiler.Service.Tests.netcore/"
266- Shell.Exec( " dotnet" , " restore -v Information" , workDir) |> assertExitCodeZero
267- Shell.Exec( " dotnet" , " -v run -c Release" , workDir) |> assertExitCodeZero
264+ Target " RunTests.NetCore" ( fun _ ->
265+ runCmdIn " tests/service/" " dotnet" " test -c Release --result:TestResults.NetCore.xml;format=nunit3"
266+ )
267+
268+
269+ //use dotnet-mergenupkg to merge the .netcore nuget package into the default one
270+ Target " Nuget.AddNetCore" ( fun _ ->
271+ do
272+ let nupkg = sprintf " ../../../%s /FSharp.Compiler.Service.%s .nupkg" buildDir ( release.AssemblyVersion)
273+ let netcoreNupkg = sprintf " bin/Release/FSharp.Compiler.Service.%s .nupkg" ( release.AssemblyVersion)
274+ runCmdIn " src/fsharp/FSharp.Compiler.Service" " dotnet" " mergenupkg --source %s --other %s --framework netstandard1.6" nupkg netcoreNupkg
275+
276+ do
277+ let nupkg = sprintf " ../../../%s /FSharp.Compiler.Service.ProjectCracker.%s .nupkg" buildDir ( release.AssemblyVersion)
278+ let netcoreNupkg = sprintf " bin/Release/FSharp.Compiler.Service.ProjectCracker.%s .nupkg" ( release.AssemblyVersion)
279+ runCmdIn " src/fsharp/FSharp.Compiler.Service.ProjectCracker" " dotnet" " mergenupkg --source %s --other %s --framework netstandard1.6" nupkg netcoreNupkg
268280)
269281
270282// --------------------------------------------------------------------------------------
@@ -274,26 +286,26 @@ Target "Prepare" DoNothing
274286Target " PrepareRelease" DoNothing
275287Target " All" DoNothing
276288Target " Release" DoNothing
277- Target " DotnetCli" DoNothing
278-
279- " DotnetCli"
280- =?> ( " DotnetCliCodeGen" , isDotnetCliInstalled)
281- =?> ( " DotnetCliBuild" , isDotnetCliInstalled)
282- =?> ( " DotnetCliTests" , isDotnetCliInstalled)
289+ Target " CreatePackage" DoNothing
283290
284291" Clean"
285292 =?> ( " BuildVersion" , isAppVeyorBuild)
286293 ==> " AssemblyInfo"
287294 ==> " GenerateFSIStrings"
288295 ==> " Prepare"
289296 ==> " Build"
297+ =?> ( " DotnetCoreCodeGen" , isDotnetSDKInstalled)
298+ =?> ( " Build.NetCore" , isDotnetSDKInstalled)
290299 ==> " RunTests"
300+ =?> ( " RunTests.NetCore" , isDotnetSDKInstalled)
291301 ==> " All"
292302
293303" All"
294304 ==> " PrepareRelease"
295305 ==> " SourceLink"
296306 ==> " NuGet"
307+ =?> ( " Nuget.AddNetCore" , isDotnetSDKInstalled)
308+ ==> " CreatePackage"
297309 ==> " GitHubRelease"
298310 ==> " PublishNuGet"
299311 ==> " Release"
0 commit comments