Skip to content

Commit

Permalink
Update to .NET 8, remove x64 limitation, change to FAKE build project (
Browse files Browse the repository at this point in the history
…#204)

* Update dotnet tools

* Ignore macOS finder files

* Ignore files generated by examples

* Fix F# compile issues

* Update to .NET 8 and remove any x64 mentions

* Update packages

* Add build project to run FAKE

* Fix warnings

* Add fantomas

* Formatting: run fantomas on build script

* Fix to .NET CLI invocation for paket

* Delete build script for FAKE runner

* Remove FAKE runner as local tool

* Use .NET 8 in GitHub actions

* Add a release note section

* Change to multi-target build for net6.0 and net462

---------

Co-authored-by: Florian Lorenzen <[email protected]>
  • Loading branch information
florenzen and Florian Lorenzen authored May 13, 2024
1 parent 4f4f610 commit 4252db4
Show file tree
Hide file tree
Showing 21 changed files with 848 additions and 1,765 deletions.
14 changes: 7 additions & 7 deletions .config/dotnet-tools.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,8 @@
"version": 1,
"isRoot": true,
"tools": {
"fake-cli": {
"version": "5.22.0",
"commands": [
"fake"
]
},
"paket": {
"version": "7.1.5",
"version": "8.0.3",
"commands": [
"paket"
]
Expand All @@ -19,6 +13,12 @@
"commands": [
"sourcelink"
]
},
"fantomas": {
"version": "6.3.4",
"commands": [
"fantomas"
]
}
}
}
2 changes: 1 addition & 1 deletion .github/workflows/dev-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ jobs:
- name: Setup .NET Core
uses: actions/setup-dotnet@v1
with:
dotnet-version: '6.x'
dotnet-version: '8.x'
- name: Build solution and generate NuGet Package
run: sudo bash build.sh -t Nuget
- name: Push with dotnet
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/dotnetcore.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,6 @@ jobs:
- name: Setup .NET Core
uses: actions/setup-dotnet@v1
with:
dotnet-version: '6.x'
dotnet-version: '8.x'
- name: Test
run: sudo bash build.sh -t RunTests
5 changes: 4 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -275,4 +275,7 @@ paket.local

# Libraries
MipCL213WrapperCpp.dll
Scip70WrapperCpp.dll
Scip70WrapperCpp.dll

# MacOS
.DS_Store
3 changes: 3 additions & 0 deletions Flips.Examples/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
*.lp
*.tsv
*.mps
3 changes: 1 addition & 2 deletions Flips.Examples/Flips.Examples.fsproj
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,7 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<OutputType>Exe</OutputType>
<TargetFramework>net5.0</TargetFramework>
<Platforms>x64</Platforms>
<TargetFramework>net8.0</TargetFramework>
</PropertyGroup>
<PropertyGroup>
<WarningsAsErrors>3239;0044;</WarningsAsErrors>
Expand Down
4 changes: 1 addition & 3 deletions Flips.Tests/Flips.Tests.fsproj
Original file line number Diff line number Diff line change
@@ -1,11 +1,9 @@
<?xml version="1.0" encoding="utf-8"?>
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFramework>net6.0</TargetFramework>
<PlatformTarget>x64</PlatformTarget>
<TargetFramework>net8.0</TargetFramework>
<IsPackable>false</IsPackable>
<GenerateProgramFile>false</GenerateProgramFile>
<Platforms>AnyCPU;x64</Platforms>
</PropertyGroup>
<PropertyGroup>
<NoWarn>NU1701;</NoWarn>
Expand Down
78 changes: 38 additions & 40 deletions Flips.sln
Original file line number Diff line number Diff line change
Expand Up @@ -10,12 +10,6 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = ".paket", ".paket", "{0AEFA3
paket.lock = paket.lock
EndProjectSection
EndProject
Project("{6EC3EE1D-3C4E-46DD-8F32-0CC8E7565705}") = "Flips", "Flips\Flips.fsproj", "{FFE0CCDF-E1F1-47E5-8259-C5E4EE270D76}"
EndProject
Project("{6EC3EE1D-3C4E-46DD-8F32-0CC8E7565705}") = "Flips.Examples", "Flips.Examples\Flips.Examples.fsproj", "{44E39E9C-7A97-4AA8-8287-78DADA1BF929}"
EndProject
Project("{6EC3EE1D-3C4E-46DD-8F32-0CC8E7565705}") = "Flips.Tests", "Flips.Tests\Flips.Tests.fsproj", "{1B957527-9C3E-4D18-B12B-E68D73B5BB3B}"
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "docs", "docs", "{C3221202-C366-4541-8997-7D1E45628C60}"
ProjectSection(SolutionItems) = preProject
docs\.nojekyll = docs\.nojekyll
Expand Down Expand Up @@ -86,9 +80,13 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "workflows", "workflows", "{
.github\workflows\secrets.yml = .github\workflows\secrets.yml
EndProjectSection
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "tools", "tools", "{14644FDA-EA92-4678-8C10-7A84B14FCC23}"
Project("{F2A71F9B-5D33-465A-A702-920D77279786}") = "Flips", "Flips\Flips.fsproj", "{8DA345A2-13E5-4366-A680-724EC30A3254}"
EndProject
Project("{F2A71F9B-5D33-465A-A702-920D77279786}") = "Flips.Tests", "Flips.Tests\Flips.Tests.fsproj", "{2F5F3FDD-A685-484A-A2DB-2EE0C0C73186}"
EndProject
Project("{F2A71F9B-5D33-465A-A702-920D77279786}") = "Flips.Examples", "Flips.Examples\Flips.Examples.fsproj", "{1CD485CB-B627-4C56-AEF5-459CE149B0D5}"
EndProject
Project("{6EC3EE1D-3C4E-46DD-8F32-0CC8E7565705}") = "tools", "tools\tools.fsproj", "{AC769337-906E-4D1F-BC98-3CC1341323C4}"
Project("{F2A71F9B-5D33-465A-A702-920D77279786}") = "build", "build\build.fsproj", "{C8A1034D-109F-46E7-8D44-A0081828C21B}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Expand All @@ -98,37 +96,38 @@ Global
Release|x64 = Release|x64
EndGlobalSection
GlobalSection(ProjectConfigurationPlatforms) = postSolution
{FFE0CCDF-E1F1-47E5-8259-C5E4EE270D76}.Debug|Any CPU.ActiveCfg = Debug|x64
{FFE0CCDF-E1F1-47E5-8259-C5E4EE270D76}.Debug|Any CPU.Build.0 = Debug|x64
{FFE0CCDF-E1F1-47E5-8259-C5E4EE270D76}.Debug|x64.ActiveCfg = Debug|x64
{FFE0CCDF-E1F1-47E5-8259-C5E4EE270D76}.Debug|x64.Build.0 = Debug|x64
{FFE0CCDF-E1F1-47E5-8259-C5E4EE270D76}.Release|Any CPU.ActiveCfg = Release|x64
{FFE0CCDF-E1F1-47E5-8259-C5E4EE270D76}.Release|x64.ActiveCfg = Release|x64
{FFE0CCDF-E1F1-47E5-8259-C5E4EE270D76}.Release|x64.Build.0 = Release|x64
{44E39E9C-7A97-4AA8-8287-78DADA1BF929}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{44E39E9C-7A97-4AA8-8287-78DADA1BF929}.Debug|Any CPU.Build.0 = Debug|Any CPU
{44E39E9C-7A97-4AA8-8287-78DADA1BF929}.Debug|x64.ActiveCfg = Debug|x64
{44E39E9C-7A97-4AA8-8287-78DADA1BF929}.Debug|x64.Build.0 = Debug|x64
{44E39E9C-7A97-4AA8-8287-78DADA1BF929}.Release|Any CPU.ActiveCfg = Release|Any CPU
{44E39E9C-7A97-4AA8-8287-78DADA1BF929}.Release|Any CPU.Build.0 = Release|Any CPU
{44E39E9C-7A97-4AA8-8287-78DADA1BF929}.Release|x64.ActiveCfg = Release|x64
{44E39E9C-7A97-4AA8-8287-78DADA1BF929}.Release|x64.Build.0 = Release|x64
{1B957527-9C3E-4D18-B12B-E68D73B5BB3B}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{1B957527-9C3E-4D18-B12B-E68D73B5BB3B}.Debug|Any CPU.Build.0 = Debug|Any CPU
{1B957527-9C3E-4D18-B12B-E68D73B5BB3B}.Debug|x64.ActiveCfg = Debug|x64
{1B957527-9C3E-4D18-B12B-E68D73B5BB3B}.Debug|x64.Build.0 = Debug|x64
{1B957527-9C3E-4D18-B12B-E68D73B5BB3B}.Release|Any CPU.ActiveCfg = Release|Any CPU
{1B957527-9C3E-4D18-B12B-E68D73B5BB3B}.Release|Any CPU.Build.0 = Release|Any CPU
{1B957527-9C3E-4D18-B12B-E68D73B5BB3B}.Release|x64.ActiveCfg = Release|x64
{1B957527-9C3E-4D18-B12B-E68D73B5BB3B}.Release|x64.Build.0 = Release|x64
{AC769337-906E-4D1F-BC98-3CC1341323C4}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{AC769337-906E-4D1F-BC98-3CC1341323C4}.Debug|Any CPU.Build.0 = Debug|Any CPU
{AC769337-906E-4D1F-BC98-3CC1341323C4}.Debug|x64.ActiveCfg = Debug|Any CPU
{AC769337-906E-4D1F-BC98-3CC1341323C4}.Debug|x64.Build.0 = Debug|Any CPU
{AC769337-906E-4D1F-BC98-3CC1341323C4}.Release|Any CPU.ActiveCfg = Release|Any CPU
{AC769337-906E-4D1F-BC98-3CC1341323C4}.Release|Any CPU.Build.0 = Release|Any CPU
{AC769337-906E-4D1F-BC98-3CC1341323C4}.Release|x64.ActiveCfg = Release|Any CPU
{AC769337-906E-4D1F-BC98-3CC1341323C4}.Release|x64.Build.0 = Release|Any CPU
{8DA345A2-13E5-4366-A680-724EC30A3254}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{8DA345A2-13E5-4366-A680-724EC30A3254}.Debug|Any CPU.Build.0 = Debug|Any CPU
{8DA345A2-13E5-4366-A680-724EC30A3254}.Debug|x64.ActiveCfg = Debug|Any CPU
{8DA345A2-13E5-4366-A680-724EC30A3254}.Debug|x64.Build.0 = Debug|Any CPU
{8DA345A2-13E5-4366-A680-724EC30A3254}.Release|Any CPU.ActiveCfg = Release|Any CPU
{8DA345A2-13E5-4366-A680-724EC30A3254}.Release|Any CPU.Build.0 = Release|Any CPU
{8DA345A2-13E5-4366-A680-724EC30A3254}.Release|x64.ActiveCfg = Release|Any CPU
{8DA345A2-13E5-4366-A680-724EC30A3254}.Release|x64.Build.0 = Release|Any CPU
{2F5F3FDD-A685-484A-A2DB-2EE0C0C73186}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{2F5F3FDD-A685-484A-A2DB-2EE0C0C73186}.Debug|Any CPU.Build.0 = Debug|Any CPU
{2F5F3FDD-A685-484A-A2DB-2EE0C0C73186}.Debug|x64.ActiveCfg = Debug|Any CPU
{2F5F3FDD-A685-484A-A2DB-2EE0C0C73186}.Debug|x64.Build.0 = Debug|Any CPU
{2F5F3FDD-A685-484A-A2DB-2EE0C0C73186}.Release|Any CPU.ActiveCfg = Release|Any CPU
{2F5F3FDD-A685-484A-A2DB-2EE0C0C73186}.Release|Any CPU.Build.0 = Release|Any CPU
{2F5F3FDD-A685-484A-A2DB-2EE0C0C73186}.Release|x64.ActiveCfg = Release|Any CPU
{2F5F3FDD-A685-484A-A2DB-2EE0C0C73186}.Release|x64.Build.0 = Release|Any CPU
{1CD485CB-B627-4C56-AEF5-459CE149B0D5}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{1CD485CB-B627-4C56-AEF5-459CE149B0D5}.Debug|Any CPU.Build.0 = Debug|Any CPU
{1CD485CB-B627-4C56-AEF5-459CE149B0D5}.Debug|x64.ActiveCfg = Debug|Any CPU
{1CD485CB-B627-4C56-AEF5-459CE149B0D5}.Debug|x64.Build.0 = Debug|Any CPU
{1CD485CB-B627-4C56-AEF5-459CE149B0D5}.Release|Any CPU.ActiveCfg = Release|Any CPU
{1CD485CB-B627-4C56-AEF5-459CE149B0D5}.Release|Any CPU.Build.0 = Release|Any CPU
{1CD485CB-B627-4C56-AEF5-459CE149B0D5}.Release|x64.ActiveCfg = Release|Any CPU
{1CD485CB-B627-4C56-AEF5-459CE149B0D5}.Release|x64.Build.0 = Release|Any CPU
{C8A1034D-109F-46E7-8D44-A0081828C21B}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{C8A1034D-109F-46E7-8D44-A0081828C21B}.Debug|Any CPU.Build.0 = Debug|Any CPU
{C8A1034D-109F-46E7-8D44-A0081828C21B}.Debug|x64.ActiveCfg = Debug|Any CPU
{C8A1034D-109F-46E7-8D44-A0081828C21B}.Debug|x64.Build.0 = Debug|Any CPU
{C8A1034D-109F-46E7-8D44-A0081828C21B}.Release|Any CPU.ActiveCfg = Release|Any CPU
{C8A1034D-109F-46E7-8D44-A0081828C21B}.Release|Any CPU.Build.0 = Release|Any CPU
{C8A1034D-109F-46E7-8D44-A0081828C21B}.Release|x64.ActiveCfg = Release|Any CPU
{C8A1034D-109F-46E7-8D44-A0081828C21B}.Release|x64.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
Expand All @@ -139,7 +138,6 @@ Global
{D0D6839C-AD73-442D-A5BA-4A0B7EA04009} = {C3221202-C366-4541-8997-7D1E45628C60}
{67606615-90CB-4FB1-8147-74E9020EDF52} = {C3221202-C366-4541-8997-7D1E45628C60}
{4D5C661A-E91C-4B9E-8167-DE8AC931F87C} = {5ED40737-872B-4038-B860-E793EBE21F28}
{AC769337-906E-4D1F-BC98-3CC1341323C4} = {14644FDA-EA92-4678-8C10-7A84B14FCC23}
EndGlobalSection
GlobalSection(ExtensibilityGlobals) = postSolution
SolutionGuid = {0DAA41C6-3CA8-4C2F-B6E3-1A585E82830C}
Expand Down
14 changes: 1 addition & 13 deletions Flips/Flips.fsproj
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
<?xml version="1.0" encoding="utf-8"?>
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFramework>netstandard2.0</TargetFramework>
<Platforms>x64</Platforms>
<TargetFrameworks>net6.0; net462</TargetFrameworks>
<Authors>Matthew Crews</Authors>
<Company>Matthew Crews</Company>
<Description>A F# library for creating and solving Linear Programming and Mixed Integer Programming Models</Description>
Expand All @@ -22,17 +21,6 @@
<OtherFlags>$(OtherFlags) --warnon:3390</OtherFlags>
<AllowedOutputExtensionsInPackageBuildOutputFolder>$(AllowedOutputExtensionsInPackageBuildOutputFolder);.pdb</AllowedOutputExtensionsInPackageBuildOutputFolder>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
<NoWarn>NU1701;0052;</NoWarn>
<DocumentationFile>bin\x64\Debug\netstandard2.0\Flips.xml</DocumentationFile>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
<NoWarn>NU1701;0052;</NoWarn>
<Optimize>true</Optimize>
<Tailcalls>true</Tailcalls>
<WarningLevel>5</WarningLevel>
<DocumentationFile>bin\x64\Release\netstandard2.0\Flips.xml</DocumentationFile>
</PropertyGroup>
<PropertyGroup>
<GenerateDocumentationFile>true</GenerateDocumentationFile>
</PropertyGroup>
Expand Down
42 changes: 21 additions & 21 deletions Flips/Types.fs
Original file line number Diff line number Diff line change
Expand Up @@ -262,22 +262,22 @@ and
static member Zero =
LinearExpression.Empty

static member (+) (l:LinearExpression, r:LinearExpression) =
static member (+) (l:LinearExpression, r:LinearExpression): LinearExpression =
LinearExpression.AddLinearExpression (l, r)

static member (+) (expr:LinearExpression, f:float) =
static member (+) (expr:LinearExpression, f:float): LinearExpression =
LinearExpression.AddFloat (f, expr)

static member (+) (f:float, expr:LinearExpression) =
static member (+) (f:float, expr:LinearExpression): LinearExpression =
expr + f

static member (+) (expr:LinearExpression, decision:Decision) =
static member (+) (expr:LinearExpression, decision:Decision): LinearExpression =
LinearExpression.AddDecision ((1.0, decision), expr)

static member (+) (decision:Decision, expr:LinearExpression) =
static member (+) (decision:Decision, expr:LinearExpression): LinearExpression =
expr + decision

static member (*) (expr:LinearExpression, f:float) =
static member (*) (expr:LinearExpression, f:float): LinearExpression =
LinearExpression.Multiply (f, expr)

static member (*) (f:float, expr:LinearExpression) =
Expand All @@ -304,49 +304,49 @@ and
static member OfDecision (d:Decision) =
LinearExpression.AddDecision((1.0, d), LinearExpression.Zero)

static member (<==) (lhs:LinearExpression, rhs:float) =
static member (<==) (lhs:LinearExpression, rhs:float): ConstraintExpression =
Inequality (lhs, LessOrEqual, LinearExpression.OfFloat rhs)

static member (<==) (lhs:float, rhs:LinearExpression) =
static member (<==) (lhs:float, rhs:LinearExpression): ConstraintExpression =
Inequality (LinearExpression.OfFloat lhs, LessOrEqual, rhs)

static member (<==) (lhs:LinearExpression, rhs:Decision) =
static member (<==) (lhs:LinearExpression, rhs:Decision): ConstraintExpression =
Inequality (lhs, LessOrEqual, LinearExpression.OfDecision rhs)

static member (<==) (decision:Decision, expr:LinearExpression) =
static member (<==) (decision:Decision, expr:LinearExpression): ConstraintExpression =
LinearExpression.OfDecision decision <== expr

static member (<==) (lhs:LinearExpression, rhs:LinearExpression) =
static member (<==) (lhs:LinearExpression, rhs:LinearExpression): ConstraintExpression =
Inequality (lhs, LessOrEqual, rhs)

static member (==) (lhs:LinearExpression, rhs:float) =
static member (==) (lhs:LinearExpression, rhs:float): ConstraintExpression =
Equality (lhs, LinearExpression.OfFloat rhs)

static member (==) (lhs:float, rhs:LinearExpression) =
static member (==) (lhs:float, rhs:LinearExpression): ConstraintExpression =
Equality (LinearExpression.OfFloat lhs, rhs)

static member (==) (lhs:LinearExpression, rhs:Decision) =
static member (==) (lhs:LinearExpression, rhs:Decision): ConstraintExpression =
Equality (lhs, LinearExpression.OfDecision rhs)

static member (==) (decision:Decision, expr:LinearExpression) =
static member (==) (decision:Decision, expr:LinearExpression): ConstraintExpression =
LinearExpression.OfDecision decision == expr

static member (==) (lhs:LinearExpression, rhs:LinearExpression) =
static member (==) (lhs:LinearExpression, rhs:LinearExpression): ConstraintExpression =
Equality (lhs, rhs)

static member (>==) (lhs:LinearExpression, rhs:float) =
static member (>==) (lhs:LinearExpression, rhs:float): ConstraintExpression =
Inequality (lhs, GreaterOrEqual, LinearExpression.OfFloat rhs)

static member (>==) (lhs:float, rhs:LinearExpression) =
static member (>==) (lhs:float, rhs:LinearExpression): ConstraintExpression =
Inequality (LinearExpression.OfFloat lhs, GreaterOrEqual, rhs)

static member (>==) (lhs:LinearExpression, rhs:Decision) =
static member (>==) (lhs:LinearExpression, rhs:Decision): ConstraintExpression =
Inequality (lhs, GreaterOrEqual, LinearExpression.OfDecision rhs)

static member (>==) (decision:Decision, expr:LinearExpression) =
static member (>==) (decision:Decision, expr:LinearExpression): ConstraintExpression =
LinearExpression.OfDecision decision >== expr

static member (>==) (lhs:LinearExpression, rhs:LinearExpression) =
static member (>==) (lhs:LinearExpression, rhs:LinearExpression): ConstraintExpression =
Inequality (lhs, GreaterOrEqual, rhs)

and
Expand Down
6 changes: 6 additions & 0 deletions RELEASE_NOTES.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
### 2.4.10 - Wednesday, May 8th, 2024
* Update to .NET 8
* Remove x64 restriction
* Change to FAKE build project
* Update to latest Google.OrTools package

### 2.4.9 - Wednesday, October 19th, 2022
* Fix problem with Units of Measure when multiplying float and LinearExpression

Expand Down
2 changes: 1 addition & 1 deletion build.cmd
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,4 @@
cls

dotnet tool restore
dotnet fake build %*
dotnet run --project build %*
Loading

0 comments on commit 4252db4

Please sign in to comment.