Skip to content

Commit 95e668f

Browse files
authored
Migrate to fake project and drop .net6 dependency (#311)
* Migrate from Fake CLI to Fake build project * Upgrade build project to .net8 and latest Fake packages
1 parent afd84a8 commit 95e668f

9 files changed

Lines changed: 38 additions & 298 deletions

File tree

‎.config/dotnet-tools.json‎

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -8,12 +8,6 @@
88
"paket"
99
]
1010
},
11-
"fake-cli": {
12-
"version": "6.1.3",
13-
"commands": [
14-
"fake"
15-
]
16-
},
1711
"fsdocs-tool": {
1812
"version": "19.1.1",
1913
"commands": [
@@ -27,4 +21,4 @@
2721
]
2822
}
2923
}
30-
}
24+
}

‎.github/workflows/main.yml‎

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -24,14 +24,11 @@ jobs:
2424
- name: Setup .NET Core
2525
uses: actions/setup-dotnet@v3
2626
with:
27-
# FAKE 6 needs the .NET 6 SDK alongside the .NET 8 project SDK.
28-
dotnet-version: |
29-
6.0.428
30-
${{ matrix.dotnet }}
27+
dotnet-version: ${{ matrix.dotnet }}
3128

3229
- name: Install local tools
3330
run: dotnet tool restore
3431
- name: Paket Restore
3532
run: dotnet paket restore
3633
- name: Build and Test
37-
run: dotnet fake run build.fsx
34+
run: dotnet run --project build/build.fsproj

‎.gitignore‎

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -75,6 +75,7 @@ _ReSharper*/
7575
# Build Output
7676
pkg
7777
[Bb]uild
78+
!/build/
7879

7980

8081
# ===================================================
@@ -114,4 +115,4 @@ FsUnit.Xunit.Test.dll.xunit.html
114115
NUnit.xml
115116
xunit.html
116117

117-
release.sh
118+
release.sh

‎FsUnit.sln‎

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,6 @@ EndProject
1010
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "global", "global", "{35F65EEF-9059-4829-93EE-C8F7810B3997}"
1111
ProjectSection(SolutionItems) = preProject
1212
build.cmd = build.cmd
13-
build.fsx = build.fsx
1413
build.sh = build.sh
1514
paket.dependencies = paket.dependencies
1615
paket.lock = paket.lock

‎build.cmd‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,4 +3,4 @@ cls
33

44
dotnet tool restore
55
dotnet paket restore
6-
dotnet fake run build.fsx %*
6+
dotnet run --project build/build.fsproj -- %*

‎build.fsx.lock‎

Lines changed: 0 additions & 263 deletions
This file was deleted.

‎build.sh‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,4 +2,4 @@
22

33
dotnet tool restore
44
dotnet paket restore
5-
dotnet fake run build.fsx $@
5+
dotnet run --project build/build.fsproj -- "$@"

build.fsx renamed to build/build.fs

Lines changed: 9 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,4 @@
1-
#r @"paket:
2-
source https://api.nuget.org/v3/index.json
3-
framework: net6.0
4-
nuget FSharp.Core 6.0.0.0
5-
nuget Fake.Core.Target
6-
nuget Fake.Core.Trace
7-
nuget Fake.Core.ReleaseNotes
8-
nuget Fake.IO.FileSystem
9-
nuget Fake.DotNet.Cli
10-
nuget Fake.DotNet.MSBuild
11-
nuget Fake.DotNet.AssemblyInfoFile
12-
nuget Fake.DotNet.Paket
13-
nuget Fake.DotNet.Fsi
14-
nuget Fake.Tools.Git
15-
nuget Fake.Api.GitHub //"
16-
17-
#load "./.fake/build.fsx/intellisense.fsx"
1+
module Build
182

193
open Fake.Core
204
open Fake.Core.TargetOperators
@@ -25,7 +9,8 @@ open Fake.DotNet
259
open Fake.Tools.Git
2610
open System.IO
2711

28-
Target.initEnvironment()
12+
let execContext = Context.FakeExecutionContext.Create false "build.fs" []
13+
Context.setExecutionContext (Context.RuntimeContext.Fake execContext)
2914

3015
// --------------------------------------------------------------------------------------
3116
// Project-specific details below
@@ -252,4 +237,9 @@ Target.create "Release" ignore
252237
==> "ReleaseDocs"
253238
==> "Release"
254239

255-
Target.runOrDefault "All"
240+
[<EntryPoint>]
241+
let main args =
242+
match args with
243+
| [| target |] -> Target.runOrDefault target
244+
| _ -> Target.runOrDefault "All"
245+
0

0 commit comments

Comments
 (0)