-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbuild.fsx
57 lines (48 loc) · 1.61 KB
/
build.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
#r "packages/FAKE/tools/FakeLib.dll"
#load "packages/SourceLink.Fake/tools/SourceLink.fsx"
open System
open System.IO
open Fake
open Fake.AssemblyInfoFile
open SourceLink
let versionAssembly = "1.0.2.0"
let versionFile = "1.0.2.1"
Target "Clean" (fun _ -> !! "**/bin/" ++ "**/obj/" |> CleanDirs)
Target "AssemblyInfo" (fun _ ->
CreateCSharpAssemblyInfo "AssemblyInfoCommon.cs"
[ Attribute.Version versionAssembly
Attribute.FileVersion versionFile ]
)
Target "Build" (fun _ ->
!! "Nuget.Debug.Test/Nuget.Debug.Test.csproj"
|> MSBuildRelease "" "Rebuild" |> ignore
)
Target "SourceLink" (fun _ ->
use repo = new GitRepo(__SOURCE_DIRECTORY__)
[ "Nuget.Debug.Test/Nuget.Debug.Test.csproj" ]
|> Seq.iter (fun pf ->
let proj = VsProj.LoadRelease pf
logfn "source linking %s" proj.OutputFilePdb
let files = (proj.Compiles -- "SolutionInfo.cs").SetBaseDirectory __SOURCE_DIRECTORY__
repo.VerifyChecksums files
proj.VerifyPdbChecksums files
proj.CreateSrcSrv "https://raw.githubusercontent.com/susl/sourcelink-test/{0}/%var2%" repo.Commit (repo.Paths files)
Pdbstr.exec proj.OutputFilePdb proj.OutputFilePdbSrcSrv
)
)
Target "NuGet" (fun _ ->
let bin = "../bin"
Directory.CreateDirectory bin |> ignore
NuGet (fun p ->
{ p with
Version = versionFile
WorkingDir = "Nuget.Debug.Test/bin/Release"
OutputPath = bin
}) "Nuget.Debug.Test/Nuget.Debug.Test.nuspec"
)
"Clean"
// ==> "AssemblyInfo"
==> "Build"
==> "SourceLink"
==> "NuGet"
RunTargetOrDefault "NuGet"