Skip to content

Commit 0639247

Browse files
authored
Merge pull request #7 from TypedUseCase/feature/udpate-dependencies
Update dependencies
2 parents ee98907 + 063df70 commit 0639247

File tree

6 files changed

+100
-149
lines changed

6 files changed

+100
-149
lines changed

.config/dotnet-tools.json

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,12 @@
1313
"commands": [
1414
"paket"
1515
]
16+
},
17+
"dotnet-fsharplint": {
18+
"version": "0.19.2",
19+
"commands": [
20+
"dotnet-fsharplint"
21+
]
1622
}
1723
}
1824
}

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22

33
<!-- There is always Unreleased section on the top. Subsections (Add, Changed, Fix, Removed) should be Add as needed. -->
44
## Unreleased
5+
- Update dependencies
56

67
## 4.0.0 - 2021-06-08
78
- Update to net5.0 and use F# 5.0

build.fsx

Lines changed: 57 additions & 102 deletions
Original file line numberDiff line numberDiff line change
@@ -9,14 +9,8 @@ open Fake.IO.Globbing.Operators
99
open Fake.Core.TargetOperators
1010
open Fake.Tools.Git
1111

12-
type ToolDir =
13-
/// Global tool dir must be in PATH - ${PATH}:/root/.dotnet/tools
14-
| Global
15-
/// Just a dir name, the location will be used as: ./{LocalDirName}
16-
| Local of string
17-
1812
// ========================================================================================================
19-
// === F# / Public Library fake build ============================================================= 1.1.0 =
13+
// === F# / Public Library fake build ============================================================= 2.0.0 =
2014
// --------------------------------------------------------------------------------------------------------
2115
// Options:
2216
// - no-clean - disables clean of dirs in the first step (required on CI)
@@ -36,12 +30,10 @@ type ToolDir =
3630
let project = "Tuc Parser"
3731
let summary = "A parser for TUC files."
3832

39-
let release = ReleaseNotes.parse (System.IO.File.ReadAllLines "CHANGELOG.md" |> Seq.filter ((<>) "## Unreleased"))
33+
let changeLog = "CHANGELOG.md"
4034
let gitCommit = Information.getCurrentSHA1(".")
4135
let gitBranch = Information.getBranchName(".")
4236

43-
let toolsDir = Local "tools"
44-
4537
// --------------------------------------------------------------------------------------------------------
4638
// 2. Utilities, DotnetCore functions, etc.
4739
// --------------------------------------------------------------------------------------------------------
@@ -57,63 +49,45 @@ module private Utils =
5749
then Trace.tracefn "Skipped ..."
5850
else action p
5951

60-
module private DotnetCore =
61-
let run cmd workingDir =
62-
let options =
63-
DotNet.Options.withWorkingDirectory workingDir
64-
>> DotNet.Options.withRedirectOutput true
52+
let createProcess exe arg dir =
53+
CreateProcess.fromRawCommandLine exe arg
54+
|> CreateProcess.withWorkingDirectory dir
55+
|> CreateProcess.ensureExitCode
6556

66-
DotNet.exec options cmd ""
67-
68-
let runOrFail cmd workingDir =
69-
run cmd workingDir
70-
|> tee (fun result ->
71-
if result.ExitCode <> 0 then failwithf "'dotnet %s' failed in %s" cmd workingDir
72-
)
57+
let run proc arg dir =
58+
proc arg dir
59+
|> Proc.run
7360
|> ignore
7461

75-
let runInRoot cmd = run cmd "."
76-
let runInRootOrFail cmd = runOrFail cmd "."
77-
78-
let installOrUpdateTool toolDir tool =
79-
let toolCommand action =
80-
match toolDir with
81-
| Global -> sprintf "tool %s --global %s" action tool
82-
| Local dir -> sprintf "tool %s --tool-path ./%s %s" action dir tool
83-
84-
match runInRoot (toolCommand "install") with
85-
| { ExitCode = code } when code <> 0 ->
86-
match runInRoot (toolCommand "update") with
87-
| { ExitCode = code } when code <> 0 -> Trace.tracefn "Warning: Install and update of %A has failed." tool
88-
| _ -> ()
89-
| _ -> ()
90-
91-
let execute command args (dir: string) =
92-
let cmd =
93-
sprintf "%s/%s"
94-
(dir.TrimEnd('/'))
95-
command
96-
97-
let processInfo = System.Diagnostics.ProcessStartInfo(cmd)
98-
processInfo.RedirectStandardOutput <- true
99-
processInfo.RedirectStandardError <- true
100-
processInfo.UseShellExecute <- false
101-
processInfo.CreateNoWindow <- true
102-
processInfo.Arguments <- args |> String.concat " "
103-
104-
use proc =
105-
new System.Diagnostics.Process(
106-
StartInfo = processInfo
107-
)
108-
if proc.Start() |> not then failwith "Process was not started."
109-
proc.WaitForExit()
110-
111-
if proc.ExitCode <> 0 then failwithf "Command '%s' failed in %s." command dir
112-
(proc.StandardOutput.ReadToEnd(), proc.StandardError.ReadToEnd())
113-
114-
let stringToOption = function
115-
| null | "" -> None
116-
| string -> Some string
62+
let orFail = function
63+
| Error e -> raise e
64+
| Ok ok -> ok
65+
66+
let stringToOption = function
67+
| null | "" -> None
68+
| string -> Some string
69+
70+
[<RequireQualifiedAccess>]
71+
module Dotnet =
72+
let dotnet = createProcess "dotnet"
73+
74+
let run command dir = try run dotnet command dir |> Ok with e -> Error e
75+
let runInRoot command = run command "."
76+
let runOrFail command dir = run command dir |> orFail
77+
78+
[<RequireQualifiedAccess>]
79+
module ProjectSources =
80+
let library =
81+
!! "./*.fsproj"
82+
++ "src/*.fsproj"
83+
++ "src/**/*.fsproj"
84+
85+
let tests =
86+
!! "tests/*.fsproj"
87+
88+
let all =
89+
library
90+
++ "tests/*.fsproj"
11791

11892
// --------------------------------------------------------------------------------------------------------
11993
// 3. Targets for FAKE
@@ -130,6 +104,7 @@ Target.create "Clean" <| skipOn "no-clean" (fun _ ->
130104
Target.create "AssemblyInfo" (fun _ ->
131105
let getAssemblyInfoAttributes projectName =
132106
let now = DateTime.Now
107+
let release = ReleaseNotes.parse (System.IO.File.ReadAllLines changeLog |> Seq.filter ((<>) "## Unreleased"))
133108

134109
let gitValue initialValue =
135110
initialValue
@@ -149,65 +124,45 @@ Target.create "AssemblyInfo" (fun _ ->
149124
]
150125

151126
let getProjectDetails (projectPath: string) =
152-
let projectName = IO.Path.GetFileNameWithoutExtension(projectPath)
127+
let projectName = System.IO.Path.GetFileNameWithoutExtension(projectPath)
153128
(
154129
projectPath,
155130
projectName,
156-
IO.Path.GetDirectoryName(projectPath),
131+
System.IO.Path.GetDirectoryName(projectPath),
157132
(getAssemblyInfoAttributes projectName)
158133
)
159134

160-
!! "**/*.fsproj"
161-
-- "example/**/*.*proj"
135+
ProjectSources.all
162136
|> Seq.map getProjectDetails
163137
|> Seq.iter (fun (_, _, folderName, attributes) ->
164138
AssemblyInfoFile.createFSharp (folderName </> "AssemblyInfo.fs") attributes
165139
)
166140
)
167141

168142
Target.create "Build" (fun _ ->
169-
!! "**/*.fsproj"
170-
-- "example/**/*.*proj"
143+
ProjectSources.library
144+
|> Seq.iter (DotNet.build id)
145+
)
146+
147+
Target.create "BuildTests" (fun _ ->
148+
ProjectSources.tests
171149
|> Seq.iter (DotNet.build id)
172150
)
173151

174152
Target.create "Lint" <| skipOn "no-lint" (fun _ ->
175-
DotnetCore.installOrUpdateTool toolsDir ("dotnet-fsharplint")
176-
177-
let checkResult (messages: string list) =
178-
let rec check: string list -> unit = function
179-
| [] -> failwithf "Lint does not yield a summary."
180-
| head :: rest ->
181-
if head.Contains "Summary" then
182-
match head.Replace("= ", "").Replace(" =", "").Replace("=", "").Replace("Summary: ", "") with
183-
| "0 warnings" -> Trace.tracefn "Lint: OK"
184-
| warnings -> failwithf "Lint ends up with %s." warnings
185-
else check rest
186-
messages
187-
|> List.rev
188-
|> check
189-
190-
!! "**/*.*proj"
191-
-- "example/**/*.*proj"
192-
|> Seq.map (fun fsproj ->
193-
match toolsDir with
194-
| Global ->
195-
DotnetCore.runInRoot (sprintf "fsharplint lint %s" fsproj)
196-
|> fun (result: ProcessResult) -> result.Messages
197-
| Local dir ->
198-
DotnetCore.execute "dotnet-fsharplint" ["lint"; fsproj] dir
199-
|> fst
200-
|> tee (Trace.tracefn "%s")
201-
|> String.split '\n'
202-
|> Seq.toList
153+
ProjectSources.all
154+
++ "./Build.fsproj"
155+
|> Seq.iter (fun fsproj ->
156+
match Dotnet.runInRoot (sprintf "fsharplint lint %s" fsproj) with
157+
| Ok () -> Trace.tracefn "Lint %s is Ok" fsproj
158+
| Error e -> raise e
203159
)
204-
|> Seq.iter checkResult
205160
)
206161

207162
Target.create "Tests" (fun _ ->
208-
if !! "tests/*.fsproj" |> Seq.isEmpty
163+
if ProjectSources.tests |> Seq.isEmpty
209164
then Trace.tracefn "There are no tests yet."
210-
else DotnetCore.runOrFail "run" "tests"
165+
else Dotnet.runOrFail "run" "tests"
211166
)
212167

213168
Target.create "Release" (fun _ ->
@@ -242,7 +197,7 @@ Target.create "Release" (fun _ ->
242197

243198
"Clean"
244199
==> "AssemblyInfo"
245-
==> "Build"
200+
==> "Build" <=> "BuildTests"
246201
==> "Lint"
247202
==> "Tests"
248203
==> "Release"

paket.dependencies

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -5,13 +5,10 @@ source https://api.nuget.org/v3/index.json
55
nuget FSharp.Core ~> 5.0
66
nuget FSharp.Data ~> 4.1
77
nuget MF.ConsoleApplication ~> 2.0
8-
nuget Tuc.DomainResolver ~> 2.0
8+
nuget Tuc.DomainResolver ~> 2.1
99

10-
group Tests
11-
storage: none
12-
source https://api.nuget.org/v3/index.json
13-
nuget Expecto
14-
nuget YoloDev.Expecto.TestSdk
10+
nuget Expecto
11+
nuget YoloDev.Expecto.TestSdk
1512

1613
// [ FAKE GROUP ]
1714
group Build

paket.lock

Lines changed: 31 additions & 38 deletions
Original file line numberDiff line numberDiff line change
@@ -20,11 +20,14 @@ NUGET
2020
Colorful.Console (>= 1.2.10)
2121
FSharp.Core (>= 4.7)
2222
ShellProgressBar (>= 4.3)
23-
FSharp.Compiler.Service (39.0)
24-
FSharp.Core (5.0.1)
25-
Microsoft.Build.Framework (>= 16.6)
26-
Microsoft.Build.Tasks.Core (>= 16.6)
27-
Microsoft.Build.Utilities.Core (>= 16.6)
23+
Expecto (9.0.2)
24+
FSharp.Core (>= 4.6)
25+
Mono.Cecil (>= 0.11.2)
26+
FSharp.Compiler.Service (40.0)
27+
FSharp.Core (5.0.2)
28+
Microsoft.Build.Framework (>= 16.9)
29+
Microsoft.Build.Tasks.Core (>= 16.9)
30+
Microsoft.Build.Utilities.Core (>= 16.9)
2831
System.Buffers (>= 4.5.1)
2932
System.Collections.Immutable (>= 5.0)
3033
System.Diagnostics.Process (>= 4.3)
@@ -46,8 +49,8 @@ NUGET
4649
System.Threading.Tasks.Parallel (>= 4.3)
4750
System.Threading.Thread (>= 4.3)
4851
System.Threading.ThreadPool (>= 4.3)
49-
FSharp.Core (5.0.1)
50-
FSharp.Data (4.1.1)
52+
FSharp.Core (5.0.2)
53+
FSharp.Data (4.2.2)
5154
FSharp.Core (>= 4.7.2)
5255
MF.ConsoleApplication (2.0)
5356
ConsoleStyle (>= 2.0)
@@ -90,6 +93,7 @@ NUGET
9093
System.Security.Principal.Windows (>= 5.0)
9194
Microsoft.Win32.SystemEvents (5.0)
9295
Microsoft.NETCore.Platforms (>= 5.0)
96+
Mono.Cecil (0.11.4)
9397
runtime.debian.8-x64.runtime.native.System.Security.Cryptography.OpenSsl (4.3.3)
9498
runtime.debian.9-x64.runtime.native.System.Security.Cryptography.OpenSsl (4.3.3)
9599
runtime.fedora.23-x64.runtime.native.System.Security.Cryptography.OpenSsl (4.3.3)
@@ -579,11 +583,15 @@ NUGET
579583
System.Runtime.Handles (>= 4.3)
580584
System.Windows.Extensions (5.0)
581585
System.Drawing.Common (>= 5.0)
582-
Tuc.DomainResolver (2.0)
583-
FSharp.Compiler.Service (>= 39.0)
584-
FSharp.Core (>= 5.0.1)
585-
FSharp.Data (>= 4.1.1)
586+
Tuc.DomainResolver (2.1)
587+
FSharp.Compiler.Service (>= 40.0)
588+
FSharp.Core (>= 5.0.2)
589+
FSharp.Data (>= 4.2.2)
586590
MF.ConsoleApplication (>= 2.0)
591+
YoloDev.Expecto.TestSdk (0.12.5)
592+
Expecto (>= 9.0 < 10.0)
593+
FSharp.Core (>= 4.6)
594+
System.Collections.Immutable (>= 1.5 < 5.1)
587595

588596
GROUP Build
589597
STORAGE: NONE
@@ -700,7 +708,7 @@ NUGET
700708
FSharp.Control.Reactive (5.0.2) - restriction: >= netstandard2.0
701709
FSharp.Core (>= 4.7.2) - restriction: >= netstandard2.0
702710
System.Reactive (>= 5.0) - restriction: >= netstandard2.0
703-
FSharp.Core (5.0.1) - restriction: >= netstandard2.0
711+
FSharp.Core (5.0.2) - restriction: >= netstandard2.0
704712
Microsoft.Bcl.AsyncInterfaces (5.0) - restriction: || (&& (>= monoandroid) (>= net50) (< netcoreapp2.0)) (&& (< monoandroid) (>= net50) (< netcoreapp2.0) (< xamarinios) (< xamarinmac) (< xamarintvos) (< xamarinwatchos)) (&& (< monoandroid) (>= net50) (< netcoreapp2.1) (< xamarinios) (< xamarinmac) (< xamarintvos) (< xamarinwatchos)) (&& (< monoandroid) (>= net50) (< netcoreapp3.0) (< xamarinios) (< xamarinmac) (< xamarintvos) (< xamarinwatchos)) (&& (>= monotouch) (>= net50)) (&& (>= net461) (>= net50)) (>= net472) (&& (>= net50) (< netcoreapp2.0) (>= xamarinios)) (&& (>= net50) (< netcoreapp2.0) (>= xamarinmac)) (&& (>= net50) (< netstandard2.0) (>= xamarintvos)) (&& (>= net50) (< netstandard2.0) (>= xamarinwatchos)) (&& (>= net50) (>= uap10.1))
705713
System.Threading.Tasks.Extensions (>= 4.5.4) - restriction: || (>= net461) (&& (< netcoreapp2.1) (>= netstandard2.0) (< netstandard2.1))
706714
Microsoft.Build (16.10) - restriction: >= netstandard2.0
@@ -761,21 +769,21 @@ NUGET
761769
Microsoft.Build.Tasks.Core (>= 16.4) - restriction: >= netstandard2.0
762770
Microsoft.Build.Utilities.Core (>= 16.4) - restriction: >= netstandard2.0
763771
Newtonsoft.Json (13.0.1) - restriction: >= netstandard2.0
764-
NuGet.Common (5.9.1) - restriction: >= netstandard2.0
765-
NuGet.Frameworks (>= 5.9.1) - restriction: || (>= net45) (>= netstandard2.0)
766-
NuGet.Configuration (5.9.1) - restriction: >= netstandard2.0
767-
NuGet.Common (>= 5.9.1) - restriction: || (>= net45) (>= netstandard2.0)
772+
NuGet.Common (5.10) - restriction: >= netstandard2.0
773+
NuGet.Frameworks (>= 5.10) - restriction: || (>= net45) (>= netstandard2.0)
774+
NuGet.Configuration (5.10) - restriction: >= netstandard2.0
775+
NuGet.Common (>= 5.10) - restriction: || (>= net45) (>= netstandard2.0)
768776
System.Security.Cryptography.ProtectedData (>= 4.4) - restriction: && (< net45) (>= netstandard2.0)
769-
NuGet.Frameworks (5.9.1) - restriction: >= netstandard2.0
770-
NuGet.Packaging (5.9.1) - restriction: >= netstandard2.0
777+
NuGet.Frameworks (5.10) - restriction: >= netstandard2.0
778+
NuGet.Packaging (5.10) - restriction: >= netstandard2.0
771779
Newtonsoft.Json (>= 9.0.1) - restriction: >= netstandard2.0
772-
NuGet.Configuration (>= 5.9.1) - restriction: >= netstandard2.0
773-
NuGet.Versioning (>= 5.9.1) - restriction: >= netstandard2.0
780+
NuGet.Configuration (>= 5.10) - restriction: >= netstandard2.0
781+
NuGet.Versioning (>= 5.10) - restriction: >= netstandard2.0
774782
System.Security.Cryptography.Cng (>= 5.0) - restriction: || (&& (< net472) (>= netstandard2.0)) (>= net50)
775783
System.Security.Cryptography.Pkcs (>= 5.0) - restriction: || (&& (< net472) (>= netstandard2.0)) (>= net50)
776-
NuGet.Protocol (5.9.1) - restriction: >= netstandard2.0
777-
NuGet.Packaging (>= 5.9.1) - restriction: >= netstandard2.0
778-
NuGet.Versioning (5.9.1) - restriction: >= netstandard2.0
784+
NuGet.Protocol (5.10) - restriction: >= netstandard2.0
785+
NuGet.Packaging (>= 5.10) - restriction: >= netstandard2.0
786+
NuGet.Versioning (5.10) - restriction: >= netstandard2.0
779787
System.Buffers (4.5.1) - restriction: || (&& (>= monoandroid) (>= net50) (< netcoreapp2.0)) (&& (>= monoandroid) (< netcoreapp2.0) (>= netstandard2.0)) (&& (< monoandroid) (< net45) (< netcoreapp2.0) (>= netstandard2.0)) (&& (< monoandroid) (< net46) (< netcoreapp2.0) (>= netstandard2.0) (< netstandard2.1) (< xamarintvos) (< xamarinwatchos)) (&& (< monoandroid) (>= net50) (< netcoreapp2.0) (< xamarintvos) (< xamarinwatchos)) (&& (< monoandroid) (< netstandard1.1) (>= netstandard2.0) (< win8)) (&& (>= monotouch) (>= net50)) (&& (>= monotouch) (>= netstandard2.0)) (&& (>= net461) (>= net50)) (&& (>= net461) (>= netstandard2.0)) (>= net472) (&& (>= net50) (< netstandard2.0) (>= xamarintvos)) (&& (>= net50) (< netstandard2.0) (>= xamarinwatchos)) (&& (< netstandard1.1) (>= netstandard2.0) (>= win8)) (&& (>= netstandard2.0) (>= uap10.1)) (&& (>= netstandard2.0) (>= xamarintvos)) (&& (>= netstandard2.0) (>= xamarinwatchos)) (>= xamarinios) (>= xamarinmac)
780788
System.CodeDom (5.0) - restriction: && (< net472) (>= netstandard2.0)
781789
System.Collections.Immutable (5.0) - restriction: >= netstandard2.0
@@ -854,18 +862,3 @@ NUGET
854862
System.ValueTuple (4.5) - restriction: || (&& (>= net45) (>= netstandard2.0)) (&& (>= net461) (>= net50)) (>= net472)
855863
System.Windows.Extensions (5.0) - restriction: >= netcoreapp3.0
856864
System.Drawing.Common (>= 5.0) - restriction: >= netcoreapp3.0
857-
858-
GROUP Tests
859-
STORAGE: NONE
860-
NUGET
861-
remote: https://api.nuget.org/v3/index.json
862-
Expecto (9.0.2)
863-
FSharp.Core (>= 4.6) - restriction: || (>= net461) (>= netstandard2.0)
864-
Mono.Cecil (>= 0.11.2) - restriction: || (>= net461) (>= netstandard2.0)
865-
FSharp.Core (5.0.1) - restriction: || (>= net461) (>= netstandard2.0)
866-
Mono.Cecil (0.11.3) - restriction: || (>= net461) (>= netstandard2.0)
867-
System.Collections.Immutable (5.0) - restriction: >= netcoreapp2.1
868-
YoloDev.Expecto.TestSdk (0.11.1)
869-
Expecto (>= 9.0 < 10.0) - restriction: >= netcoreapp2.1
870-
FSharp.Core (>= 4.6) - restriction: >= netcoreapp2.1
871-
System.Collections.Immutable (>= 1.5 < 5.1) - restriction: >= netcoreapp2.1

tests/paket.references

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
FSharp.Core
22

3-
group Tests
4-
Expecto
5-
YoloDev.Expecto.TestSdk
3+
Expecto
4+
YoloDev.Expecto.TestSdk

0 commit comments

Comments
 (0)