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 to .NET 6 #166

Merged
merged 2 commits into from
Jan 9, 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
6 changes: 3 additions & 3 deletions .config/dotnet-tools.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,19 +3,19 @@
"isRoot": true,
"tools": {
"fake-cli": {
"version": "5.20.4",
"version": "6.0.0-beta001",
"commands": [
"fake"
]
},
"paket": {
"version": "6.0.0-rc006",
"version": "7.2.0",
"commands": [
"paket"
]
},
"dotnet-serve": {
"version": "1.7.120",
"version": "1.10.149",
"commands": [
"dotnet-serve"
]
Expand Down
11 changes: 2 additions & 9 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,19 +15,12 @@ jobs:
fail-fast: false
matrix:
os: [ubuntu-latest, windows-latest, macOS-latest]
dotnet: [5.0.404]
runs-on: ${{ matrix.os }}

steps:
- uses: actions/checkout@v1
- uses: actions/checkout@v3
- name: Setup .NET for main project build
uses: actions/setup-dotnet@v1
with:
dotnet-version: ${{ matrix.dotnet }}
- name: Setup .NET for build tools
uses: actions/setup-dotnet@v1
with:
dotnet-version: '3.1.x'
uses: actions/setup-dotnet@v3
- name: Install local tools
run: dotnet tool restore
- name: Paket restore
Expand Down
37 changes: 17 additions & 20 deletions build.fsx
Original file line number Diff line number Diff line change
@@ -1,13 +1,14 @@
#r @"paket:
nuget FSharp.Core 4.7.2
frameworks: net6.0

nuget FSharp.Core ~> 6
nuget Fake.Core.Target
nuget Fake.Core.ReleaseNotes
nuget Fake.IO.FileSystem
nuget Fake.DotNet.Cli
nuget Fake.DotNet.AssemblyInfoFile
nuget Fake.DotNet.Paket
nuget Fake.Tools.Git
nuget MsBuild.StructuredLogger >= 2.1.507 //"
nuget MsBuild.StructuredLogger //"

#if !FAKE
#load "./.fake/build.fsx/intellisense.fsx"
Expand All @@ -26,7 +27,6 @@ open Fake
open Fake.Core.TargetOperators
open Fake.Core
open Fake.Tools.Git
open Fake.DotNet
open Fake.IO
open Fake.IO.FileSystemOperators
open Fake.IO.Globbing.Operators
Expand Down Expand Up @@ -111,8 +111,16 @@ Target.create "CleanDocs" (fun _ ->
// --------------------------------------------------------------------------------------
// Build library & test project

let dotnet arguments =
let result =
CreateProcess.fromRawCommandLine "dotnet" arguments
|> Proc.run

if result.ExitCode <> 0 then
failwithf "Failed to run \"dotnet %s\"" arguments

Target.create "Build" (fun _ ->
for framework in ["netcoreapp3.1"] do
for framework in ["net6.0"] do
[
"src/FsLex.Core/fslexlex.fs"
"src/FsLex.Core/fslexpars.fs"
Expand All @@ -123,12 +131,7 @@ Target.create "Build" (fun _ ->
] |> File.deleteAll

for project in ["src/FsLex/fslex.fsproj"; "src/FsYacc/fsyacc.fsproj"] do
DotNet.publish (fun opts -> {
opts with
Common = { opts.Common with CustomParams = Some "/v:n" }
Configuration = DotNet.BuildConfiguration.Release
Framework = Some framework
}) project
dotnet $"publish {project} -c Release /v:n -f {framework}"

[
"tests/JsonLexAndYaccExample/Lexer.fs"
Expand All @@ -142,25 +145,19 @@ Target.create "Build" (fun _ ->
for project in [ "src/FsLexYacc.Runtime/FsLexYacc.Runtime.fsproj"
"tests/JsonLexAndYaccExample/JsonLexAndYaccExample.fsproj"
"tests/LexAndYaccMiniProject/LexAndYaccMiniProject.fsproj" ] do
DotNet.build (fun opts -> {
opts with
Common = { opts.Common with CustomParams = Some "/v:n" }
Configuration = DotNet.BuildConfiguration.Release
}) project
dotnet $"build {project} -c Release /v:n"
)

Target.create "RunTests" (fun _ ->
DotNet.test id "."
dotnet "test ."
)

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

Target.create "RunOldFsYaccTests" (fun _ ->
let script = Path.Combine(__SOURCE_DIRECTORY__, "tests", "fsyacc", "OldFsYaccTests.fsx")
let result = DotNet.exec id "fake" ("run " + script)
if not result.OK then
failwith "Old FsLexYacc tests were failed"
dotnet $"fake run {script}"
)

// --------------------------------------------------------------------------------------
Expand Down
Loading