Skip to content

Update dependencies. #231

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 8 commits into from
May 6, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions .config/dotnet-tools.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,25 +3,25 @@
"isRoot": true,
"tools": {
"paket": {
"version": "7.2.0",
"version": "7.2.1",
"commands": [
"paket"
]
},
"fake-cli": {
"version": "5.23.1",
"version": "6.0.0",
"commands": [
"fake"
]
},
"fsdocs-tool": {
"version": "17.2.0",
"version": "18.1.0",
"commands": [
"fsdocs"
]
},
"fantomas": {
"version": "5.1.5",
"version": "6.0.2",
"commands": [
"fantomas"
]
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ jobs:
fail-fast: false
matrix:
os: [windows-latest, macOS-latest, ubuntu-latest]
dotnet: [7.0.101]
dotnet: [6.0.408]
runs-on: ${{ matrix.os }}

steps:
Expand Down
4 changes: 4 additions & 0 deletions RELEASE_NOTES.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
### 5.3.0.0 - May 6, 2023
- Remove .NET7 as framework because of incompatibilities.
- Update dependencies.

### 5.2.0 - Jan 13, 2023
- Align should & throw in xUnit and MsTest. -> (https://github.com/fsprojects/FsUnit/pull/226)
- Add .NET7 as TargetFramework.
Expand Down
110 changes: 50 additions & 60 deletions build.fsx
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
#r @"paket:
source https://api.nuget.org/v3/index.json
framework: net6.0
storage: none
nuget FSharp.Core
nuget FSharp.Core 6.0.0.0
nuget Fake.Core.Target
nuget Fake.Core.Trace
nuget Fake.Core.ReleaseNotes
Expand Down Expand Up @@ -67,29 +66,25 @@ let cloneUrl = "[email protected]:fsprojects/FsUnit.git"
let release = ReleaseNotes.load "RELEASE_NOTES.md"

// Helper active pattern for project types
let (|Fsproj|Csproj|Vbproj|) (projFileName:string) =
let (|Fsproj|Csproj|Vbproj|) (projFileName: string) =
match projFileName with
| f when f.EndsWith("fsproj") -> Fsproj
| f when f.EndsWith("csproj") -> Csproj
| f when f.EndsWith("vbproj") -> Vbproj
| _ -> failwith (sprintf "Project file %s not supported. Unknown project type." projFileName)
| _ -> failwith (sprintf "Project file %s not supported. Unknown project type." projFileName)

// Generate assembly info files with the right version & up-to-date information
Target.create "AssemblyInfo" (fun _ ->
let getAssemblyInfoAttributes projectName =
[ AssemblyInfo.Title (projectName)
[ AssemblyInfo.Title(projectName)
AssemblyInfo.Product project
AssemblyInfo.Description summary
AssemblyInfo.Version release.AssemblyVersion
AssemblyInfo.FileVersion release.AssemblyVersion ]

let getProjectDetails (projectPath:string) =
let getProjectDetails (projectPath: string) =
let projectName = System.IO.Path.GetFileNameWithoutExtension(projectPath)
( projectPath,
projectName,
Path.GetDirectoryName(projectPath),
(getAssemblyInfoAttributes projectName)
)
(projectPath, projectName, Path.GetDirectoryName(projectPath), (getAssemblyInfoAttributes projectName))

!! "src/**/*.??proj"
|> Seq.filter (fun x -> not <| x.Contains(".netstandard"))
Expand All @@ -98,46 +93,39 @@ Target.create "AssemblyInfo" (fun _ ->
match projFileName with
| Fsproj -> AssemblyInfoFile.createFSharp (folderName @@ "AssemblyInfo.fs") attributes
| Csproj -> AssemblyInfoFile.createCSharp ((folderName @@ "Properties") @@ "AssemblyInfo.cs") attributes
| Vbproj -> AssemblyInfoFile.createVisualBasic ((folderName @@ "My Project") @@ "AssemblyInfo.vb") attributes
)
)
| Vbproj -> AssemblyInfoFile.createVisualBasic ((folderName @@ "My Project") @@ "AssemblyInfo.vb") attributes))

// Copies binaries from default VS location to expected bin folder
// But keeps a subdirectory structure for each project in the
// src folder to support multiple project outputs
Target.create "CopyBinaries" (fun _ ->
!! "src/**/*.??proj"
|> Seq.map (fun f -> ((Path.GetDirectoryName f) @@ "bin/Release", "bin" @@ (Path.GetFileNameWithoutExtension f)))
|> Seq.iter (fun (fromDir, toDir) -> Shell.copyDir toDir fromDir (fun _ -> true))
)
|> Seq.map (fun f -> ((Path.GetDirectoryName f) @@ "bin/Release", "bin" @@ (Path.GetFileNameWithoutExtension f)))
|> Seq.iter (fun (fromDir, toDir) -> Shell.copyDir toDir fromDir (fun _ -> true)))

// --------------------------------------------------------------------------------------
// Clean build results

Target.create "Clean" (fun _ ->
Shell.cleanDirs
[
"bin"; "temp";
"src/FsUnit.NUnit/bin/";
"src/FsUnit.NUnit/obj/";
"src/FsUnit.Xunit/bin/";
"src/FsUnit.Xunit/obj/";
"src/FsUnit.MsTestUnit/bin/"
"src/FsUnit.MsTestUnit/obj/"
]
)

Target.create "CleanDocs" (fun _ ->
Shell.cleanDirs ["docs/output"]
)
[ "bin"
"temp"
"src/FsUnit.NUnit/bin/"
"src/FsUnit.NUnit/obj/"
"src/FsUnit.Xunit/bin/"
"src/FsUnit.Xunit/obj/"
"src/FsUnit.MsTestUnit/bin/"
"src/FsUnit.MsTestUnit/obj/" ])

Target.create "CleanDocs" (fun _ -> Shell.cleanDirs [ "docs/output" ])

// --------------------------------------------------------------------------------------
// Check code format & format code using Fantomas

let sourceFiles =
!! "src/**/*.fs"
++ "tests/**/*.fs"
-- "./**/*Assembly*.fs"
++ "tests/**/*.fs"
-- "./**/*Assembly*.fs"

Target.create "CheckFormat" (fun _ ->
let result =
Expand All @@ -152,8 +140,7 @@ Target.create "CheckFormat" (fun _ ->
elif result.ExitCode = 99 then
failwith "Some files need formatting, check output for more info"
else
Trace.logf "Errors while formatting: %A" result.Errors
)
Trace.logf "Errors while formatting: %A" result.Errors)

Target.create "Format" (fun _ ->
let result =
Expand All @@ -163,62 +150,66 @@ Target.create "Format" (fun _ ->
|> DotNet.exec id "fantomas"

if not result.OK then
printfn "Errors while formatting all files: %A" result.Messages
)
printfn "Errors while formatting all files: %A" result.Messages)

// --------------------------------------------------------------------------------------
// Build library & test project

Target.create "Build" (fun _ ->
let result = DotNet.exec id "build" "FsUnit.sln -c Release"
if not result.OK
then failwithf "Build failed: %A" result.Errors
)

if not result.OK then
failwithf "Build failed: %A" result.Errors)

// --------------------------------------------------------------------------------------
// Run the unit tests using test runner

Target.create "NUnit" (fun _ ->
DotNet.test id "tests/FsUnit.NUnit.Test/"
)
let result = DotNet.exec id "test" "tests/FsUnit.NUnit.Test/"

Target.create "xUnit" (fun _ ->
DotNet.test id "tests/FsUnit.Xunit.Test/"
)
if not result.OK then
failwithf "NUnit test failed: %A" result.Errors)

Target.create "MsTest" (fun _ ->
DotNet.test id "tests/FsUnit.MsTest.Test/"
)
Target.create "xUnit" (fun _ ->
let result = DotNet.exec id "test" "tests/FsUnit.Xunit.Test/"

if not result.OK then
failwithf "xUnit test failed: %A" result.Errors)

Target.create "MsTest" (fun _ ->
let result = DotNet.exec id "test" "tests/FsUnit.MsTest.Test/"

if not result.OK then
failwithf "MsTest test failed: %A" result.Errors)

Target.create "RunTests" ignore

// --------------------------------------------------------------------------------------
// Build a NuGet package

Target.create "NuGet" (fun _ ->
Paket.pack(fun p ->
Paket.pack (fun p ->
{ p with
ToolType = ToolType.CreateLocalTool()
OutputPath = "bin"
Version = release.NugetVersion
ReleaseNotes = String.toLines release.Notes})
)
Version = release.AssemblyVersion
ReleaseNotes = String.toLines release.Notes }))

Target.create "PublishNuget" (fun _ ->
Paket.push(fun p ->
Paket.push (fun p ->
{ p with
ToolType = ToolType.CreateLocalTool()
WorkingDir = "bin" })
)
WorkingDir = "bin" }))


// --------------------------------------------------------------------------------------
// Generate the documentation

Target.create "GenerateDocs" (fun _ ->
Shell.cleanDir ".fsdocs"
DotNet.exec id "fsdocs" "build --clean --parameters root https://fsprojects.github.io/FsUnit" |> ignore
)
Shell.cleanDir ".fsdocs"

DotNet.exec id "fsdocs" "build --clean --parameters root https://fsprojects.github.io/FsUnit"
|> ignore)
// --------------------------------------------------------------------------------------
// Release Scripts

Expand All @@ -231,8 +222,7 @@ Target.create "ReleaseDocs" (fun _ ->
Shell.copyRecursive "output" tempDocsDir true |> Trace.tracefn "%A"
Staging.stageAll tempDocsDir
Commit.exec tempDocsDir (sprintf "Update generated documentation for version %s" release.NugetVersion)
Branches.push tempDocsDir
)
Branches.push tempDocsDir)

// --------------------------------------------------------------------------------------
// Run all targets by default. Invoke 'build <Target>' to override
Expand Down
Loading