-
Notifications
You must be signed in to change notification settings - Fork 21
/
Copy pathBuild.fs
81 lines (61 loc) · 3.29 KB
/
Build.fs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
open System.IO
open Fake.Core
open Fake.IO
open Fake.IO.FileSystemOperators
open Fake.Core.TargetOperators
open BuildHelpers
open BuildTools
initializeContext()
let clean proj = [ proj </> "bin"; proj </> "obj" ] |> Shell.cleanDirs
let createNuget proj =
clean proj
Tools.dotnet "restore --no-cache" proj
Tools.dotnet "pack -c Release" proj
let publishNuget proj =
createNuget proj
let nugetKey =
match Environment.environVarOrNone "NUGET_KEY" with
| Some nugetKey -> nugetKey
| None -> failwith "The Nuget API key must be set in a NUGET_KEY environmental variable"
let nupkg =
Directory.GetFiles(proj </> "bin" </> "Release")
|> Seq.head
|> Path.GetFullPath
Tools.dotnet (sprintf "nuget push %s -s nuget.org -k %s" nupkg nugetKey) proj
Target.create "PackCosmoStore" (fun _ -> "src" </> "CosmoStore" |> createNuget)
Target.create "PublishCosmoStore" (fun _ -> "src" </> "CosmoStore" |> publishNuget)
Target.create "TestCosmoStore" (fun _ -> Tools.dotnet "run" ("tests" </> "CosmoStore.Tests"))
Target.create "PackTableStorage" (fun _ -> "src" </> "CosmoStore.TableStorage" |> createNuget)
Target.create "PublishTableStorage" (fun _ -> "src" </> "CosmoStore.TableStorage" |> publishNuget)
Target.create "TestTableStorage" (fun _ -> Tools.dotnet "run" ("tests" </> "CosmoStore.TableStorage.Tests"))
Target.create "PackCosmosDb" (fun _ -> "src" </> "CosmoStore.CosmosDb" |> createNuget)
Target.create "PublishCosmosDb" (fun _ -> "src" </> "CosmoStore.CosmosDb" |> publishNuget)
Target.create "TestCosmosDb" (fun _ -> Tools.dotnet "run" ("tests" </> "CosmoStore.CosmosDb.Tests"))
Target.create "PackMarten" (fun _ -> "src" </> "CosmoStore.Marten" |> createNuget)
Target.create "PublishMarten" (fun _ -> "src" </> "CosmoStore.Marten" |> publishNuget)
Target.create "TestMarten" (fun _ -> Tools.dotnet "run" ("tests" </> "CosmoStore.Marten.Tests"))
Target.create "PackInMemory" (fun _ -> "src" </> "CosmoStore.InMemory" |> createNuget)
Target.create "PublishInMemory" (fun _ -> "src" </> "CosmoStore.InMemory" |> publishNuget)
Target.create "TestInMemory" (fun _ -> Tools.dotnet "run" ("tests" </> "CosmoStore.InMemory.Tests"))
Target.create "PackLiteDb" (fun _ -> "src" </> "CosmoStore.LiteDb" |> createNuget)
Target.create "PublishLiteDb" (fun _ -> "src" </> "CosmoStore.LiteDb" |> publishNuget)
Target.create "TestLiteDb" (fun _ -> Tools.dotnet "run" ("tests" </> "CosmoStore.LiteDb.Tests"))
Target.create "PackServiceStack" (fun _ -> "src" </> "CosmoStore.ServiceStack" |> createNuget)
Target.create "PublishServiceStack" (fun _ -> "src" </> "CosmoStore.ServiceStack" |> publishNuget)
Target.create "TestServiceStack" (fun _ -> Tools.dotnet "run" ("tests" </> "CosmoStore.ServiceStack.Tests"))
let dependencies = [
"TestTableStorage" ==> "PackTableStorage"
"TestTableStorage" ==> "PublishTableStorage"
"TestCosmosDb" ==> "PackCosmosDb"
"TestCosmosDb" ==> "PublishCosmosDb"
"TestMarten" ==> "PackMarten"
"TestMarten" ==> "PublishMarten"
"TestInMemory" ==> "PackInMemory"
"TestInMemory" ==> "PublishInMemory"
"TestLiteDb" ==> "PackLiteDb"
"TestLiteDb" ==> "PublishLiteDb"
"TestServiceStack" ==> "PackServiceStack"
"TestServiceStack" ==> "PublishServiceStack"
]
[<EntryPoint>]
let main args = runOrDefault "TestCosmoStore" args