forked from fsprojects/FAKE
-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.fsx
1667 lines (1472 loc) · 65.8 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
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
#if BOOTSTRAP && DOTNETCORE
#r "paket:
source nuget/dotnetcore
source https://api.nuget.org/v3/index.json
nuget FSharp.Core ~> 4.1
nuget System.AppContext prerelease
nuget Paket.Core prerelease
nuget Fake.Api.GitHub prerelease
nuget Fake.BuildServer.AppVeyor prerelease
nuget Fake.BuildServer.TeamCity prerelease
nuget Fake.BuildServer.Travis prerelease
nuget Fake.BuildServer.TeamFoundation prerelease
nuget Fake.BuildServer.GitLab prerelease
nuget Fake.Core.Target prerelease
nuget Fake.Core.SemVer prerelease
nuget Fake.IO.FileSystem prerelease
nuget Fake.IO.Zip prerelease
nuget Fake.Core.ReleaseNotes prerelease
nuget Fake.DotNet.AssemblyInfoFile prerelease
nuget Fake.DotNet.MSBuild prerelease
nuget Fake.DotNet.Cli prerelease
nuget Fake.DotNet.NuGet prerelease
nuget Fake.DotNet.Paket prerelease
nuget Fake.DotNet.FSFormatting prerelease
nuget Fake.DotNet.Testing.MSpec prerelease
nuget Fake.DotNet.Testing.XUnit2 prerelease
nuget Fake.DotNet.Testing.NUnit prerelease
nuget Fake.Windows.Chocolatey prerelease
nuget Fake.Tools.Git prerelease
nuget Mono.Cecil prerelease
nuget Suave
nuget Octokit //"
#endif
#if DOTNETCORE
// We need to use this for now as "regular" Fake breaks when its caching logic cannot find "intellisense.fsx".
// This is the reason why we need to checkin the "intellisense.fsx" file for now...
#load ".fake/build.fsx/intellisense.fsx"
open System.Reflection
#else
// Load this before FakeLib, see https://github.com/fsharp/FSharp.Compiler.Service/issues/763
#r "packages/Mono.Cecil/lib/net40/Mono.Cecil.dll"
#I "packages/build/FAKE/tools/"
#r "FakeLib.dll"
#r "Paket.Core.dll"
#r "packages/build/System.Net.Http/lib/net46/System.Net.Http.dll"
#r "packages/build/Octokit/lib/net45/Octokit.dll"
#I "packages/build/SourceLink.Fake/tools/"
#r "System.IO.Compression"
//#load "packages/build/SourceLink.Fake/tools/SourceLink.fsx"
#endif
//#if !FAKE
//let execContext = Fake.Core.Context.FakeExecutionContext.Create false "build.fsx" []
//Fake.Core.Context.setExecutionContext (Fake.Core.Context.RuntimeContext.Fake execContext)
//#endif
// #load "src/app/Fake.DotNet.FSFormatting/FSFormatting.fs"
open System.IO
open Fake.Api
open Fake.Core
open Fake.BuildServer
open Fake.Tools
open Fake.IO
open Fake.IO.FileSystemOperators
open Fake.IO.Globbing.Operators
open Fake.Windows
open Fake.DotNet
open Fake.DotNet.Testing
// Set this to true if you have lots of breaking changes, for small breaking changes use #if BOOTSTRAP, setting this flag will not be accepted
let disableBootstrap = false
// properties
let projectName = "FAKE"
let projectSummary = "FAKE - F# Make - Get rid of the noise in your build scripts."
let projectDescription = "FAKE - F# Make - is a build automation tool for .NET. Tasks and dependencies are specified in a DSL which is integrated in F#."
let authors = ["Steffen Forkmann"; "Mauricio Scheffer"; "Colin Bull"; "Matthias Dittrich"]
let gitRaw = Environment.environVarOrDefault "gitRaw" "https://raw.github.com/fsharp"
let gitOwner = "fsharp"
let gitHome = "https://github.com/" + gitOwner
// The name of the project on GitHub
let gitName = "FAKE"
let release = ReleaseNotes.load "RELEASE_NOTES.md"
(*
let version =
let semVer = SemVer.parse release.NugetVersion
match semVer.PreRelease with
| None -> ()
| _ -> ()*)
let packages =
["FAKE.Core",projectDescription
"FAKE.Gallio",projectDescription + " Extensions for Gallio"
"FAKE.IIS",projectDescription + " Extensions for IIS"
"FAKE.FluentMigrator",projectDescription + " Extensions for FluentMigrator"
"FAKE.SQL",projectDescription + " Extensions for SQL Server"
"FAKE.Experimental",projectDescription + " Experimental Extensions"
"Fake.Deploy.Lib",projectDescription + " Extensions for FAKE Deploy"
projectName,projectDescription + " This package bundles all extensions."
"FAKE.Lib",projectDescription + " FAKE helper functions as library"]
let buildDir = "./build"
let testDir = "./test"
let docsDir = "./docs"
let apidocsDir = "./docs/apidocs/"
let nugetDncDir = "./nuget/dotnetcore"
let nugetLegacyDir = "./nuget/legacy"
let reportDir = "./report"
let packagesDir = "./packages"
let buildMergedDir = buildDir </> "merged"
let root = __SOURCE_DIRECTORY__
let srcDir = root</>"src"
let appDir = srcDir</>"app"
let legacyDir = srcDir</>"legacy"
let additionalFiles = [
"License.txt"
"README.markdown"
"RELEASE_NOTES.md"
"./packages/FSharp.Core/lib/net45/FSharp.Core.sigdata"
"./packages/FSharp.Core/lib/net45/FSharp.Core.optdata"]
let nuget_exe = Directory.GetCurrentDirectory() </> "packages" </> "build" </> "NuGet.CommandLine" </> "tools" </> "NuGet.exe"
let apikey = Environment.environVarOrDefault "nugetkey" ""
let nugetsource = Environment.environVarOrDefault "nugetsource" "https://www.nuget.org/api/v2/package"
let artifactsDir = Environment.environVarOrDefault "artifactsdirectory" ""
let fromArtifacts = not <| String.isNullOrEmpty artifactsDir
BuildServer.install [
AppVeyor.Installer
TeamCity.Installer
Travis.Installer
TeamFoundation.Installer
#if DOTNETCORE
GitLab.Installer
#endif
]
let version =
let segToString = function
| PreReleaseSegment.AlphaNumeric n -> n
| PreReleaseSegment.Numeric n -> string n
let createAlphaNum (s:string) =
PreReleaseSegment.AlphaNumeric (s.Replace("_", "-").Replace("+", "-"))
let source, buildMeta =
match BuildServer.buildServer with
#if DOTNETCORE
| BuildServer.GitLabCI ->
// Workaround for now
// We get CI_COMMIT_REF_NAME=master and CI_COMMIT_SHA
// Too long for chocolatey (limit = 20) and we don't strictly need it.
//let branchPath =
// MyGitLab.Environment.CommitRefName.Split('/')
// |> Seq.map createAlphaNum
[ //yield! branchPath
//yield PreReleaseSegment.AlphaNumeric "gitlab"
yield PreReleaseSegment.AlphaNumeric GitLab.Environment.PipelineId
], sprintf "gitlab.%s" GitLab.Environment.CommitSha
#endif
| BuildServer.TeamFoundation ->
let sourceBranch = TeamFoundation.Environment.BuildSourceBranch
let isPr = sourceBranch.StartsWith "refs/pull/"
let firstSegment =
if isPr then
let splits = sourceBranch.Split '/'
let prNum = bigint (int splits.[2])
[ PreReleaseSegment.AlphaNumeric "pr"; PreReleaseSegment.Numeric prNum ]
else
// Too long for chocolatey (limit = 20) and we don't strictly need it.
//let branchPath = sourceBranch.Split('/') |> Seq.skip 2 |> Seq.map createAlphaNum
//[ yield! branchPath ]
[]
let buildId = bigint (int TeamFoundation.Environment.BuildId)
[ yield! firstSegment
//yield PreReleaseSegment.AlphaNumeric "vsts"
yield PreReleaseSegment.Numeric buildId
], sprintf "vsts.%s" TeamFoundation.Environment.BuildSourceVersion
| _ -> [], ""
let semVer = SemVer.parse release.NugetVersion
let prerelease =
match semVer.PreRelease with
| None -> None
| Some p ->
let toAdd = System.String.Join(".", source |> Seq.map segToString)
let toAdd = if System.String.IsNullOrEmpty toAdd then toAdd else "." + toAdd
Some ({p with
Values = p.Values @ source
Origin = p.Origin + toAdd })
{ semVer with PreRelease = prerelease; Original = None; BuildMetaData = buildMeta }
let nugetVersion =
if System.String.IsNullOrEmpty version.BuildMetaData
then version.AsString
else sprintf "%s+%s" version.AsString version.BuildMetaData
let chocoVersion =
// Replace "." with "-" in the prerelease-string
let build =
if version.Build > 0I then ("." + version.Build.ToString("D")) else ""
let pre =
match version.PreRelease with
| Some preRelease -> ("-" + preRelease.Origin.Replace(".", "-"))
| None -> ""
let result = sprintf "%d.%d.%d%s%s" version.Major version.Minor version.Patch build pre
if pre.Length > 20 then
let msg = sprintf "Version '%s' is too long for chocolatey (Prerelease string is max 20 chars)" result
Trace.traceError msg
failwithf "%s" msg
result
Trace.setBuildNumber nugetVersion
//let current = CoreTracing.getListeners()
//if current |> Seq.contains CoreTracing.defaultConsoleTraceListener |> not then
// CoreTracing.setTraceListeners (CoreTracing.defaultConsoleTraceListener :: current)
let dotnetSdk = lazy DotNet.install DotNet.Release_2_1_4
let inline dtntWorkDir wd =
DotNet.Options.lift dotnetSdk.Value
>> DotNet.Options.withWorkingDirectory wd
let inline dtntSmpl arg = DotNet.Options.lift dotnetSdk.Value arg
let publish f =
// Workaround
let path = Path.GetFullPath f
let name = Path.GetFileName path
let target = Path.Combine("artifacts", name)
let targetDir = Path.GetDirectoryName target
Directory.ensure targetDir
Trace.publish ImportData.BuildArtifact (Path.GetFullPath f)
let cleanForTests () =
// Clean NuGet cache (because it might contain appveyor stuff)
let cacheFolders = [ Paket.Constants.UserNuGetPackagesFolder; Paket.Constants.NuGetCacheFolder ]
for f in cacheFolders do
printfn "Clearing FAKE-NuGet packages in %s" f
!! (f </> "Fake.*")
|> Seq.iter (Shell.rm_rf)
let run workingDir fileName args =
printfn "CWD: %s" workingDir
let fileName, args =
if Environment.isUnix
then fileName, args else "cmd", ("/C " + fileName + " " + args)
let ok =
Process.execSimple (fun info ->
{ info with
FileName = fileName
WorkingDirectory = workingDir
Arguments = args }
) System.TimeSpan.MaxValue
if ok <> 0 then failwith (sprintf "'%s> %s %s' task failed" workingDir fileName args)
let rmdir dir =
if Environment.isUnix
then Shell.rm_rf dir
// Use this in Windows to prevent conflicts with paths too long
else run "." "cmd" ("/C rmdir /s /q " + Path.GetFullPath dir)
// Clean test directories
!! "integrationtests/*/temp"
|> Seq.iter rmdir
Target.create "WorkaroundPaketNuspecBug" (fun _ ->
// Workaround https://github.com/fsprojects/Paket/issues/2830
// https://github.com/fsprojects/Paket/issues/2689
// Basically paket fails if there is already an existing nuspec in obj/ dir because then MSBuild will call paket with multiple nuspec file arguments separated by ';'
!! "src/*/*/obj/**/*.nuspec"
-- (sprintf "src/*/*/obj/**/*%s.nuspec" nugetVersion)
|> File.deleteAll
)
// Targets
Target.create "Clean" (fun _ ->
!! "src/*/*/bin"
//++ "src/*/*/obj"
|> Shell.cleanDirs
Shell.cleanDirs [buildDir; testDir; docsDir; apidocsDir; nugetDncDir; nugetLegacyDir; reportDir]
// Clean Data for tests
cleanForTests()
)
Target.create "RenameFSharpCompilerService" (fun _ ->
for packDir in ["FSharp.Compiler.Service";"netcore"</>"FSharp.Compiler.Service"] do
// for framework in ["net40"; "net45"] do
for framework in ["netstandard2.0"; "net45"] do
let dir = __SOURCE_DIRECTORY__ </> "packages"</>packDir</>"lib"</>framework
let targetFile = dir </> "FAKE.FSharp.Compiler.Service.dll"
File.delete targetFile
#if DOTNETCORE
let reader =
let searchpaths =
[ dir; __SOURCE_DIRECTORY__ </> "packages/FSharp.Core/lib/net45" ]
let resolve name =
let n = AssemblyName(name)
match searchpaths
|> Seq.collect (fun p -> Directory.GetFiles(p, "*.dll"))
|> Seq.tryFind (fun f -> f.ToLowerInvariant().Contains(n.Name.ToLowerInvariant())) with
| Some f -> f
| None ->
failwithf "Could not resolve '%s'" name
let readAssemblyE (name:string) (parms: Mono.Cecil.ReaderParameters) =
Mono.Cecil.AssemblyDefinition.ReadAssembly(
resolve name,
parms)
let readAssembly (name:string) (x:Mono.Cecil.IAssemblyResolver) =
readAssemblyE name (new Mono.Cecil.ReaderParameters(AssemblyResolver = x))
{ new Mono.Cecil.IAssemblyResolver with
member x.Dispose () = ()
//member x.Resolve (name : string) = readAssembly name x
//member x.Resolve (name : string, parms : Mono.Cecil.ReaderParameters) = readAssemblyE name parms
member x.Resolve (name : Mono.Cecil.AssemblyNameReference) = readAssembly name.FullName x
member x.Resolve (name : Mono.Cecil.AssemblyNameReference, parms : Mono.Cecil.ReaderParameters) = readAssemblyE name.FullName parms
}
#else
let reader = new Mono.Cecil.DefaultAssemblyResolver()
reader.AddSearchDirectory(dir)
reader.AddSearchDirectory(__SOURCE_DIRECTORY__ </> "packages/FSharp.Core/lib/net45")
#endif
let readerParams = Mono.Cecil.ReaderParameters(AssemblyResolver = reader)
let asem = Mono.Cecil.AssemblyDefinition.ReadAssembly(dir </>"FSharp.Compiler.Service.dll", readerParams)
asem.Name <- Mono.Cecil.AssemblyNameDefinition("FAKE.FSharp.Compiler.Service", System.Version(1,0,0,0))
asem.Write(dir</>"FAKE.FSharp.Compiler.Service.dll")
)
let common = [
AssemblyInfo.Product "FAKE - F# Make"
AssemblyInfo.Version release.AssemblyVersion
AssemblyInfo.InformationalVersion nugetVersion
AssemblyInfo.FileVersion nugetVersion]
// New FAKE libraries
let dotnetAssemblyInfos =
[ "dotnet-fake", "Fake dotnet-cli command line tool"
"Fake.Api.GitHub", "GitHub Client API Support via Octokit"
"Fake.Api.HockeyApp", "HockeyApp Integration Support"
"Fake.Api.Slack", "Slack Integration Support"
"Fake.Azure.CloudServices", "Azure Cloud Services Support"
"Fake.Azure.Emulators", "Azure Emulators Support"
"Fake.Azure.Kudu", "Azure Kudu Support"
"Fake.Azure.WebJobs", "Azure Web Jobs Support"
"Fake.BuildServer.AppVeyor", "Integration into AppVeyor buildserver"
"Fake.BuildServer.GitLab", "Integration into GitLab-CI buildserver"
"Fake.BuildServer.TeamCity", "Integration into TeamCity buildserver"
"Fake.BuildServer.TeamFoundation", "Integration into TeamFoundation buildserver"
"Fake.BuildServer.Travis", "Integration into Travis buildserver"
"Fake.Core.CommandLineParsing", "Core commandline parsing support via docopt like syntax"
"Fake.Core.Context", "Core Context Infrastructure"
"Fake.Core.Environment", "Environment Detection"
"Fake.Core.Process", "Starting and managing Processes"
"Fake.Core.ReleaseNotes", "Parsing ReleaseNotes"
"Fake.Core.SemVer", "Parsing and working with SemVer"
"Fake.Core.String", "Core String manipulations"
"Fake.Core.Target", "Defining and running Targets"
"Fake.Core.Tasks", "Repeating and managing Tasks"
"Fake.Core.Trace", "Core Logging functionality"
"Fake.Core.Xml", "Core Xml functionality"
"Fake.Documentation.DocFx", "Documentation with DocFx"
"Fake.DotNet.AssemblyInfoFile", "Writing AssemblyInfo files"
"Fake.DotNet.Cli", "Running the dotnet cli"
"Fake.DotNet.Fsc", "Running the f# compiler - fsc"
"Fake.DotNet.FSFormatting", "Running fsformatting.exe and generating documentation"
"Fake.DotNet.Mage", "Manifest Generation and Editing Tool"
"Fake.DotNet.MSBuild", "Running msbuild"
"Fake.DotNet.NuGet", "Running NuGet Client and interacting with NuGet Feeds"
"Fake.DotNet.Paket", "Running Paket and publishing packages"
"Fake.DotNet.Testing.Expecto", "Running expecto test runner"
"Fake.DotNet.Testing.MSpec", "Running mspec test runner"
"Fake.DotNet.Testing.MSTest", "Running mstest test runner"
"Fake.DotNet.Testing.NUnit", "Running nunit test runner"
"Fake.DotNet.Testing.OpenCover", "Code coverage with OpenCover"
"Fake.DotNet.Testing.SpecFlow", "BDD with Gherkin and SpecFlow"
"Fake.DotNet.Testing.XUnit2", "Running xunit test runner"
"Fake.DotNet.Xamarin", "Running Xamarin builds"
"Fake.Installer.InnoSetup", "Creating installers with InnoSetup"
"Fake.IO.FileSystem", "Core Filesystem utilities and globbing support"
"Fake.IO.Zip", "Core Zip functionality"
"Fake.JavaScript.Npm", "Running npm commands"
"Fake.JavaScript.Yarn", "Running Yarn commands"
"Fake.Net.Http", "HTTP Client"
"Fake.netcore", "Command line tool"
"Fake.Runtime", "Core runtime features"
"Fake.Sql.DacPac", "Sql Server Data Tools DacPac operations"
"Fake.Testing.Common", "Common testing data types"
"Fake.Testing.ReportGenerator", "Convert XML coverage output to various formats"
"Fake.Testing.SonarQube", "Analyzing your project with SonarQube"
"Fake.Tools.Git", "Running git commands"
"Fake.Tools.Pickles", "Convert Gherkin to HTML"
"Fake.Tracing.NAntXml", "NAntXml"
"Fake.Windows.Chocolatey", "Running and packaging with Chocolatey"
"Fake.Windows.Registry", "CRUD functionality for Windows registry" ]
let assemblyInfos =
[ legacyDir </> "FAKE/AssemblyInfo.fs",
[ AssemblyInfo.Title "FAKE - F# Make Command line tool"
AssemblyInfo.Guid "fb2b540f-d97a-4660-972f-5eeff8120fba"] @ common
legacyDir </> "Fake.Deploy/AssemblyInfo.fs",
[ AssemblyInfo.Title "FAKE - F# Make Deploy tool"
AssemblyInfo.Guid "413E2050-BECC-4FA6-87AA-5A74ACE9B8E1"] @ common
legacyDir </> "deploy.web/Fake.Deploy.Web/AssemblyInfo.fs",
[ AssemblyInfo.Title "FAKE - F# Make Deploy Web"
AssemblyInfo.Guid "27BA7705-3F57-47BE-B607-8A46B27AE876"] @ common
legacyDir </> "Fake.Deploy.Lib/AssemblyInfo.fs",
[ AssemblyInfo.Title "FAKE - F# Make Deploy Lib"
AssemblyInfo.Guid "AA284C42-1396-42CB-BCAC-D27F18D14AC7"] @ common
legacyDir </> "FakeLib/AssemblyInfo.fs",
[ AssemblyInfo.Title "FAKE - F# Make Lib"
AssemblyInfo.InternalsVisibleTo "Test.FAKECore"
AssemblyInfo.Guid "d6dd5aec-636d-4354-88d6-d66e094dadb5"] @ common
legacyDir </> "Fake.SQL/AssemblyInfo.fs",
[ AssemblyInfo.Title "FAKE - F# Make SQL Lib"
AssemblyInfo.Guid "A161EAAF-EFDA-4EF2-BD5A-4AD97439F1BE"] @ common
legacyDir </> "Fake.Experimental/AssemblyInfo.fs",
[ AssemblyInfo.Title "FAKE - F# Make Experimental Lib"
AssemblyInfo.Guid "5AA28AED-B9D8-4158-A594-32FE5ABC5713"] @ common
legacyDir </> "Fake.FluentMigrator/AssemblyInfo.fs",
[ AssemblyInfo.Title "FAKE - F# Make FluentMigrator Lib"
AssemblyInfo.Guid "E18BDD6F-1AF8-42BB-AEB6-31CD1AC7E56D"] @ common ] @
(dotnetAssemblyInfos
|> List.map (fun (project, description) ->
appDir </> sprintf "%s/AssemblyInfo.fs" project, [AssemblyInfo.Title (sprintf "FAKE - F# Make %s" description) ] @ common))
Target.create "SetAssemblyInfo" (fun _ ->
for assemblyFile, attributes in assemblyInfos do
// Fixes merge conflicts in AssemblyInfo.fs files, while at the same time leaving the repository in a compilable state.
// http://stackoverflow.com/questions/32251037/ignore-changes-to-a-tracked-file
// Quick-fix: git ls-files -v . | grep ^S | cut -c3- | xargs git update-index --no-skip-worktree
Git.CommandHelper.directRunGitCommandAndFail "." (sprintf "update-index --skip-worktree %s" assemblyFile)
attributes |> AssemblyInfoFile.createFSharp assemblyFile
()
)
Target.create "DownloadPaket" (fun _ ->
if 0 <> Process.execSimple (fun info ->
{ info with
FileName = ".paket/paket.exe"
Arguments = "--version" }
|> Process.withFramework
) (System.TimeSpan.FromMinutes 5.0) then
failwith "paket failed to start"
)
Target.create "UnskipAndRevertAssemblyInfo" (fun _ ->
for assemblyFile, _ in assemblyInfos do
// While the files are skipped in can be hard to switch between branches
// Therefore we unskip and revert here.
Git.CommandHelper.directRunGitCommandAndFail "." (sprintf "update-index --no-skip-worktree %s" assemblyFile)
Git.CommandHelper.directRunGitCommandAndFail "." (sprintf "checkout HEAD %s" assemblyFile)
()
)
Target.create "_BuildSolution" (fun _ ->
MSBuild.runWithDefaults "Build" ["./src/Legacy-FAKE.sln"; "./src/Legacy-FAKE.Deploy.Web.sln"]
|> Trace.logItems "AppBuild-Output: "
// TODO: Check if we run the test in the current build!
Directory.ensure "temp"
let testZip = "temp/tests-legacy.zip"
!! "test/**"
|> Zip.zip "." testZip
publish testZip
)
Target.create "GenerateDocs" (fun _ ->
Shell.cleanDir docsDir
let source = "./help"
let docsTemplate = "docpage.cshtml"
let indexTemplate = "indexpage.cshtml"
let githubLink = "https://github.com/fsharp/FAKE"
let projInfo =
[ "page-description", "FAKE - F# Make"
"page-author", String.separated ", " authors
"project-author", String.separated ", " authors
"github-link", githubLink
"version", nugetVersion
"project-github", "http://github.com/fsharp/fake"
"project-nuget", "https://www.nuget.org/packages/FAKE"
"root", "http://fsharp.github.io/FAKE"
"project-name", "FAKE - F# Make" ]
let layoutRoots = [ "./help/templates"; "./help/templates/reference"]
let fake5LayoutRoots = "./help/templates/fake5" :: layoutRoots
let legacyLayoutRoots = "./help/templates/legacy" :: layoutRoots
let fake4LayoutRoots = "./help/templates/fake4" :: layoutRoots
Shell.copyDir (docsDir) "help/content" FileFilter.allFiles
// to skip circleci builds
let docsCircleCi = docsDir + "/.circleci"
Directory.ensure docsCircleCi
Shell.copyDir docsCircleCi ".circleci" FileFilter.allFiles
File.writeString false "./docs/.nojekyll" ""
File.writeString false "./docs/CNAME" "fake.build"
//CopyDir (docsDir @@ "pics") "help/pics" FileFilter.allFiles
Shell.copy (source @@ "markdown") ["RELEASE_NOTES.md"]
FSFormatting.createDocs (fun s ->
{ s with
Source = source @@ "markdown"
OutputDirectory = docsDir
Template = docsTemplate
ProjectParameters = ("CurrentPage", "Modules") :: projInfo
LayoutRoots = layoutRoots })
FSFormatting.createDocs (fun s ->
{ s with
Source = source @@ "redirects"
OutputDirectory = docsDir
Template = docsTemplate
ProjectParameters = ("CurrentPage", "FAKE-4") :: projInfo
LayoutRoots = layoutRoots })
FSFormatting.createDocs (fun s ->
{ s with
Source = source @@ "startpage"
OutputDirectory = docsDir
Template = indexTemplate
// TODO: CurrentPage shouldn't be required as it's written in the template, but it is -> investigate
ProjectParameters = ("CurrentPage", "Home") :: projInfo
LayoutRoots = layoutRoots })
Directory.ensure apidocsDir
let baseDir = Path.GetFullPath "."
let dllsAndLibDirs (dllPattern:IGlobbingPattern) =
let dlls =
dllPattern
|> GlobbingPattern.setBaseDir baseDir
|> Seq.distinctBy Path.GetFileName
|> List.ofSeq
let libDirs =
dlls
|> Seq.map Path.GetDirectoryName
|> Seq.distinct
|> List.ofSeq
(dlls,libDirs)
// FAKE 5 module documentation
let fake5ApidocsDir = apidocsDir @@ "v5"
Directory.ensure fake5ApidocsDir
let fake5Dlls, fake5LibDirs =
!! "src/app/Fake.*/bin/Release/**/Fake.*.dll"
|> dllsAndLibDirs
fake5Dlls
|> FSFormatting.createDocsForDlls (fun s ->
{ s with
OutputDirectory = fake5ApidocsDir
LayoutRoots = fake5LayoutRoots
LibDirs = fake5LibDirs
// TODO: CurrentPage shouldn't be required as it's written in the template, but it is -> investigate
ProjectParameters = ("api-docs-prefix", "/apidocs/v5/") :: ("CurrentPage", "APIReference") :: projInfo
SourceRepository = githubLink + "/blob/master" })
// Compat urls
let redirectPage newPage =
sprintf """
<html>
<head>
<title>Redirecting</title>
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1" />
</head>
<body>
<p><a href="%s">This page has moved here...</a></p>
<script type="text/javascript">
var url = "%s";
window.location.replace(url);
</script>
</body>
</html>""" newPage newPage
!! (fake5ApidocsDir + "/*.html")
|> Seq.iter (fun v5File ->
// ./docs/apidocs/v5/blub.html
let name = Path.GetFileName v5File
let v4Name = Path.GetDirectoryName (Path.GetDirectoryName v5File) @@ name
// ./docs/apidocs/blub.html
let link = sprintf "/apidocs/v5/%s" name
File.WriteAllText(v4Name, redirectPage link)
)
// FAKE 5 legacy documentation
let fake5LegacyApidocsDir = apidocsDir @@ "v5/legacy"
Directory.ensure fake5LegacyApidocsDir
let fake5LegacyDlls, fake5LegacyLibDirs =
!! "build/**/Fake.*.dll"
++ "build/FakeLib.dll"
-- "build/**/Fake.Experimental.dll"
-- "build/**/FSharp.Compiler.Service.dll"
-- "build/**/netcore/FAKE.FSharp.Compiler.Service.dll"
-- "build/**/FAKE.FSharp.Compiler.Service.dll"
-- "build/**/Fake.IIS.dll"
-- "build/**/Fake.Deploy.Lib.dll"
|> dllsAndLibDirs
fake5LegacyDlls
|> FSFormatting.createDocsForDlls (fun s ->
{ s with
OutputDirectory = fake5LegacyApidocsDir
LayoutRoots = legacyLayoutRoots
LibDirs = fake5LegacyLibDirs
// TODO: CurrentPage shouldn't be required as it's written in the template, but it is -> investigate
ProjectParameters = ("api-docs-prefix", "/apidocs/v5/legacy/") :: ("CurrentPage", "APIReference") :: projInfo
SourceRepository = githubLink + "/blob/master" })
// FAKE 4 legacy documentation
let fake4LegacyApidocsDir = apidocsDir @@ "v4"
Directory.ensure fake4LegacyApidocsDir
let fake4LegacyDlls, fake4LegacyLibDirs =
!! "packages/docs/FAKE/tools/Fake.*.dll"
++ "packages/docs/FAKE/tools/FakeLib.dll"
-- "packages/docs/FAKE/tools/Fake.Experimental.dll"
-- "packages/docs/FAKE/tools/FSharp.Compiler.Service.dll"
-- "packages/docs/FAKE/tools/FAKE.FSharp.Compiler.Service.dll"
-- "packages/docs/FAKE/tools/Fake.IIS.dll"
-- "packages/docs/FAKE/tools/Fake.Deploy.Lib.dll"
|> dllsAndLibDirs
fake4LegacyDlls
|> FSFormatting.createDocsForDlls (fun s ->
{ s with
OutputDirectory = fake4LegacyApidocsDir
LayoutRoots = fake4LayoutRoots
LibDirs = fake4LegacyLibDirs
// TODO: CurrentPage shouldn't be required as it's written in the template, but it is -> investigate
ProjectParameters = ("api-docs-prefix", "/apidocs/v4/") ::("CurrentPage", "APIReference") :: projInfo
SourceRepository = githubLink + "/blob/hotfix_fake4" })
)
#if DOTNETCORE
let startWebServer () =
let rec findPort port =
let portIsTaken = false
//if Environment.isMono then false else
//System.Net.NetworkInformation.IPGlobalProperties.GetIPGlobalProperties().GetActiveTcpListeners()
//|> Seq.exists (fun x -> x.Port = port)
if portIsTaken then findPort (port + 1) else port
let port = findPort 8083
let serverConfig =
{ Suave.Web.defaultConfig with
homeFolder = Some (Path.GetFullPath docsDir)
bindings = [ Suave.Http.HttpBinding.createSimple Suave.Http.Protocol.HTTP "127.0.0.1" port ]
}
let (>=>) = Suave.Operators.(>=>)
let app =
Suave.WebPart.choose [
//Filters.path "/websocket" >=> handShake socketHandler
Suave.Writers.setHeader "Cache-Control" "no-cache, no-store, must-revalidate"
>=> Suave.Writers.setHeader "Pragma" "no-cache"
>=> Suave.Writers.setHeader "Expires" "0"
>=> Suave.Files.browseHome ]
Suave.Web.startWebServerAsync serverConfig app |> snd |> Async.Start
let psi = System.Diagnostics.ProcessStartInfo(sprintf "http://localhost:%d/index.html" port)
psi.UseShellExecute <- true
System.Diagnostics.Process.Start (psi) |> ignore
Target.create "HostDocs" (fun _ ->
startWebServer()
Trace.traceImportant "Press any key to stop."
System.Console.ReadKey() |> ignore
)
#endif
Target.create "CopyLicense" (fun _ ->
Shell.copyTo buildDir additionalFiles
)
Target.create "Test" (fun _ ->
!! (testDir @@ "Test.*.dll")
|> Seq.filter (fun fileName -> if Environment.isMono then fileName.ToLower().Contains "deploy" |> not else true)
|> MSpec.exec (fun p ->
{p with
ToolPath = Globbing.Tools.findToolInSubPath "mspec-x86-clr4.exe" (Shell.pwd() @@ "tools" @@ "MSpec")
ExcludeTags = if Environment.isWindows then ["HTTP"] else ["HTTP"; "WindowsOnly"]
TimeOut = System.TimeSpan.FromMinutes 5.
HtmlOutputDir = reportDir})
try
!! (testDir @@ "Test.*.dll")
++ (testDir @@ "FsCheck.Fake.dll")
|> XUnit2.run id
with e when e.Message.Contains "timed out" && Environment.isUnix ->
Trace.traceFAKE "Ignoring xUnit timeout for now, there seems to be something funny going on ..."
)
Target.create "DotNetCoreIntegrationTests" (fun _ ->
cleanForTests()
let processResult =
DotNet.exec (dtntWorkDir root) "src/test/Fake.Core.IntegrationTests/bin/Release/netcoreapp2.0/Fake.Core.IntegrationTests.dll" "--summary"
if processResult.ExitCode <> 0 then failwithf "DotNet Core Integration tests failed."
)
Target.create "DotNetCoreUnitTests" (fun _ ->
// dotnet run -p src/test/Fake.Core.UnitTests/Fake.Core.UnitTests.fsproj
let processResult =
DotNet.exec (dtntWorkDir root) "src/test/Fake.Core.UnitTests/bin/Release/netcoreapp2.0/Fake.Core.UnitTests.dll" "--summary"
if processResult.ExitCode <> 0 then failwithf "Unit-Tests failed."
// dotnet run --project src/test/Fake.Core.CommandLine.UnitTests/Fake.Core.CommandLine.UnitTests.fsproj
let processResult =
DotNet.exec (dtntWorkDir root) "src/test/Fake.Core.CommandLine.UnitTests/bin/Release/netcoreapp2.0/Fake.Core.CommandLine.UnitTests.dll" "--summary"
if processResult.ExitCode <> 0 then failwithf "Unit-Tests for Fake.Core.CommandLine failed."
)
Target.create "BootstrapTest" (fun _ ->
let buildScript = "build.fsx"
let testScript = "testbuild.fsx"
// Check if we can build ourself with the new binaries.
let test clearCache (script:string) =
let clear () =
// Will make sure the test call actually compiles the script.
// Note: We cannot just clean .fake here as it might be locked by the currently executing code :)
if Directory.Exists ".fake" then
Directory.EnumerateFiles(".fake")
|> Seq.filter (fun s -> (Path.GetFileName s).StartsWith script)
|> Seq.iter File.Delete
let executeTarget span target =
if clearCache then clear ()
if Environment.isUnix then
let result =
Process.execSimple (fun info ->
{ info with
FileName = "chmod"
WorkingDirectory = "."
Arguments = "+x build/FAKE.exe" }
|> Process.withFramework
) span
if result <> 0 then failwith "'chmod +x build/FAKE.exe' failed on unix"
Process.execSimple (fun info ->
{ info with
FileName = "build/FAKE.exe"
WorkingDirectory = "."
Arguments = sprintf "%s %s --fsiargs \"--define:BOOTSTRAP\"" script target }
|> Process.withFramework
|> Process.setEnvironmentVariable "FAKE_DETAILED_ERRORS" "true"
) span
let result = executeTarget (System.TimeSpan.FromMinutes 10.0) "PrintColors"
if result <> 0 then failwith "Bootstrapping failed"
let result = executeTarget (System.TimeSpan.FromMinutes 1.0) "FailFast"
if result = 0 then failwith "Bootstrapping failed"
// Replace the include line to use the newly build FakeLib, otherwise things will be weird.
File.ReadAllText buildScript
|> fun s -> s.Replace("#I \"packages/build/FAKE/tools/\"", "#I \"build/\"")
|> fun text -> File.WriteAllText(testScript, text)
try
// Will compile the script.
test true testScript
// Will use the compiled/cached version.
test false testScript
finally File.Delete(testScript)
)
Target.create "BootstrapTestDotNetCore" (fun _ ->
let buildScript = "build.fsx"
let testScript = "testbuild.fsx"
// Check if we can build ourself with the new binaries.
let test timeout clearCache script =
let clear () =
// Will make sure the test call actually compiles the script.
// Note: We cannot just clean .fake here as it might be locked by the currently executing code :)
[ ".fake/testbuild.fsx/packages"
".fake/testbuild.fsx/paket.depedencies.sha1"
".fake/testbuild.fsx/paket.lock"
"testbuild.fsx.lock" ]
|> List.iter Shell.rm_rf
// TODO: Clean a potentially cached dll as well.
let executeTarget target =
if clearCache then clear ()
let fileName =
if Environment.isUnix then "nuget/dotnetcore/Fake.netcore/current/fake"
else "nuget/dotnetcore/Fake.netcore/current/fake.exe"
Process.execSimple (fun info ->
{ info with
FileName = fileName
WorkingDirectory = "."
Arguments = sprintf "run --fsiargs \"--define:BOOTSTRAP\" %s --target %s" script target }
|> Process.setEnvironmentVariable "FAKE_DETAILED_ERRORS" "true"
)
timeout
//true (Trace.traceFAKE "%s") Trace.trace
let result = executeTarget "PrintColors"
if result <> 0 then failwithf "Bootstrapping failed (because of exitcode %d)" result
let result = executeTarget "FailFast"
if result = 0 then failwithf "Bootstrapping failed (because of exitcode %d)" result
// Replace the include line to use the newly build FakeLib, otherwise things will be weird.
// TODO: We might need another way, because currently we reference the same paket group?
File.ReadAllText buildScript
|> fun text -> File.WriteAllText(testScript, text)
try
// Will compile the script.
test (System.TimeSpan.FromMinutes 15.0) true testScript
// Will use the compiled/cached version.
test (System.TimeSpan.FromMinutes 3.0) false testScript
finally File.Delete(testScript)
)
Target.create "SourceLink" (fun _ ->
//#if !DOTNETCORE
// !! "src/app/**/*.fsproj"
// |> Seq.iter (fun f ->
// let proj = VsProj.LoadRelease f
// let url = sprintf "%s/%s/{0}/%%var2%%" gitRaw projectName
// SourceLink.Index proj.CompilesNotLinked proj.OutputFilePdb __SOURCE_DIRECTORY__ url )
// let pdbFakeLib = "./build/FakeLib.pdb"
// Shell.CopyFile "./build/FAKE.Deploy" pdbFakeLib
// Shell.CopyFile "./build/FAKE.Deploy.Lib" pdbFakeLib
//#else
printfn "We don't currently have VsProj.LoadRelease on dotnetcore."
//#endif
)
Target.create "ILRepack" (fun _ ->
Directory.ensure buildMergedDir
let internalizeIn filename =
let toPack =
[filename; "FSharp.Compiler.Service.dll"]
|> List.map (fun l -> buildDir </> l)
|> String.separated " "
let targetFile = buildMergedDir </> filename
let result =
Process.execSimple (fun info ->
{ info with
FileName = Directory.GetCurrentDirectory() </> "packages" </> "build" </> "ILRepack" </> "tools" </> "ILRepack.exe"
Arguments = sprintf "/verbose /lib:%s /ver:%s /out:%s %s" buildDir release.AssemblyVersion targetFile toPack }
) (System.TimeSpan.FromMinutes 5.)
if result <> 0 then failwithf "Error during ILRepack execution."
Shell.copyFile (buildDir </> filename) targetFile
internalizeIn "FAKE.exe"
!! (buildDir </> "FSharp.Compiler.Service.**")
|> Seq.iter File.delete
Shell.deleteDir buildMergedDir
)
Target.create "CreateNuGet" (fun _ ->
let path =
if Environment.isWindows
then "lib" @@ "corflags.exe"
else "lib" @@ "xCorFlags.exe"
let set64BitCorFlags files =
files
|> Seq.iter (fun file ->
let exitCode =
Process.execSimple (fun proc ->
{ proc with
FileName = Path.GetFullPath path
WorkingDirectory = Path.GetDirectoryName file
Arguments = "/32BIT- /32BITPREF- " + Process.quoteIfNeeded file
}
|> Process.withFramework) (System.TimeSpan.FromMinutes 1.)
if exitCode <> 0 then failwithf "corflags.exe failed with %d" exitCode)
let x64ify (package:NuGet.NuGet.NuGetParams) =
{ package with
Dependencies = package.Dependencies |> List.map (fun (pkg, ver) -> pkg + ".x64", ver)
Project = package.Project + ".x64" }
let nugetExe =
let pref = Path.GetFullPath "packages/build/NuGet.CommandLine/tools/NuGet.exe"
if File.Exists pref then pref
else
let rec printDir space d =
for f in Directory.EnumerateFiles d do
Trace.tracefn "%sFile: %s" space f
for sd in Directory.EnumerateDirectories d do
Trace.tracefn "%sDirectory: %s" space sd
printDir (space + " ") d
printDir " " (Path.GetFullPath "packages")
match !! "packages/**/NuGet.exe" |> Seq.tryHead with
| Some e ->
Trace.tracefn "Found %s" e
e
| None ->
pref
for package,description in packages do
let nugetDocsDir = nugetLegacyDir @@ "docs"
let nugetToolsDir = nugetLegacyDir @@ "tools"
let nugetLibDir = nugetLegacyDir @@ "lib"
let nugetLib451Dir = nugetLibDir @@ "net451"
Shell.cleanDir nugetDocsDir
Shell.cleanDir nugetToolsDir
Shell.cleanDir nugetLibDir
Shell.deleteDir nugetLibDir
File.delete "./build/FAKE.Gallio/Gallio.dll"
let deleteFCS _ =
//!! (dir </> "FSharp.Compiler.Service.**")
//|> Seq.iter DeleteFile
()
Directory.ensure docsDir
match package with
| p when p = projectName ->
!! (buildDir @@ "**/*.*") |> Shell.copy nugetToolsDir
Shell.copyDir nugetDocsDir docsDir FileFilter.allFiles
deleteFCS nugetToolsDir
| p when p = "FAKE.Core" ->
!! (buildDir @@ "*.*") |> Shell.copy nugetToolsDir
Shell.copyDir nugetDocsDir docsDir FileFilter.allFiles
deleteFCS nugetToolsDir
| p when p = "FAKE.Lib" ->
Shell.cleanDir nugetLib451Dir
{
Globbing.BaseDirectory = buildDir
Globbing.Includes = [ "FakeLib.dll"; "FakeLib.XML" ]
Globbing.Excludes = []
}
|> Shell.copy nugetLib451Dir
deleteFCS nugetLib451Dir
| _ ->
Shell.copyDir nugetToolsDir (buildDir @@ package) FileFilter.allFiles
Shell.copyTo nugetToolsDir additionalFiles
!! (nugetToolsDir @@ "*.srcsv") |> File.deleteAll
let setParams (p:NuGet.NuGet.NuGetParams) =
{p with
NuGet.NuGet.NuGetParams.ToolPath = nugetExe
NuGet.NuGet.NuGetParams.Authors = authors
NuGet.NuGet.NuGetParams.Project = package
NuGet.NuGet.NuGetParams.Description = description
NuGet.NuGet.NuGetParams.Version = nugetVersion
NuGet.NuGet.NuGetParams.OutputPath = nugetLegacyDir
NuGet.NuGet.NuGetParams.WorkingDir = nugetLegacyDir
NuGet.NuGet.NuGetParams.Summary = projectSummary
NuGet.NuGet.NuGetParams.ReleaseNotes = release.Notes |> String.toLines
NuGet.NuGet.NuGetParams.Dependencies =
(if package <> "FAKE.Core" && package <> projectName && package <> "FAKE.Lib" then
["FAKE.Core", NuGet.NuGet.RequireExactly (String.NormalizeVersion release.AssemblyVersion)]
else p.Dependencies )
NuGet.NuGet.NuGetParams.Publish = false }
NuGet.NuGet.NuGet setParams "fake.nuspec"
!! (nugetToolsDir @@ "FAKE.exe") |> set64BitCorFlags
NuGet.NuGet.NuGet (setParams >> x64ify) "fake.nuspec"
let legacyZip = "nuget/fake-legacy-packages.zip"
!! (nugetLegacyDir </> "**/*.nupkg")
|> Zip.zip nugetLegacyDir legacyZip
publish legacyZip
)
let netCoreProjs =
!! (appDir </> "*/*.fsproj")
let runtimes =
[ "win7-x86"; "win7-x64"; "osx.10.11-x64"; "ubuntu.14.04-x64"; "ubuntu.16.04-x64" ]
module CircleCi =
let isCircleCi = Environment.environVarAsBool "CIRCLECI"
// Create target for each runtime
let info = lazy DotNet.info dtntSmpl
runtimes
|> List.map Some
|> (fun rs -> None :: rs)
|> Seq.iter (fun runtime ->
let runtimeName, runtime =
match runtime with
| Some r -> r, lazy r
| None -> "current", lazy info.Value.RID
let targetName = sprintf "_DotNetPublish_%s" runtimeName