This repository has been archived by the owner on Sep 14, 2020. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathbuildConfig.fsx
124 lines (109 loc) · 4.11 KB
/
buildConfig.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
// ----------------------------------------------------------------------------
// This file is subject to the terms and conditions defined in
// file 'LICENSE.txt', which is part of this source code package.
// ----------------------------------------------------------------------------
(**
# AIT.VisualStudioTextTransform buildConfig.fsx configuration
*)
#if FAKE
#else
// Support when file is opened in Visual Studio
#load "packages/AIT.Build/content/buildConfigDef.fsx"
#endif
(**
## Required config start
First We need to load some dependencies and open some namespaces.
*)
open BuildConfigDef
open System.Collections.Generic
open System.IO
open Fake
open Fake.Git
open Fake.FSharpFormatting
open AssemblyInfoFile
// Used by the TestEnv.cs
setEnvironVar "PROJECT_DIRECTORY" (Path.GetFullPath ".")
(**
## Main project configuration
Then we need to set some general properties of the project.
*)
let buildConfig =
// Read release notes document
let release = ReleaseNotesHelper.parseReleaseNotes (File.ReadLines "doc/ReleaseNotes.md")
{ BuildConfiguration.Defaults with
ProjectName = "AIT.Tools.VisualStudioTextTransform"
CopyrightNotice = "Copyright © 2015, AIT GmbH & Co. KG"
ProjectSummary = "AIT.Tools.VisualStudioTextTransform can automatically transform T4 templates from a given solution."
ProjectDescription =
"AIT.Tools.VisualStudioTextTransform can automatically transform T4 templates from a given solution."
ProjectAuthors = ["AIT GmbH"]
NugetTags = "building C# F# dotnet .net"
PageAuthor = "AIT GmbH"
GithubUser = "AITGmbH"
// Defaults to ProjectName if unset
GithubProject = "VisualStudioTextTransform"
Version = release.NugetVersion
(**
Setup which nuget packages are created.
*)
NugetPackages =
[ "AIT.Tools.VisualStudioTextTransform.nuspec", (fun config p ->
{ p with
Version = config.Version
NoDefaultExcludes = true
ReleaseNotes = toLines release.Notes
Dependencies =
[ "FSharp.Formatting"
// "FSharp.Compiler.Service" included in FAKE
"FSharpVSPowerTools.Core"
// "Mono.Cecil" included in FAKE
"FAKE" ]
|> List.map (fun name -> name, (GetPackageVersion "packages" name |> RequireExactly)) } ) ]
(**
With `UseNuget` you can specify if AIT.Build should restore nuget packages
before running the build (if you only use paket, you either leave it out or use the default setting = false).
*)
// We must restore to get a Razor3 and Razor2 (paket can only handle one)
UseNuget = true
SetupMSTest = fun p ->
{p with
TestSettingsPath = @"..\..\..\src\settings.testsettings" }
(**
## The `GeneratedFileList` property
The `GeneratedFileList` list is used to specify which files are copied over to the release directory.
This list is also used for documentation generation.
Defaults to [ x.ProjectName + ".dll"; x.ProjectName + ".xml" ] which is only enough for very simple projects.
*)
GeneratedFileList =
[ "AIT.Tools.VisualStudioTextTransform.exe"; "AIT.Tools.VisualStudioTextTransform.exe.xml" ]
(**
You can change which AssemblyInfo files are generated for you.
On default "./src/SharedAssemblyInfo.fs" and "./src/SharedAssemblyInfo.cs" are created.
*)
SetAssemblyFileVersions = (fun config ->
let info =
[ Attribute.Company "AIT GmbH & Co. KG"
Attribute.Product config.ProjectName
Attribute.Copyright config.CopyrightNotice
Attribute.Version config.Version
Attribute.FileVersion config.Version
Attribute.InformationalVersion config.Version]
CreateCSharpAssemblyInfo "./src/GlobalAssemblyInfo.cs" info)
(**
## Yaaf.AdvancedBuilding features
Setup the builds
*)
BuildTargets =
[ { BuildParams.WithSolution with
// The net404 client build
PlatformName = "Net45"
SimpleBuildName = "net45" }]
EnableDebugSymbolConversion = false
RestrictReleaseToWindows = true
}
(**
## FAKE settings
You can setup FAKE variables as well.
*)
if isMono then
monoArguments <- "--runtime=v4.0 --debug"