Skip to content

Commit

Permalink
Reverting fantomas formatting from build.fsx
Browse files Browse the repository at this point in the history
  • Loading branch information
ivelten authored and xperiandri committed Oct 21, 2022
1 parent 60bce98 commit ce968ce
Showing 1 changed file with 37 additions and 53 deletions.
90 changes: 37 additions & 53 deletions build.fsx
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@
open System.IO
open Fake
open Fake.DotNet
open Fake.DotNet.NuGet
open Fake.IO
open Fake.IO.FileSystemOperators
open Fake.IO.Globbing.Operators
Expand Down Expand Up @@ -54,23 +53,19 @@ let projectRepo = "https://github.com/fsprojects/FSharp.Data.GraphQL.git"
// --------------------------------------------------------------------------------------
// Clean build results

Target.create "Clean"
<| fun _ -> Shell.cleanDirs [ "bin"; "temp" ]
Target.create "Clean" <| fun _ -> Shell.cleanDirs [ "bin"; "temp" ]

Target.create "CleanDocs"
<| fun _ -> Shell.cleanDirs [ "docs/output" ]
Target.create "CleanDocs" <| fun _ -> Shell.cleanDirs [ "docs/output" ]

// --------------------------------------------------------------------------------------
// Build library & test project

Target.create "Restore"
<| fun _ ->
Target.create "Restore" <| fun _ ->
!! "src/**/*.??proj" -- "src/**/*.shproj"
|> Seq.iter (fun pattern -> DotNet.restore id pattern)


Target.create "Build"
<| fun _ ->
Target.create "Build" <| fun _ ->
"FSharp.Data.GraphQL.sln"
|> DotNet.build (fun o ->
{ o with
Expand Down Expand Up @@ -120,8 +115,7 @@ let runTests (project : string) =

let starWarsServerStream = StreamRef.Empty

Target.create "StartStarWarsServer"
<| fun _ ->
Target.create "StartStarWarsServer" <| fun _ ->
Target.activateFinal "StopStarWarsServer"

let project =
Expand All @@ -131,18 +125,15 @@ Target.create "StartStarWarsServer"

startGraphQLServer project starWarsServerStream

Target.createFinal "StopStarWarsServer"
<| fun _ ->
Target.createFinal "StopStarWarsServer" <| fun _ ->
try
starWarsServerStream.Value.Write ([| 0uy |], 0, 1)
with e ->
printfn "%s" e.Message


let integrationServerStream = StreamRef.Empty

Target.create "StartIntegrationServer"
<| fun _ ->
Target.create "StartIntegrationServer" <| fun _ ->
Target.activateFinal "StopIntegrationServer"

let project =
Expand All @@ -152,18 +143,17 @@ Target.create "StartIntegrationServer"

startGraphQLServer project integrationServerStream

Target.createFinal "StopIntegrationServer"
<| fun _ ->
Target.createFinal "StopIntegrationServer" <| fun _ ->
try
integrationServerStream.Value.Write ([| 0uy |], 0, 1)
with e ->
printfn "%s" e.Message

Target.create "RunUnitTests"
<| fun _ -> runTests "tests/FSharp.Data.GraphQL.Tests/FSharp.Data.GraphQL.Tests.fsproj"
Target.create "RunUnitTests" <| fun _ ->
runTests "tests/FSharp.Data.GraphQL.Tests/FSharp.Data.GraphQL.Tests.fsproj"

Target.create "RunIntegrationTests"
<| fun _ -> runTests "tests/FSharp.Data.GraphQL.IntegrationTests/FSharp.Data.GraphQL.IntegrationTests.fsproj"
Target.create "RunIntegrationTests" <| fun _ ->
runTests "tests/FSharp.Data.GraphQL.IntegrationTests/FSharp.Data.GraphQL.IntegrationTests.fsproj"

let prepareDocGen () =
Shell.rm "docs/release-notes.md"
Expand All @@ -176,19 +166,16 @@ let prepareDocGen () =

Shell.cleanDir ".fsdocs"

Target.create "GenerateDocs"
<| fun _ ->
Target.create "GenerateDocs" <| fun _ ->
prepareDocGen ()
DotNet.exec id "fsdocs" "build --clean" |> ignore

Target.create "GenerateDocsWatch"
<| fun _ ->
Target.create "GenerateDocsWatch" <| fun _ ->
prepareDocGen ()
DotNet.exec id "fsdocs" "watch --clean" |> ignore
System.Console.ReadKey () |> ignore

Target.create "ReleaseDocs"
<| fun _ ->
Target.create "ReleaseDocs" <| fun _ ->
Git.Repository.clone "" projectRepo "temp/gh-pages"
Git.Branches.checkoutBranch "temp/gh-pages" "gh-pages"

Expand Down Expand Up @@ -230,26 +217,22 @@ let publishPackage id =
let projectPath = getProjectPath packageName

projectPath
|> DotNet.publish (fun p -> { p with Common = { p.Common with WorkingDirectory = packageDir } })
|> DotNet.publish (fun p ->
{ p with Common = { p.Common with WorkingDirectory = packageDir } })

Target.create "PublishServer"
<| fun _ -> publishPackage "Server"
Target.create "PublishServer" <| fun _ -> publishPackage "Server"

Target.create "PublishClient"
<| fun _ -> publishPackage "Client"
Target.create "PublishClient" <| fun _ -> publishPackage "Client"

Target.create "PublishMiddleware"
<| fun _ -> publishPackage "Server.Middleware"
Target.create "PublishMiddleware" <| fun _ -> publishPackage "Server.Middleware"

Target.create "PublishShared"
<| fun _ -> publishPackage "Shared"
Target.create "PublishShared" <| fun _ -> publishPackage "Shared"

Target.create "PackServer" <| fun _ -> pack "Server"

Target.create "PackClient" <| fun _ -> pack "Client"

Target.create "PackMiddleware"
<| fun _ -> pack "Server.Middleware"
Target.create "PackMiddleware" <| fun _ -> pack "Server.Middleware"

Target.create "PackShared" <| fun _ -> pack "Shared"

Expand All @@ -261,22 +244,23 @@ Target.create "All" ignore
Target.create "PackAll" ignore

"Clean"
==> "Restore"
==> "Build"
==> "RunUnitTests"
==> "StartStarWarsServer"
==> "StartIntegrationServer"
==> "RunIntegrationTests"
==> "All"
=?> ("GenerateDocs", Environment.environVar "APPVEYOR" = "True")

"CleanDocs" ==> "GenerateDocs"
==> "Restore"
==> "Build"
==> "RunUnitTests"
==> "StartStarWarsServer"
==> "StartIntegrationServer"
==> "RunIntegrationTests"
==> "All"
=?> ("GenerateDocs", Environment.environVar "APPVEYOR" = "True")

"CleanDocs"
==> "GenerateDocs"

"PackShared"
==> "PackServer"
==> "PackClient"
==> "PackMiddleware"
==> "PackAll"
==> "PackServer"
==> "PackClient"
==> "PackMiddleware"
==> "PackAll"

Target.runOrDefaultWithArguments "All"

Expand Down

0 comments on commit ce968ce

Please sign in to comment.