-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathbuild_current.fsx
156 lines (120 loc) · 4.18 KB
/
build_current.fsx
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
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
#r @"packages\FAKE\tools\FakeLib.dll"
#r "paket:
nuget Fake.Core.Target //"
// include Fake modules, see Fake modules section
open Fake.Core
// *** Define Targets ***
Target.create "Clean" (fun _ ->
Trace.log " --- Cleaning stuff --- "
)
Target.create "Build" (fun _ ->
Trace.log " --- Building the app --- "
)
Target.create "Deploy" (fun _ ->
Trace.log " --- Deploying app --- "
)
open Fake.Core.TargetOperators
// *** Define Dependencies ***
"Clean"
==> "Build"
==> "Deploy"
// *** Start Build ***
Target.runOrDefault "Deploy"
//// include Fake lib
//#r @"packages\FAKE\tools\FakeLib.dll"
//open Fake
//open Fake.VersionHelper
//open Fake.DotNet
//open Fake.IO
//open Fake.IO.Globbing.Operators
//open Fake.DotNet
//open Fake.Core
//RestorePackages ()
//// Properties
//let fSharpProjects = "*.fsproj"
//let releaseDir = "bin/Release/"
//let buildDir = "./_build/"
//let testDir = "./_test/"
//let deployDir = "./_deploy/"
//let nugetDeployDir =
// let t = "C:/Nuget.Local/"
// if System.IO.Directory.Exists t then t
// else deployDir
//let version () =
// buildDir + "FeldSparFramework.dll" |> GetAssemblyVersionString
////let build appDir tmpDir targetDir label projecType =
//// let tmpDir = (appDir + tmpDir)
//// tmpDir |> directoryInfo |> (fun d -> d.ToString()) |> CleanDir
//// //let o = !! (appDir + projecType)
//// // |> build tmpDir "Build"
//// // |> Log label
//// FileSystemHelper.directoryInfo tmpDir
//// |> FileSystemHelper.filesInDir
//// |> Array.map (fun fi -> fi.FullName)
//// |> Copy targetDir
//// ()
//// Default target
//Target "Clean" (fun _ ->
// CleanDirs [buildDir; testDir; deployDir; nugetDeployDir]
//)
//Target "BuildApp" (fun _ ->
// build "./FeldSparFramework/" releaseDir buildDir "AppBuild-Output:" fSharpProjects
//)
//Target "BuildTest" (fun _ ->
// !! "./**/*.fsproj"
// |> MSBuild.runRelease testDir "Build"
// |> Log "TestBuild-Output:"
//)
//Target "Test" (fun _ ->
// FileSystemHelper.directoryInfo "./FeldSpar.Tests/" |>
// FileSystemHelper.filesInDir |>
// Array.map(fun fi -> fi.FullName) |>
// Array.filter(fun fi -> fi.Contains("approved")) |>
// Copy testDir
// let result = Shell.Exec (buildDir + "FeldSpar.Console.exe" ,"--v RESULTS --r \".\\RunReport.json\" --a \".\\FeldSpar.Tests.dll\"", ?dir=Some(testDir))
// if result <> 0 then failwith "Failed Tests"
//)
//Target "Zip" (fun _ ->
// !! (buildDir + "/**/*.*")
// |> Zip buildDir (deployDir + "FeldSparFSharp." + (version ()) + ".zip")
//)
//Target "Default" (fun _ ->
// trace "Hello world from FAKE"
//)
//Target "Nuget" (fun _ ->
// Shell.Exec ("nuget", @"pack ..\FeldSparFramework\FeldSpar.Framework.fsproj -IncludeReferencedProjects -Prop Configuration=Release", deployDir) |> ignore
// Shell.Exec ("nuget", @"pack ..\FSharpWpf\FSharpWpf.fsproj -IncludeReferencedProjects -Prop Configuration=Release", deployDir) |> ignore
//)
//Target "LocalDeploy" (fun _ ->
// if deployDir = nugetDeployDir then ()
// else
// FileSystemHelper.directoryInfo deployDir
// |> FileSystemHelper.filesInDir
// |> Array.filter (fun fi -> fi.Extension = ".nupkg")
// |> Array.map (fun fi -> fi.FullName)
// |> Copy nugetDeployDir
// FileSystemHelper.directoryInfo nugetDeployDir
// |> FileSystemHelper.filesInDir
// |> Array.map (fun fi -> fi.FullName)
// |> Array.iter (printfn "LocalDeploy-Output: %s")
// use file = System.IO.File.Create(deployDir + "push.txt")
// let writer = new System.IO.StreamWriter(file)
// FileSystemHelper.directoryInfo nugetDeployDir
// |> FileSystemHelper.filesInDir
// |> Array.filter (fun fi -> fi.Extension = ".nupkg")
// |> Array.map (fun fi -> fi.FullName)
// |> Array.iter (fun name -> writer.WriteLine(sprintf "nuget push %A" name))
// writer.Close()
// printfn "%A" (System.DateTime.Now)
//)
//// Dependencies
//"Clean"
// ==> "BuildApp"
// ==> "BuildTest"
// ==> "Test"
// ==> "Zip"
// ==> "Default"
// ==> "Nuget"
// ==> "LocalDeploy"
//// start build
//RunTargetOrDefault "Default"