Skip to content
Open
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
10 changes: 6 additions & 4 deletions .config/dotnet-tools.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,16 +3,18 @@
"isRoot": true,
"tools": {
"paket": {
"version": "8.0.3",
"version": "10.3.1",
"commands": [
"paket"
]
],
"rollForward": false
},
"fake-cli": {
"version": "6.1.0",
"version": "6.1.4",
"commands": [
"fake"
]
],
"rollForward": false
}
}
}
22 changes: 18 additions & 4 deletions .paket/Paket.Restore.targets
Original file line number Diff line number Diff line change
Expand Up @@ -235,23 +235,27 @@
<Splits>$([System.String]::Copy('%(PaketReferencesFileLines.Identity)').Split(',').Length)</Splits>
<PackageName>$([System.String]::Copy('%(PaketReferencesFileLines.Identity)').Split(',')[0])</PackageName>
<PackageVersion>$([System.String]::Copy('%(PaketReferencesFileLines.Identity)').Split(',')[1])</PackageVersion>
<Reference>$([System.String]::Copy('%(PaketReferencesFileLines.Identity)').Split(',')[2])</Reference>
<AllPrivateAssets>$([System.String]::Copy('%(PaketReferencesFileLines.Identity)').Split(',')[4])</AllPrivateAssets>
<CopyLocal Condition="%(PaketReferencesFileLinesInfo.Splits) &gt;= 6">$([System.String]::Copy('%(PaketReferencesFileLines.Identity)').Split(',')[5])</CopyLocal>
<OmitContent Condition="%(PaketReferencesFileLinesInfo.Splits) &gt;= 7">$([System.String]::Copy('%(PaketReferencesFileLines.Identity)').Split(',')[6])</OmitContent>
<ImportTargets Condition="%(PaketReferencesFileLinesInfo.Splits) &gt;= 8">$([System.String]::Copy('%(PaketReferencesFileLines.Identity)').Split(',')[7])</ImportTargets>
<Aliases Condition="%(PaketReferencesFileLinesInfo.Splits) &gt;= 9">$([System.String]::Copy('%(PaketReferencesFileLines.Identity)').Split(',')[8])</Aliases>
<ReferenceCondition Condition="%(PaketReferencesFileLinesInfo.Splits) &gt;= 10">$([System.String]::Copy('%(PaketReferencesFileLines.Identity)').Split(',')[9])</ReferenceCondition>
</PaketReferencesFileLinesInfo>
<PackageReference Include="%(PaketReferencesFileLinesInfo.PackageName)">
<Version>%(PaketReferencesFileLinesInfo.PackageVersion)</Version>
<PackageReference Condition=" ('$(ManagePackageVersionsCentrally)' != 'true' Or '%(PaketReferencesFileLinesInfo.Reference)' == 'Direct') AND ('%(PaketReferencesFileLinesInfo.ReferenceCondition)' == 'true' Or $(%(PaketReferencesFileLinesInfo.ReferenceCondition)) == 'true')" Include="%(PaketReferencesFileLinesInfo.PackageName)">
<Version Condition=" '$(ManagePackageVersionsCentrally)' != 'true' ">%(PaketReferencesFileLinesInfo.PackageVersion)</Version>
<PrivateAssets Condition=" ('%(PaketReferencesFileLinesInfo.AllPrivateAssets)' == 'true') Or ('$(PackAsTool)' == 'true') ">All</PrivateAssets>
<ExcludeAssets Condition=" %(PaketReferencesFileLinesInfo.CopyLocal) == 'false' or %(PaketReferencesFileLinesInfo.AllPrivateAssets) == 'exclude'">runtime</ExcludeAssets>
<ExcludeAssets Condition=" %(PaketReferencesFileLinesInfo.OmitContent) == 'true'">$(ExcludeAssets);contentFiles</ExcludeAssets>
<ExcludeAssets Condition=" %(PaketReferencesFileLinesInfo.ImportTargets) == 'false'">$(ExcludeAssets);build;buildMultitargeting;buildTransitive</ExcludeAssets>
<Aliases Condition=" %(PaketReferencesFileLinesInfo.Aliases) != ''">%(PaketReferencesFileLinesInfo.Aliases)</Aliases>
<Publish Condition=" '$(PackAsTool)' == 'true' ">true</Publish>
<AllowExplicitVersion>true</AllowExplicitVersion>

</PackageReference>
<PackageVersion Condition="('$(ManagePackageVersionsCentrally)' != 'true' Or '%(PaketReferencesFileLinesInfo.Reference)' == 'Direct') AND ('%(PaketReferencesFileLinesInfo.ReferenceCondition)' == 'true' Or $(%(PaketReferencesFileLinesInfo.ReferenceCondition)) == 'true')" Include="%(PaketReferencesFileLinesInfo.PackageName)">
<Version>%(PaketReferencesFileLinesInfo.PackageVersion)</Version>
</PackageVersion>
</ItemGroup>

<PropertyGroup>
Expand Down Expand Up @@ -314,7 +318,17 @@
</ItemGroup>

<Error Text="Error Because of PAKET_ERROR_ON_MSBUILD_EXEC (not calling fix-nuspecs)" Condition=" '$(PAKET_ERROR_ON_MSBUILD_EXEC)' == 'true' " />
<Exec Condition="@(_NuspecFiles) != ''" Command='$(PaketCommand) fix-nuspecs files "@(_NuspecFiles)" project-file "$(PaketProjectFile)" ' />
<Exec Condition="@(_NuspecFiles) != ''" Command='$(PaketCommand) show-conditions -s' ConsoleToMSBuild="true" StandardOutputImportance="low">
<Output TaskParameter="ConsoleOutput" ItemName="_ConditionProperties"/>
</Exec>
<ItemGroup>
<_DefinedConditionProperties Include="@(_ConditionProperties)" Condition="$(%(Identity)) == 'true'"/>
</ItemGroup>
<PropertyGroup>
<_ConditionsParameter></_ConditionsParameter>
<_ConditionsParameter Condition="@(_DefinedConditionProperties) != ''">--conditions @(_DefinedConditionProperties)</_ConditionsParameter>
</PropertyGroup>
<Exec Condition="@(_NuspecFiles) != ''" Command='$(PaketCommand) fix-nuspecs files "@(_NuspecFiles)" project-file "$(PaketProjectFile)" $(_ConditionsParameter)' />
<Error Condition="@(_NuspecFiles) == ''" Text='Could not find nuspec files in "$(AdjustedNuspecOutputPath)" (Version: "$(PackageVersion)"), therefore we cannot call "paket fix-nuspecs" and have to error out!' />

<ConvertToAbsolutePath Condition="@(_NuspecFiles) != ''" Paths="@(_NuspecFiles)">
Expand Down
12 changes: 12 additions & 0 deletions Build/Build.fsproj
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
<?xml version="1.0" encoding="utf-8"?>
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<OutputType>Exe</OutputType>
<TargetFramework>net10.0</TargetFramework>
</PropertyGroup>
<ItemGroup>
<None Include="paket.references" />
<Compile Include="Program.fs" />
</ItemGroup>
<Import Project="..\.paket\Paket.Restore.targets" />
</Project>
37 changes: 22 additions & 15 deletions build.fsx → Build/Program.fs
Original file line number Diff line number Diff line change
@@ -1,10 +1,4 @@
#r "paket: groupref Build //"

#load ".fake/build.fsx/intellisense.fsx"
#if !FAKE
#r "netstandard"
#endif


open System
open System.IO
open Fake.Core
Expand All @@ -17,14 +11,23 @@
open Fake.BuildServer
open NoSln

Environment.CurrentDirectory <- __SOURCE_DIRECTORY__

Environment.CurrentDirectory <- Path.Combine(__SOURCE_DIRECTORY__, "..")

let execContext = Context.FakeExecutionContext.Create false "build.fsx" []
Context.setExecutionContext (Context.RuntimeContext.Fake execContext)

let configuration =
Environment.environVarOrDefault "CONFIGURATION" "Release"
|> DotNet.BuildConfiguration.fromString

let release = ReleaseNotes.load "RELEASE_NOTES.md"
let testFramework = "net6.0"
let testFrameworks =
if Environment.isWindows then
["net10.0"; "net481"]
else
["net10.0"]

let dotnetExePath = "dotnet"

let githubToken = lazy(Environment.environVarOrFail "GITHUB_TOKEN")
Expand Down Expand Up @@ -60,6 +63,7 @@
!!"./**/bin/"
++ "./**/obj/"
++ pkgPath
-- "./Build/**/"
|> Shell.cleanDirs

let normaliseFileToLFEnding filename =
Expand All @@ -70,15 +74,17 @@
let build project =
DotNet.build (fun p ->
{ p with Configuration = configuration
Common = DotNet.Options.withDotNetCliPath dotnetExePath p.Common })
Common = DotNet.Options.withDotNetCliPath dotnetExePath p.Common
MSBuildParams = { p.MSBuildParams with DisableInternalBinLog = true } })
project

let runTest project =
Trace.logfn "Running %s on .NET Core" project
DotNet.exec (DotNet.Options.withDotNetCliPath dotnetExePath)
(sprintf "run --framework %s --project %s -c %O" testFramework project configuration)
"--summary"
|> fun r -> if r.ExitCode <> 0 then failwithf "Running %s on .NET Core failed" project
for framework in testFrameworks do
Trace.logfn "Running %s on %s" project framework
DotNet.exec (DotNet.Options.withDotNetCliPath dotnetExePath)
(sprintf "run --framework %s --project %s -c %O" framework project configuration)
"--summary"
|> fun r -> if r.ExitCode <> 0 then failwithf "Running %s on %s failed" project framework

Target.create "BuildExpecto" (fun _ ->
let sln = NoSln.WriteSolutionFile(projects=libProjects, useTempSolutionFile=true)
Expand Down Expand Up @@ -124,6 +130,7 @@
"VersionPrefix", release.NugetVersion
"PackageReleaseNotes", String.toLines release.Notes
]
DisableInternalBinLog = true
}

let pkgSln = NoSln.WriteSolutionFile(projects=libProjects, useTempSolutionFile=true)
Expand Down Expand Up @@ -174,10 +181,10 @@
Target.create "All" ignore
Target.create "CI" ignore

"CheckEnv"

Check warning on line 184 in Build/Program.fs

View workflow job for this annotation

GitHub Actions / build

The result of this expression has type 'string' and is implicitly ignored. Consider using 'ignore' to discard this value explicitly, e.g. 'expr |> ignore', or 'let' to bind the result to a name, e.g. 'let result = expr'.
==> "Release"

"Clean"

Check warning on line 187 in Build/Program.fs

View workflow job for this annotation

GitHub Actions / build

The result of this expression has type 'string' and is implicitly ignored. Consider using 'ignore' to discard this value explicitly, e.g. 'expr |> ignore', or 'let' to bind the result to a name, e.g. 'let result = expr'.
==> "BuildExpecto"
==> "BuildBenchmarkDotNet"
==> "BuildTest"
Expand Down
20 changes: 20 additions & 0 deletions Build/paket.references
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
group Build
Fake.Api.GitHub
Fake.BuildServer.AppVeyor
Fake.BuildServer.Travis
Fake.Core.ReleaseNotes
Fake.Core.Target
Fake.Core.Xml
Fake.DotNet.Cli
Fake.DotNet.Paket
Fake.IO.FileSystem
Fake.IO.Zip
Fake.Tools.Git
Fake.Tools.Octo
Microsoft.Build
Microsoft.Build.Framework
Microsoft.Build.Tasks.Core
Microsoft.Build.Utilities.Core
FSharp.Core
Nuget.Protocol
nosln
Original file line number Diff line number Diff line change
@@ -1,7 +1,10 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<OutputType>Exe</OutputType>
<TargetFrameworks>net6.0</TargetFrameworks>
<!-- Default for non-Windows (Linux/Mac CI) -->
<TargetFrameworks>net10.0</TargetFrameworks>
<!-- Dual target only when building on Windows -->
<TargetFrameworks Condition="$([MSBuild]::IsOSPlatform('Windows'))">net10.0;net481</TargetFrameworks>
</PropertyGroup>
<ItemGroup>
<Compile Include="BenchmarkDotNetTests.fs" />
Expand Down
2 changes: 1 addition & 1 deletion Expecto.BenchmarkDotNet/Expecto.BenchmarkDotNet.fsproj
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<PackageId>Expecto.BenchmarkDotNet</PackageId>
<TargetFramework>net6.0</TargetFramework>
<TargetFrameworks>netstandard2.0;net8.0</TargetFrameworks>
</PropertyGroup>
<ItemGroup>
<Compile Include="Expecto.BenchmarkDotNet.fs" />
Expand Down
2 changes: 1 addition & 1 deletion Expecto.Diff/Expecto.Diff.fsproj
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
<PropertyGroup>
<PackageId>Expecto.Diff</PackageId>
<Description>Integration of Expecto with DiffPlex</Description>
<TargetFramework>net6.0</TargetFramework>
<TargetFrameworks>netstandard2.0;net8.0</TargetFrameworks>
</PropertyGroup>
<ItemGroup>
<ProjectReference Include="..\Expecto\Expecto.fsproj" />
Expand Down
5 changes: 4 additions & 1 deletion Expecto.Focused.Tests/Expecto.Focused.Tests.fsproj
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,10 @@
<PropertyGroup>
<AssemblyName>Expecto.Focused.Tests</AssemblyName>
<OutputType>Exe</OutputType>
<TargetFramework>net6.0</TargetFramework>
<!-- Default for non-Windows (Linux/Mac CI) -->
<TargetFrameworks>net10.0</TargetFrameworks>
<!-- Dual target only when building on Windows -->
<TargetFrameworks Condition="$([MSBuild]::IsOSPlatform('Windows'))">net10.0;net481</TargetFrameworks>
</PropertyGroup>
<ItemGroup>
<Compile Include="Main.fs" />
Expand Down
2 changes: 1 addition & 1 deletion Expecto.FsCheck/Expecto.FsCheck.fsproj
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
<PackageId>Expecto.FsCheck</PackageId>
<Description>Property testing for Expecto, powered by FsCheck</Description>
<VersionSuffix>fscheck2</VersionSuffix>
<TargetFramework>net6.0</TargetFramework>
<TargetFrameworks>netstandard2.0;net8.0</TargetFrameworks>
</PropertyGroup>
<ItemGroup>
<Compile Include="FsCheck.fs" />
Expand Down
2 changes: 1 addition & 1 deletion Expecto.FsCheck3/Expecto.FsCheck3.fsproj
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
<PropertyGroup>
<PackageId>Expecto.FsCheck</PackageId>
<Description>Property testing for Expecto, powered by FsCheck3</Description>
<TargetFramework>net6.0</TargetFramework>
<TargetFrameworks>netstandard2.0;net8.0</TargetFrameworks>
</PropertyGroup>
<ItemGroup>
<Compile Include="FsCheck3.fs" />
Expand Down
5 changes: 4 additions & 1 deletion Expecto.Hopac.Tests/Expecto.Hopac.Tests.fsproj
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,11 @@
<ServerGarbageCollection>true</ServerGarbageCollection>
<AssemblyName>Expecto.Hopac.Tests</AssemblyName>
<OutputType>Exe</OutputType>
<TargetFramework>net6.0</TargetFramework>
<AutoGenerateBindingRedirects>true</AutoGenerateBindingRedirects>
<!-- Default for non-Windows (Linux/Mac CI) -->
<TargetFrameworks>net10.0</TargetFrameworks>
<!-- Dual target only when building on Windows -->
<TargetFrameworks Condition="$([MSBuild]::IsOSPlatform('Windows'))">net10.0;net481</TargetFrameworks>
</PropertyGroup>
<ItemGroup>
<Compile Include="Tests.fs" />
Expand Down
2 changes: 1 addition & 1 deletion Expecto.Hopac/Expecto.Hopac.fsproj
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
<PropertyGroup>
<PackageId>Expecto.Hopac</PackageId>
<Description>Running Hopac jobs from Expecto</Description>
<TargetFramework>net6.0</TargetFramework>
<TargetFrameworks>netstandard2.0;net8.0</TargetFrameworks>
</PropertyGroup>
<ItemGroup>
<Compile Include="Expecto.Hopac.fs" />
Expand Down
2 changes: 1 addition & 1 deletion Expecto.Sample/Expecto.Sample.fsproj
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
<PropertyGroup>
<AssemblyName>Expecto.Sample</AssemblyName>
<OutputType>Exe</OutputType>
<TargetFramework>net6.0</TargetFramework>
<TargetFramework>net10.0</TargetFramework>
</PropertyGroup>
<ItemGroup>
<Compile Include="Expecto.Flip.Sample.fs" />
Expand Down
4 changes: 2 additions & 2 deletions Expecto.Template/Expecto.Template.fsproj
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFramework>net6.0</TargetFramework>
<TargetFramework>net10.0</TargetFramework>
<NoWarn>$(NoWarn);NU5128</NoWarn>
</PropertyGroup>
<PropertyGroup>
Expand All @@ -21,7 +21,7 @@
<PackageReadmeFile>README.md</PackageReadmeFile>
<PackageReleaseNotes>
- Create the project in a new folder if -n is specified
- Bump default target framework to net9.0
- Bump default target framework to net10.0
</PackageReleaseNotes>
<!-- Template authoring guide: https://learn.microsoft.com/en-us/nuget/create-packages/package-authoring-best-practices -->
</PropertyGroup>
Expand Down
4 changes: 2 additions & 2 deletions Expecto.Template/content/expecto/ExpectoTemplate.fsproj
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

<PropertyGroup>
<OutputType>Exe</OutputType>
<TargetFramework>net9.0</TargetFramework>
<TargetFramework>net8.0</TargetFramework>
<GenerateProgramFile>false</GenerateProgramFile>
</PropertyGroup>

Expand All @@ -15,6 +15,6 @@
<PackageReference Include="Expecto" Version="10.*" />
<PackageReference Include="YoloDev.Expecto.TestSdk" Version="0.15.*" />
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.*" />
<PackageReference Update="FSharp.Core" Version="7.*" />
<PackageReference Update="FSharp.Core" Version="8.*" />
</ItemGroup>
</Project>
2 changes: 1 addition & 1 deletion Expecto.Tests.CSharp/Expecto.Tests.CSharp.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
<PropertyGroup>
<AssemblyName>Expecto.Tests.CSharp</AssemblyName>
<OutputType>Exe</OutputType>
<TargetFramework>net6.0</TargetFramework>
<TargetFrameworks>net10.0;net481</TargetFrameworks>
<EnableDefaultContentItems>false</EnableDefaultContentItems>
<EnableDefaultNoneItems>false</EnableDefaultNoneItems>
<EnableDefaultCompileItems>false</EnableDefaultCompileItems>
Expand Down
2 changes: 1 addition & 1 deletion Expecto.Tests.FsCheck3/Expecto.Tests.FsCheck3.fsproj
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
<PropertyGroup>
<AssemblyName>Expecto.Tests</AssemblyName>
<OutputType>Exe</OutputType>
<TargetFramework>net6.0</TargetFramework>
<TargetFrameworks>net10.0;net481</TargetFrameworks>
</PropertyGroup>
<ItemGroup>
<Compile Include="FsCheck3Tests.fs" />
Expand Down
5 changes: 4 additions & 1 deletion Expecto.Tests/Expecto.Tests.fsproj
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,10 @@
<PropertyGroup>
<AssemblyName>Expecto.Tests</AssemblyName>
<OutputType>Exe</OutputType>
<TargetFramework>net6.0</TargetFramework>
<!-- Default for non-Windows (Linux/Mac CI) -->
<TargetFrameworks>net10.0</TargetFrameworks>
<!-- Dual target only when building on Windows -->
<TargetFrameworks Condition="$([MSBuild]::IsOSPlatform('Windows'))">net10.0;net481</TargetFrameworks>
</PropertyGroup>
<ItemGroup>
<Compile Include="Prelude.fs" />
Expand Down
4 changes: 2 additions & 2 deletions Expecto.Tests/Tests.fs
Original file line number Diff line number Diff line change
Expand Up @@ -1529,12 +1529,12 @@ let taskTests =
}
testTask "can let! bind ValueTask<T>" {
let expected = 5
let valueTask = ValueTask.FromResult(expected)
let valueTask = ValueTask<int>(expected)
let! actual = valueTask
Expect.equal expected actual "should be able to let! bind ValueTask<T>"
}
testTask "can do! bind ValueTask" {
let valueTask = ValueTask.CompletedTask
let valueTask = ValueTask()
do! valueTask
}
testTask "can let! bind Async<T>" {
Expand Down
Loading
Loading