forked from Kevin-Bronsdijk/gtmetrix-net
-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.fsx
99 lines (78 loc) · 3.31 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
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
// --------------------------------------------------------------------------------------
// FAKE build script
// --------------------------------------------------------------------------------------
#r @"tools\FAKE\tools\FakeLib.dll"
open Fake
open Fake.AssemblyInfoFile
// --------------------------------------------------------------------------------------
// Information about the project to be used at NuGet and in AssemblyInfo files
// --------------------------------------------------------------------------------------
let project = "gtmetrix-net"
let authors = ["Kevin Bronsdijk"]
let summary = "GTmetrix-net .Net client"
let version = getBuildParam "version"
let description = "The GTmetrix-net .Net client interacts with the GTmetrix.com REST API allowing you to utilize GTmetrixs features using a .NET interface."
let notes = "Net 4.5 support added. For more information and documentation, please visit the project site on GitHub."
let nugetVersion = getBuildParam "version"
let tags = "gtmetrix.com gtmetrix C# API web optimization"
let gitHome = "https://github.com/kevin-bronsdijk"
let gitName = "gtmetrix-net"
// --------------------------------------------------------------------------------------
// Build script
// --------------------------------------------------------------------------------------
let buildDir = "./output/"
let packagingOutputPath = "./nuGet/"
let packagingWorkingDir = "./inputNuget/"
let nugetDependencies = getDependencies "./src/gtmetrix-net/packages.config"
// --------------------------------------------------------------------------------------
Target "Clean" (fun _ ->
CleanDir buildDir
)
// --------------------------------------------------------------------------------------
Target "AssemblyInfo" (fun _ ->
let attributes =
[
Attribute.Title project
Attribute.Product project
Attribute.Description summary
Attribute.Version version
Attribute.FileVersion version
]
CreateCSharpAssemblyInfo "src/gtmetrix-net/Properties/AssemblyInfo.cs" attributes
)
// --------------------------------------------------------------------------------------
Target "Build" (fun _ ->
!! "src/*.sln"
|> MSBuildRelease buildDir "Build"
|> Log "AppBuild-Output: "
)
// --------------------------------------------------------------------------------------
Target "CreatePackage" (fun _ ->
CreateDir packagingWorkingDir
CleanDir packagingWorkingDir
CopyFile packagingWorkingDir "./output/gtmetrix.dll"
NuGet (fun p ->
{p with
Authors = authors
Dependencies = nugetDependencies
Files = [ (@"gtmetrix.dll", Some @"lib/net452", None);
(@"gtmetrix.dll", Some @"lib/net45", None) ]
Project = project
Description = description
OutputPath = packagingOutputPath
Summary = summary
WorkingDir = packagingWorkingDir
Version = nugetVersion
ReleaseNotes = notes
Publish = false })
"gtmetrix.nuspec"
DeleteDir packagingWorkingDir
)
// --------------------------------------------------------------------------------------
Target "All" DoNothing
"Clean"
==> "AssemblyInfo"
==> "Build"
==> "CreatePackage"
==> "All"
RunTargetOrDefault "All"