Skip to content
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

Upgrade tests and build to net7 except for Fable (net6) #525

Merged
merged 9 commits into from
Nov 27, 2022
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
12 changes: 10 additions & 2 deletions .github/workflows/dotnetcore.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ jobs:
- name: Setup .NET Core
uses: actions/setup-dotnet@v1
with:
dotnet-version: 6.0.201
dotnet-version: 7.0.100
- name: Restore
run: git submodule update --init --recursive
- name: Build with dotnet
Expand All @@ -38,7 +38,11 @@ jobs:

steps:
- uses: actions/checkout@v2
- name: Setup .NET Core
- name: Setup .NET Core 7
uses: actions/setup-dotnet@v1
with:
dotnet-version: 7.0.100
- name: Setup .NET Core 6
uses: actions/setup-dotnet@v1
with:
dotnet-version: 6.0.201
Expand Down Expand Up @@ -78,6 +82,10 @@ jobs:
runs-on: windows-latest
steps:
- uses: actions/checkout@v2
- name: Setup .NET Core 7
uses: actions/setup-dotnet@v1
with:
dotnet-version: 7.0.100
- name: Setup .NET Core 6
uses: actions/setup-dotnet@v1
with:
Expand Down
12 changes: 8 additions & 4 deletions .github/workflows/fable.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,12 +13,14 @@ jobs:

steps:
- uses: actions/checkout@v2
- name: Restore
run: git submodule update --init --recursive
- name: Remove global json
run: rm global.json
- name: Setup .NET Core
uses: actions/setup-dotnet@v1
with:
dotnet-version: 6.0.201
- name: Restore
run: git submodule update --init --recursive
- name: Restore tools
run: dotnet tool restore
- name: Use Node.js
Expand All @@ -37,12 +39,14 @@ jobs:

steps:
- uses: actions/checkout@v2
- name: Restore
run: git submodule update --init --recursive
- name: Remove global json
run: rm global.json
- name: Setup .NET Core
uses: actions/setup-dotnet@v1
with:
dotnet-version: 6.0.201
- name: Restore
run: git submodule update --init --recursive
- name: Restore tools
run: dotnet tool restore
# - name: Run tests (Fable2 subset but on .net)
Expand Down
2 changes: 1 addition & 1 deletion docsrc/tools/docsTool.fsproj
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

<PropertyGroup>
<OutputType>Exe</OutputType>
<TargetFramework>net6.0</TargetFramework>
<TargetFramework>net7.0</TargetFramework>
</PropertyGroup>

<ItemGroup>
Expand Down
5 changes: 3 additions & 2 deletions global.json
Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@
{
"sdk": {
"version": "6.0.200",
"version": "7.0.100",
"rollForward": "latestFeature"
},

"additionalSdks": [
"5.0.405"
"5.0.405",
"6.0.201"
]
}
2 changes: 1 addition & 1 deletion src/FSharpPlus.Docs/FSharpPlus.Docs.fsproj
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
<OutputType>Exe</OutputType>
<Configurations>Debug;Release;Fable</Configurations>
<Platforms>AnyCPU</Platforms>
<TargetFramework>net6.0</TargetFramework>
<TargetFramework>net7.0</TargetFramework>
</PropertyGroup>

<ItemGroup>
Expand Down
8 changes: 6 additions & 2 deletions src/FSharpPlus/Control/Numeric.fs
Original file line number Diff line number Diff line change
Expand Up @@ -291,11 +291,15 @@ type TryNegate' =
type DivRem =
inherit Default1
static member inline DivRem (x: ^t when ^t: null and ^t: struct, y: ^t, _thisClass: DivRem) = (x, y)
static member inline DivRem (D: 'T, d: 'T, [<Optional>]_impl: Default1) = let q = D / d in q, D - q * d
static member inline DivRem (D: 'T, d: 'T, [<Optional>]_impl: DivRem ) =
static member inline DivRem (D: 'T, d: 'T, _impl: Default2) = let q = D / d in q, D - q * d
static member inline DivRem (D: 'T, d: 'T, _impl: Default1) =
let mutable r = Unchecked.defaultof<'T>
(^T: (static member DivRem : _ * _ -> _ -> _) (D, d, &r)), r

static member inline DivRem (D: 'T, d: 'T, _impl: DivRem ) =
let (struct (x, y)) = (^T: (static member DivRem : _ * _ -> _) (D, d))
(x, y)

static member inline Invoke (D: 'T) (d: 'T) : 'T*'T =
let inline call_3 (a: ^a, b: ^b, c: ^c) = ((^a or ^b or ^c) : (static member DivRem : _*_*_ -> _) b, c, a)
let inline call (a: 'a, b: 'b, c: 'c) = call_3 (a, b, c)
Expand Down
2 changes: 1 addition & 1 deletion tests/FSharpPlus.Tests/FSharpPlus.Tests.fsproj
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,13 @@
<FscToolExe>$(FSC_ExePathCompilerBuild)</FscToolExe>
</PropertyGroup>
<PropertyGroup>
<TargetFrameworks>net6.0</TargetFrameworks>
<AutoGenerateBindingRedirects>true</AutoGenerateBindingRedirects>
<LangVersion Condition=" '$(Configuration)' == 'Fable' OR '$(Configuration)' == 'Fable3' ">6.0</LangVersion>
<IsPackable>false</IsPackable>
<Configurations>Debug;Release;Fable</Configurations>
<Platforms>AnyCPU</Platforms>
<DefineConstants Condition=" '$(Configuration)' == 'Fable'">$(DefineConstants);FABLE_COMPILER</DefineConstants>
<TargetFramework>net7.0</TargetFramework>
</PropertyGroup>
<ItemGroup>
<Compile Include="Helpers.fs" />
Expand Down
84 changes: 42 additions & 42 deletions tests/FSharpPlusFable.Tests/FSharpPlusFable.Tests.fsproj
Original file line number Diff line number Diff line change
@@ -1,49 +1,49 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<OutputType>Exe</OutputType>
<Configurations>Debug;Release;Fable;Fable3</Configurations>
<Platforms>AnyCPU</Platforms>
<LangVersion Condition=" '$(Configuration)' == 'Fable' OR '$(Configuration)' == 'Fable3' ">6.0</LangVersion>
<DefineConstants Condition=" '$(Configuration)' == 'Fable'">$(DefineConstants);FABLE_COMPILER;FABLE_COMPILER_FAKE</DefineConstants>
<DefineConstants Condition=" '$(Configuration)' == 'Fable3'">$(DefineConstants);FABLE_COMPILER;FABLE_COMPILER_3;FABLE_COMPILER_FAKE</DefineConstants>
<TargetFramework>net6.0</TargetFramework>
</PropertyGroup>
<PropertyGroup>
Copy link
Member

@abelbraaksma abelbraaksma Nov 26, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why the 8 space indent? I think 2 or 4 are common (spaces, not tabs). Probably best to have formatting changes in a separate PR and doing it across the board, though in this case, I think the default of 2 spaces was fine.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It could be when Visual Studio does changes

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

looks like it was spaces but has been changed to tabs.

Copy link
Member

@abelbraaksma abelbraaksma Nov 26, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@wallymathieu VS will honor the .editorconfig settings. However, maybe this project does not have specific settings for fsproj files. In which case it will use whatever default your system has.

Here's a snippet for .editorconfig, maybe try that and re-edit & save in your editor, see what happens?

# Project files and app specific XML files
[*.{csproj,fsproj,shproj,projitems,props,targets,xaml}]
trim_trailing_whitespace = true
insert_final_newline     = true
indent_style             = space
indent_size              = 2
charset                  = utf-8

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I agree. We should have that setting in editorconfig. Looks like we have not added it yet for this repository. Perhaps something you want to make a PR for?

<OutputType>Exe</OutputType>
<Configurations>Debug;Release;Fable;Fable3</Configurations>
<Platforms>AnyCPU</Platforms>
<LangVersion Condition=" '$(Configuration)' == 'Fable' OR '$(Configuration)' == 'Fable3' ">6.0</LangVersion>
<DefineConstants Condition=" '$(Configuration)' == 'Fable'">$(DefineConstants);FABLE_COMPILER;FABLE_COMPILER_FAKE</DefineConstants>
<DefineConstants Condition=" '$(Configuration)' == 'Fable3'">$(DefineConstants);FABLE_COMPILER;FABLE_COMPILER_3;FABLE_COMPILER_FAKE</DefineConstants>
<TargetFramework>net6.0</TargetFramework>
</PropertyGroup>

<ItemGroup>
<Compile Include="Util.fs" />
<Compile Include="FSharpTests/General/Util.fs" />
<Compile Include="FSharpTests/General/Splits.fs" />
<Compile Include="FSharpTests/General/MonoidCompile.fs" />
<Compile Include="FSharpTests/General/Monoid.fs" />
<Compile Include="FSharpTests/General/Functor.fs" />
<Compile Include="FSharpTests/General/Collections.fs" />
<Compile Include="FSharpTests/General/Monad.fs" />
<Compile Include="FSharpTests/General/Applicative.fs" />
<Compile Include="FSharpTests/General/Alternative.fs" />
<Compile Include="FSharpTests/General/Foldable.fs" />
<Compile Include="FSharpTests/General/Indexable.fs" />
<Compile Include="FSharpTests/General/Parsing.fs" />
<Compile Include="FSharpTests/General/Traversable.fs" />
<Compile Include="FSharpTests/General/Lensing.fs" />
<Compile Include="FSharpTests/General/Numeric.fs" />
<Compile Include="FSharpTests/General.fs" />
<Compile Include="FSharpTests/Extensions.fs" />
<Compile Include="Tests.fs" />
</ItemGroup>
<ItemGroup>
<Compile Include="Util.fs" />
<Compile Include="FSharpTests/General/Util.fs" />
<Compile Include="FSharpTests/General/Splits.fs" />
<Compile Include="FSharpTests/General/MonoidCompile.fs" />
<Compile Include="FSharpTests/General/Monoid.fs" />
<Compile Include="FSharpTests/General/Functor.fs" />
<Compile Include="FSharpTests/General/Collections.fs" />
<Compile Include="FSharpTests/General/Monad.fs" />
<Compile Include="FSharpTests/General/Applicative.fs" />
<Compile Include="FSharpTests/General/Alternative.fs" />
<Compile Include="FSharpTests/General/Foldable.fs" />
<Compile Include="FSharpTests/General/Indexable.fs" />
<Compile Include="FSharpTests/General/Parsing.fs" />
<Compile Include="FSharpTests/General/Traversable.fs" />
<Compile Include="FSharpTests/General/Lensing.fs" />
<Compile Include="FSharpTests/General/Numeric.fs" />
<Compile Include="FSharpTests/General.fs" />
<Compile Include="FSharpTests/Extensions.fs" />
<Compile Include="Tests.fs" />
</ItemGroup>


<ItemGroup>
<PackageReference Include="Fable.Core" Version="3.2.5" />
<PackageReference Include="Fable.Promise" Version="2.2.0" />
<PackageReference Include="Fable.Fetch" Version="2.2.0" />
<PackageReference Include="Fuchu" Version="1.2.0-beta-1" />
</ItemGroup>
<ItemGroup>
<PackageReference Include="Fable.Core" Version="3.2.5" />
<PackageReference Include="Fable.Promise" Version="2.2.0" />
<PackageReference Include="Fable.Fetch" Version="2.2.0" />
<PackageReference Include="Fuchu" Version="1.2.0-beta-1" />
</ItemGroup>

<ItemGroup>
<ProjectReference Include="..\..\src\FSharpPlus\FSharpPlus.fsproj">
<Private>True</Private>
</ProjectReference>
<PackageReference Update="FSharp.Core" Version="6.0.6" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\..\src\FSharpPlus\FSharpPlus.fsproj">
<Private>True</Private>
</ProjectReference>
<PackageReference Update="FSharp.Core" Version="6.0.6" />
</ItemGroup>
</Project>
6 changes: 6 additions & 0 deletions tests/FSharpPlusFable.Tests/global.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{
"sdk": {
"version": "6.0.201",
"rollForward": "latestFeature"
}
}
2 changes: 1 addition & 1 deletion tests/benchmarks/Benchmarks.fsproj
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFramework>net6.0</TargetFramework>
<TargetFramework>net7.0</TargetFramework>
<OutputType>Exe</OutputType>
<PlatformTarget>AnyCPU</PlatformTarget>
<Optimize>true</Optimize>
Expand Down