-
Notifications
You must be signed in to change notification settings - Fork 1
/
Build.fs
45 lines (36 loc) · 1.16 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
open Fake
open Fake.Core
open Fake.IO
open Fake.IO.FileSystemOperators
open System.IO.Compression
open BuildHelpers
initializeContext()
module Paths =
let private publishDir = Path.getFullName "publish"
let private srcDir = Path.getFullName "src"
let projectSrc = srcDir </> "Funcaster"
let projectPublish = publishDir </> "Funcaster"
// Targets
let clean proj = [ proj </> "bin"; proj </> "obj" ] |> Shell.cleanDirs
let ensureDevFilesDeleted proj =
[
proj </> "appsettings.development.json"
proj </> "local.settings.json"
] |> File.deleteAll
let publish srcDir publishDir =
clean srcDir
publishDir |> Directory.delete
Tools.dotnet $"publish -c Release -o \"%s{publishDir}\"" srcDir
publishDir |> ensureDevFilesDeleted
Target.create "Run" (fun _ ->
Tools.dotnet "watch msbuild /t:RunFunctions" Paths.projectSrc
)
Target.create "Publish" (fun _ ->
publish Paths.projectSrc Paths.projectPublish
let zipFile = Paths.projectPublish + ".zip"
File.delete zipFile
ZipFile.CreateFromDirectory(Paths.projectPublish, zipFile)
)
let dependencies = [] // For future use
[<EntryPoint>]
let main args = runOrDefault args