Skip to content

Commit d5fb0de

Browse files
upgraded project to use the new dotnet 3.1 sdk
1 parent 5d40756 commit d5fb0de

16 files changed

Lines changed: 1096 additions & 278 deletions

.config/dotnet-tools.json

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
{
2+
"version": 1,
3+
"isRoot": true,
4+
"tools": {
5+
"fake-cli": {
6+
"version": "5.19.0",
7+
"commands": [
8+
"fake"
9+
]
10+
},
11+
"paket": {
12+
"version": "5.241.2",
13+
"commands": [
14+
"paket"
15+
]
16+
}
17+
}
18+
}

.gitignore

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -186,4 +186,6 @@ docs/content/license.md
186186
docs/content/release-notes.md
187187
.svn
188188
/fragments
189-
.fake/build.*
189+
190+
.fake
191+
.ionide

.paket/Paket.Restore.targets

Lines changed: 183 additions & 78 deletions
Large diffs are not rendered by default.

.paket/paket.exe

-62.8 KB
Binary file not shown.

.paket/paket.targets

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

build.cmd

Lines changed: 3 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,4 @@
1-
@echo off
2-
cls
1+
echo Restoring dotnet tools...
2+
dotnet tool restore
33

4-
.paket\paket.exe restore
5-
if errorlevel 1 (
6-
exit /b %errorlevel%
7-
)
8-
9-
packages\build\FAKE\tools\FAKE.exe build.fsx %*
4+
dotnet fake build

build.fsx

Lines changed: 41 additions & 48 deletions
Original file line numberDiff line numberDiff line change
@@ -2,78 +2,71 @@
22
// FAKE build script
33
// --------------------------------------------------------------------------------------
44

5-
#r "./packages/build/FAKE/tools/FakeLib.dll"
5+
#load ".fake/build.fsx/intellisense.fsx"
6+
7+
#if !FAKE
8+
#r "netstandard"
9+
#endif
610

7-
open Fake
811
open System
912

13+
open Fake.SystemHelper
14+
open Fake.Core
15+
open Fake.DotNet
16+
open Fake.Tools
17+
open Fake.IO
18+
open Fake.IO.FileSystemOperators
19+
open Fake.IO.Globbing.Operators
20+
open Fake.Core.TargetOperators
21+
open Fake.Api
22+
1023
// --------------------------------------------------------------------------------------
1124
// Build variables
1225
// --------------------------------------------------------------------------------------
1326

1427
let buildDir = "./build/"
15-
let appReferences = !! "/**/*.fsproj"
16-
let dotnetcliVersion = "2.1.4"
17-
let mutable dotnetExePath = "dotnet"
18-
19-
// --------------------------------------------------------------------------------------
20-
// Helpers
21-
// --------------------------------------------------------------------------------------
22-
23-
let run' timeout cmd args dir =
24-
if execProcess (fun info ->
25-
info.FileName <- cmd
26-
if not (String.IsNullOrWhiteSpace dir) then
27-
info.WorkingDirectory <- dir
28-
info.Arguments <- args
29-
) timeout |> not then
30-
failwithf "Error while running '%s' with args: %s" cmd args
31-
32-
let run = run' System.TimeSpan.MaxValue
33-
34-
let runDotnet workingDir args =
35-
let result =
36-
ExecProcess (fun info ->
37-
info.FileName <- dotnetExePath
38-
info.WorkingDirectory <- workingDir
39-
info.Arguments <- args) TimeSpan.MaxValue
40-
if result <> 0 then failwithf "dotnet %s failed" args
28+
let dotnetSdkVersion = "3.1.101"
4129

4230
// --------------------------------------------------------------------------------------
4331
// Targets
4432
// --------------------------------------------------------------------------------------
4533

46-
Target "Clean" (fun _ ->
47-
CleanDirs [buildDir]
34+
Target.create "Clean" (fun _ ->
35+
[buildDir]
36+
|> Shell.cleanDirs
4837
)
4938

50-
Target "InstallDotNetCLI" (fun _ ->
51-
dotnetExePath <- DotNetCli.InstallDotNetSDK dotnetcliVersion
39+
// Lazily install DotNet SDK in the correct version if not available
40+
let installedSdk =
41+
lazy DotNet.install (fun cfg ->
42+
{ cfg with
43+
Version = DotNet.CliVersion.Version dotnetSdkVersion
44+
})
45+
46+
// Set general properties without arguments
47+
let inline setDotNetOptions arg = DotNet.Options.lift installedSdk.Value arg
48+
49+
Target.create "InstallDotNetCLI" (fun _ ->
50+
installedSdk.Force()
51+
|> ignore
5252
)
5353

54-
Target "Restore" (fun _ ->
55-
appReferences
56-
|> Seq.iter (fun p ->
57-
let dir = System.IO.Path.GetDirectoryName p
58-
runDotnet dir "restore"
59-
)
54+
Target.create "Restore" (fun _ ->
55+
DotNet.restore setDotNetOptions "DomainModelingMadeFunctional.sln"
6056
)
6157

62-
Target "Build" (fun _ ->
63-
appReferences
64-
|> Seq.iter (fun p ->
65-
let dir = System.IO.Path.GetDirectoryName p
66-
runDotnet dir "build"
67-
)
58+
Target.create "Build" (fun _ ->
59+
DotNet.exec setDotNetOptions "build" "DomainModelingMadeFunctional.sln"
60+
|> ignore
6861
)
6962

7063
// --------------------------------------------------------------------------------------
7164
// Build order
7265
// --------------------------------------------------------------------------------------
7366

7467
"Clean"
75-
==> "InstallDotNetCLI"
76-
==> "Restore"
77-
==> "Build"
68+
==> "InstallDotNetCLI"
69+
==> "Restore"
70+
==> "Build"
7871

79-
RunTargetOrDefault "Build"
72+
Target.runOrDefaultWithArguments "Build"

build.sh

Lines changed: 7 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,9 @@
1-
#!/bin/bash
2-
if test "$OS" = "Windows_NT"
3-
then
4-
# use .Net
1+
#!/usr/bin/env bash
52

6-
.paket/paket.exe restore
7-
exit_code=$?
8-
if [ $exit_code -ne 0 ]; then
9-
exit $exit_code
10-
fi
3+
set -eu
4+
set -o pipefail
115

12-
packages/build/FAKE/tools/FAKE.exe $@ --fsiargs build.fsx
13-
else
14-
# use mono
15-
mono .paket/paket.exe restore
16-
exit_code=$?
17-
if [ $exit_code -ne 0 ]; then
18-
exit $exit_code
19-
fi
20-
mono packages/build/FAKE/tools/FAKE.exe $@ --fsiargs -d:MONO build.fsx
21-
fi
6+
echo "Restoring dotnet tools..."
7+
dotnet tool restore
8+
9+
FAKE_DETAILED_ERRORS=true dotnet fake build

global.json

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

netfx.props

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

0 commit comments

Comments
 (0)