Skip to content

Commit

Permalink
modify restore command for travis
Browse files Browse the repository at this point in the history
  • Loading branch information
cloudRoutine committed Dec 17, 2017
1 parent b3cd1f9 commit 61feb0d
Show file tree
Hide file tree
Showing 2 changed files with 35 additions and 13 deletions.
46 changes: 34 additions & 12 deletions build.fsx
Original file line number Diff line number Diff line change
Expand Up @@ -93,6 +93,7 @@ open Fake.Core.String
open Fake.Core.Environment
open Fake.DotNet.NuGet.NuGet
open Fake.DotNet.MsBuild
open Fake.Core.Process

Target.Create "UpdateFsxVersions" (fun _ ->
let packages = [ "FSharp.Compiler.Service" ]
Expand All @@ -119,14 +120,33 @@ Target.Create "UpdateFsxVersions" (fun _ ->
let solutionFile = "FSharp.Formatting.sln"


Target.Create "InstallDotNetCore" (fun _ ->
try
(Fake.DotNet.Cli.DotnetInfo (fun _ -> Fake.DotNet.Cli.DotNetInfoOptions.Default)).RID
|> trace
with _ ->
Fake.DotNet.Cli.DotnetCliInstall (fun _ -> Fake.DotNet.Cli.DotNetCliInstallOptions.Default )
Environment.SetEnvironmentVariable("DOTNET_EXE_PATH", Fake.DotNet.Cli.DefaultDotnetCliDir)
)
//Target.Create "InstallDotNetCore" (fun _ ->
// try
// (Fake.DotNet.Cli.DotnetInfo (fun _ -> Fake.DotNet.Cli.DotNetInfoOptions.Default)).RID
// |> trace
// with _ ->
// Fake.DotNet.Cli.DotnetCliInstall (fun _ -> Fake.DotNet.Cli.DotNetCliInstallOptions.Default )
// Environment.SetEnvironmentVariable("DOTNET_EXE_PATH", Fake.DotNet.Cli.DefaultDotnetCliDir)
//)

let assertExitCodeZero x =
if x = 0 then () else
failwithf "Command failed with exit code %i" x

let runCmdIn workDir exe =
Printf.ksprintf (fun args ->
let res =
(ExecProcessAndReturnMessages (fun info ->
{ info with
FileName = exe
Arguments = args
WorkingDirectory = workDir
}) TimeSpan.MaxValue)
res.Messages |> Seq.iter trace
res.ExitCode |> assertExitCodeZero)

/// Execute a dotnet cli command
let dotnet workDir = runCmdIn workDir "dotnet"


let restore proj =
Expand All @@ -137,7 +157,8 @@ let restore proj =
(Dotnet opts (sprintf "restore %s" (Path.getFullName proj))).Messages |> Seq.iter trace

Target.Create "Build" (fun _ ->
restore solutionFile
//restore solutionFile
dotnet "" "restore %s" solutionFile
solutionFile
|> MsBuild.build (fun opts ->
{ opts with
Expand All @@ -160,8 +181,9 @@ Target.Create "Build" (fun _ ->
// Build tests and generate tasks to run the tests in sequence
// --------------------------------------------------------------------------------------
Target.Create"BuildTests" (fun _ ->
let debugBuild sln =
!! sln |> Seq.iter restore
let debugBuild sln =
//!! sln |> Seq.iter restore
!! sln |> Seq.iter (fun s -> dotnet "" "restore %s" s)
!! sln
|> Seq.iter (fun proj ->
proj
Expand Down Expand Up @@ -577,7 +599,7 @@ Target.Create"CreateTestJson" (fun _ ->
open Fake.Core.TargetOperators

"Clean"
==> "InstallDotnetcore"
//==> "InstallDotnetcore"
==> "AssemblyInfo"
==> "CopyFSharpCore"
==> "SetupLibForTests"
Expand Down
2 changes: 1 addition & 1 deletion packages/FSharp.Formatting/FSharp.Formatting.fsx
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ if (typeof<System.Web.Razor.ParserResults>.Assembly.GetName().Version.Major <= 2
#r "../System.ValueTuple/lib/portable-net40+sl4+win8+wp8/System.ValueTuple.dll"

// Standard NuGet locations
//#I "../FSharp.Compiler.Service.13.0.0/lib/net45"
//#I "../FSharp.Compiler.Service.17.0.1/lib/net45"

// Standard Paket locations
#I "../FSharp.Compiler.Service/lib/net45"
Expand Down

0 comments on commit 61feb0d

Please sign in to comment.