-
Notifications
You must be signed in to change notification settings - Fork 1
/
build.fsx
132 lines (120 loc) · 4.5 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
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
#I "packages/NuGet.Core.2.7.0/lib/net40-Client"
#r "NuGet.Core.dll"
#r "System.Xml"
#r "System.Xml.Linq"
#r "Microsoft.Build"
#r "Microsoft.Build.Engine"
#r "Microsoft.Build.Framework"
#r "Microsoft.Build.Tasks.v4.0"
#r "Microsoft.Build.Utilities.v4.0"
open System
open System.IO
open NuGet
// NOTE: the #load directives are only necessary here because
// the project is bootstrapping (building itself).
#load "IntelliFactory.Core/Parametrization.fs"
#load "IntelliFactory.Core/Logs.fs"
#load "IntelliFactory.Core/FileSystem.fs"
#load "IntelliFactory.Core/XmlTools.fs"
#load "IntelliFactory.Core/AssemblyResolution.fs"
#load "IntelliFactory.Core/BatchedQueues.fs"
#load "IntelliFactory.Core/AtomicReferences.fs"
#load "IntelliFactory.Core/TaskExtensions.fs"
#load "IntelliFactory.Core/TextExtensions.fs"
#load "IntelliFactory.Core/AsyncExtensions.fs"
#load "IntelliFactory.Core/Futures.fs"
#load "IntelliFactory.Core/TextPipes.fs"
#load "IntelliFactory.Core/IOExtensions.fs"
#load "IntelliFactory.Core/ProcessAgent.fs"
#load "IntelliFactory.Core/ProcessService.fs"
#load "IntelliFactory.Core/AutoExports.fs"
#load "IntelliFactory.Build/Cache.fs"
#load "IntelliFactory.Build/Frameworks.fs"
#load "IntelliFactory.Build/Utilities.fs"
#load "IntelliFactory.Build/Interfaces.fs"
#load "IntelliFactory.Build/Company.fs"
#load "IntelliFactory.Build/SafeNuGet.fs"
#load "IntelliFactory.Build/BuildConfig.fs"
#load "IntelliFactory.Build/NuGet.fs"
#load "IntelliFactory.Build/Package.fs"
#load "IntelliFactory.Build/AssemblyInfo.fs"
#load "IntelliFactory.Build/References.fs"
#load "IntelliFactory.Build/Solutions.fs"
#load "IntelliFactory.Build/Rebuilds.fs"
#load "IntelliFactory.Build/FSharp.fs"
#load "IntelliFactory.Build/WebSharper.fs"
#load "IntelliFactory.Build/NuGetPackage.fs"
#load "IntelliFactory.Build/MSBuild.fs"
#load "IntelliFactory.Build/BuildTool.fs"
open IntelliFactory.Build
open IntelliFactory.Core
let common = BuildTool().Verbose()
let core = common.PackageId("IntelliFactory.Core", "0.2-alpha")
let build = common.PackageId("IntelliFactory.Build", "0.2-alpha")
let coreLib =
core.FSharp.Library("IntelliFactory.Core")
.SourcesFromProject()
.References(fun rt ->
[
rt.Assembly("System.IO.Compression")
rt.Assembly("System.IO.Compression.FileSystem")
rt.Assembly("System.Xml")
rt.Assembly("System.Xml.Linq")
])
let coreLib40 =
coreLib
|> BuildConfig.CurrentFramework.Custom common.Framework.Net40
|> FSharpConfig.OtherFlags.Custom ["--define:NET40"]
let buildLib =
build.FSharp.Library("IntelliFactory.Build")
.SourcesFromProject()
.References(fun rt ->
[
rt.Assembly("Microsoft.Build")
rt.Assembly("Microsoft.Build.Engine")
rt.Assembly("Microsoft.Build.Framework")
rt.Assembly("Microsoft.Build.Tasks.v4.0")
rt.Assembly("Microsoft.Build.Utilities.v4.0")
rt.Assembly("System.Xml")
rt.Assembly("System.Xml.Linq")
rt.Assembly("System.IO.Compression")
rt.Assembly("System.IO.Compression.FileSystem")
rt.NuGet("NuGet.Core").Version("2.7.0").Reference()
rt.Project(coreLib)
])
.Embed(["../tools/NuGet/NuGet.exe"])
let buildTool =
build.FSharp.ConsoleExecutable("IB").SourcesFromProject()
.References(fun rt ->
[
rt.Project(coreLib)
rt.Project(buildLib)
rt.NuGet("NuGet.Core").Version("2.7.0").Reference()
])
|> FSharpConfig.OtherFlags.Custom ["--platform:x86"]
let corePkg =
core.NuGet.CreatePackage()
.Description("Provides utilities missing from F# standard library")
.ProjectUrl("http://bitbucket.com/IntelliFactory/build")
.Apache20License()
.Add(coreLib)
.Add(coreLib40)
let buildPkg =
build.NuGet.CreatePackage()
.Description("Provides utilities for build automation, \
in particular building WebSharper and F# projects, \
without the need for MSBuild.")
.ProjectUrl("http://bitbucket.com/IntelliFactory/build")
.Apache20License()
.Add(buildLib)
.Add(buildTool)
.AddPackage(corePkg)
common.Solution [
coreLib
coreLib40
buildLib
buildTool
corePkg
buildPkg
]
|> common.Dispatch