diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 8c0c353..4107def 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -18,18 +18,17 @@ jobs: build: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@v5 with: fetch-depth: 1 - run: | git fetch --prune --unshallow --tags echo exit code $? git tag --list - - uses: actions/setup-dotnet@v1 + - uses: actions/setup-dotnet@v5 with: dotnet-version: | - 8.0.x - 6.0.x + 10.0.x source-url: https://nuget.pkg.github.com/nullean/index.json env: NUGET_AUTH_TOKEN: ${{secrets.GITHUB_TOKEN}} diff --git a/Directory.Build.props b/Directory.Build.props index 57e91e2..5c7db3a 100644 --- a/Directory.Build.props +++ b/Directory.Build.props @@ -5,7 +5,7 @@ 0.2 - + all diff --git a/build/scripts/Paths.fs b/build/scripts/Paths.fs index 8469cd2..7e4ce7c 100644 --- a/build/scripts/Paths.fs +++ b/build/scripts/Paths.fs @@ -14,7 +14,7 @@ let GenerateApiChanges = true let Root = let mutable dir = DirectoryInfo(".") - while dir.GetFiles("*.sln").Length = 0 do dir <- dir.Parent + while dir.GetFiles("*.slnx").Length = 0 do dir <- dir.Parent Environment.CurrentDirectory <- dir.FullName dir diff --git a/build/scripts/Program.fs b/build/scripts/Program.fs index c346f06..88ff9c9 100644 --- a/build/scripts/Program.fs +++ b/build/scripts/Program.fs @@ -26,7 +26,8 @@ let main argv = Targets.Setup parsed arguments let swallowTypes = [typeof; typeof] - Targets.RunTargetsAndExit - ([target], (fun e -> swallowTypes |> List.contains (e.GetType()) ), ":") + task { + return! Targets.RunTargetsAndExitAsync([ target ], (fun e -> swallowTypes |> List.contains (e.GetType())), (fun _ -> ":"), null, null) + } |> Async.AwaitTask |> Async.RunSynchronously 0 diff --git a/build/scripts/Targets.fs b/build/scripts/Targets.fs index 0803530..75a2360 100644 --- a/build/scripts/Targets.fs +++ b/build/scripts/Targets.fs @@ -10,8 +10,7 @@ open ProcNet let exec binary args = - let r = Proc.Exec (binary, args |> List.map (fun a -> sprintf "\"%s\"" a) |> List.toArray) - match r.HasValue with | true -> r.Value | false -> failwithf "invocation of `%s` timed out" binary + Proc.Exec (binary, args |> List.toArray) let private restoreTools = lazy(exec "dotnet" ["tool"; "restore"]) let private currentVersion = @@ -42,10 +41,7 @@ let private pristineCheck (arguments:ParseResults) = | _ -> failwithf "The checkout folder has pending changes, aborting" let private test (arguments:ParseResults) = - let junitOutput = Path.Combine(Paths.Output.FullName, "junit-{assembly}-{framework}-test-results.xml") - let loggerPathArgs = sprintf "LogFilePath=%s" junitOutput - let loggerArg = sprintf "--logger:\"junit;%s\"" loggerPathArgs - exec "dotnet" ["test"; "-c"; "RELEASE"; loggerArg; "--logger:pretty"] |> ignore + exec "dotnet" ["test"; "-c"; "RELEASE"; "--logger:GithubActions"; "--logger:pretty"] |> ignore let private generatePackages (arguments:ParseResults) = let output = Paths.RootRelative Paths.Output.FullName diff --git a/build/scripts/scripts.fsproj b/build/scripts/scripts.fsproj index dbe08c2..ffc3ed3 100644 --- a/build/scripts/scripts.fsproj +++ b/build/scripts/scripts.fsproj @@ -2,14 +2,15 @@ Exe - net8.0 + net10.0 false - - + + + diff --git a/dotnet-tools.json b/dotnet-tools.json index 3f257d1..b98f275 100644 --- a/dotnet-tools.json +++ b/dotnet-tools.json @@ -3,28 +3,32 @@ "isRoot": true, "tools": { "minver-cli": { - "version": "4.3.0", + "version": "6.0.0", "commands": [ "minver" - ] + ], + "rollForward": false }, "release-notes": { - "version": "0.6.0", + "version": "0.10.0", "commands": [ "release-notes" - ] + ], + "rollForward": false }, "nupkg-validator": { - "version": "0.6.0", + "version": "0.10.1", "commands": [ "nupkg-validator" - ] + ], + "rollForward": false }, "assembly-differ": { - "version": "0.15.0", + "version": "0.16.0", "commands": [ "assembly-differ" - ] + ], + "rollForward": false } } } \ No newline at end of file diff --git a/examples/ScratchPad.Fs.ArgumentPrinter/ScratchPad.Fs.ArgumentPrinter.fsproj b/examples/ScratchPad.Fs.ArgumentPrinter/ScratchPad.Fs.ArgumentPrinter.fsproj index 5a150c1..ec8b70e 100644 --- a/examples/ScratchPad.Fs.ArgumentPrinter/ScratchPad.Fs.ArgumentPrinter.fsproj +++ b/examples/ScratchPad.Fs.ArgumentPrinter/ScratchPad.Fs.ArgumentPrinter.fsproj @@ -2,12 +2,11 @@ Exe - net8.0 + net10.0 false - diff --git a/examples/ScratchPad.Fs/ScratchPad.Fs.fsproj b/examples/ScratchPad.Fs/ScratchPad.Fs.fsproj index 33b3c9b..b8f28f9 100644 --- a/examples/ScratchPad.Fs/ScratchPad.Fs.fsproj +++ b/examples/ScratchPad.Fs/ScratchPad.Fs.fsproj @@ -2,7 +2,7 @@ Exe - net8.0 + net10.0 false diff --git a/examples/ScratchPad/ScratchPad.csproj b/examples/ScratchPad/ScratchPad.csproj index cec76a3..089342d 100644 --- a/examples/ScratchPad/ScratchPad.csproj +++ b/examples/ScratchPad/ScratchPad.csproj @@ -1,7 +1,7 @@  Exe - net8.0 + net10.0 false diff --git a/examples/ScratchPad/TestBinary.cs b/examples/ScratchPad/TestBinary.cs index f012edb..b8dae39 100644 --- a/examples/ScratchPad/TestBinary.cs +++ b/examples/ScratchPad/TestBinary.cs @@ -34,7 +34,7 @@ public static StartArguments TestCaseArguments(string testcase) => private static string GetDll() { - var dll = Path.Combine("bin", GetRunningConfiguration(), "net8.0", _procTestBinary + ".dll"); + var dll = Path.Combine("bin", GetRunningConfiguration(), "net10.0", _procTestBinary + ".dll"); var fullPath = Path.Combine(GetWorkingDir(), dll); if (!File.Exists(fullPath)) throw new Exception($"Can not find {fullPath}"); diff --git a/global.json b/global.json index 789bff3..fe7e453 100644 --- a/global.json +++ b/global.json @@ -1,6 +1,6 @@ { "sdk": { - "version": "8.0.100", + "version": "10.0.100", "rollForward": "latestFeature", "allowPrerelease": false } diff --git a/proc.sln b/proc.sln deleted file mode 100644 index 6cfbde5..0000000 --- a/proc.sln +++ /dev/null @@ -1,103 +0,0 @@ - -Microsoft Visual Studio Solution File, Format Version 12.00 -# Visual Studio 2013 -VisualStudioVersion = 12.0.0.0 -MinimumVisualStudioVersion = 10.0.0.1 -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Proc.Tests.Binary", "tests\Proc.Tests.Binary\Proc.Tests.Binary.csproj", "{D3AFFBE0-8F40-42C7-8A6A-BCCD2EDF4A3E}" -EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Proc.Tests", "tests\Proc.Tests\Proc.Tests.csproj", "{BE04AF1C-20CB-497B-9725-518C0C8109ED}" -EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Proc", "src\Proc\Proc.csproj", "{4BE05F38-DAA3-45E3-A2F5-B7E6408941AD}" -EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "ScratchPad", "examples\ScratchPad\ScratchPad.csproj", "{E7AD2461-309A-4BA7-A6EB-5C1F4F882BC2}" -EndProject -Project("{F2A71F9B-5D33-465A-A702-920D77279786}") = "scripts", "build\scripts\scripts.fsproj", "{D6997ADC-E933-418E-831C-DE1A78897493}" -EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Proc.ControlC", "src\Proc.ControlC\Proc.ControlC.csproj", "{733EB608-B8B4-47FE-AB63-A4C7856C4209}" -EndProject -Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "src", "src", "{9C336E9A-3FC8-4F77-A5B4-1D07E4E54924}" -EndProject -Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "tests", "tests", "{0F267D58-B5AA-4D04-B346-12B283E37B68}" -ProjectSection(SolutionItems) = preProject - tests\Directory.Build.props = tests\Directory.Build.props -EndProjectSection -EndProject -Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "build", "build", "{E89606EC-111B-4151-997C-8006627F1926}" -ProjectSection(SolutionItems) = preProject - dotnet-tools.json = dotnet-tools.json - readme.md = readme.md - build.sh = build.sh - build.bat = build.bat - Directory.Build.props = Directory.Build.props - global.json = global.json - .editorconfig = .editorconfig - .gitignore = .gitignore - .github\workflows\ci.yml = .github\workflows\ci.yml -EndProjectSection -EndProject -Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "examples", "examples", "{E4B3DD3A-E36C-46D6-B35E-D824EB9B3C06}" -EndProject -Project("{F2A71F9B-5D33-465A-A702-920D77279786}") = "Proc.Fs", "src\Proc.Fs\Proc.Fs.fsproj", "{5EA4E26F-F623-473D-9CD7-E590A3E54239}" -EndProject -Project("{F2A71F9B-5D33-465A-A702-920D77279786}") = "ScratchPad.Fs", "examples\ScratchPad.Fs\ScratchPad.Fs.fsproj", "{C33E3F7C-0C2A-4DD2-91E4-328866195997}" -EndProject -Project("{F2A71F9B-5D33-465A-A702-920D77279786}") = "ScratchPad.Fs.ArgumentPrinter", "examples\ScratchPad.Fs.ArgumentPrinter\ScratchPad.Fs.ArgumentPrinter.fsproj", "{50A40BEB-1C22-41CF-908F-F24FB34B1699}" -EndProject -Global - GlobalSection(SolutionConfigurationPlatforms) = preSolution - Debug|Any CPU = Debug|Any CPU - Release|Any CPU = Release|Any CPU - EndGlobalSection - GlobalSection(ProjectConfigurationPlatforms) = postSolution - {4BE05F38-DAA3-45E3-A2F5-B7E6408941AD}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {4BE05F38-DAA3-45E3-A2F5-B7E6408941AD}.Debug|Any CPU.Build.0 = Debug|Any CPU - {4BE05F38-DAA3-45E3-A2F5-B7E6408941AD}.Release|Any CPU.ActiveCfg = Release|Any CPU - {4BE05F38-DAA3-45E3-A2F5-B7E6408941AD}.Release|Any CPU.Build.0 = Release|Any CPU - {E7AD2461-309A-4BA7-A6EB-5C1F4F882BC2}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {E7AD2461-309A-4BA7-A6EB-5C1F4F882BC2}.Debug|Any CPU.Build.0 = Debug|Any CPU - {E7AD2461-309A-4BA7-A6EB-5C1F4F882BC2}.Release|Any CPU.ActiveCfg = Release|Any CPU - {E7AD2461-309A-4BA7-A6EB-5C1F4F882BC2}.Release|Any CPU.Build.0 = Release|Any CPU - {D3AFFBE0-8F40-42C7-8A6A-BCCD2EDF4A3E}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {D3AFFBE0-8F40-42C7-8A6A-BCCD2EDF4A3E}.Debug|Any CPU.Build.0 = Debug|Any CPU - {D3AFFBE0-8F40-42C7-8A6A-BCCD2EDF4A3E}.Release|Any CPU.ActiveCfg = Release|Any CPU - {D3AFFBE0-8F40-42C7-8A6A-BCCD2EDF4A3E}.Release|Any CPU.Build.0 = Release|Any CPU - {BE04AF1C-20CB-497B-9725-518C0C8109ED}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {BE04AF1C-20CB-497B-9725-518C0C8109ED}.Debug|Any CPU.Build.0 = Debug|Any CPU - {BE04AF1C-20CB-497B-9725-518C0C8109ED}.Release|Any CPU.ActiveCfg = Release|Any CPU - {BE04AF1C-20CB-497B-9725-518C0C8109ED}.Release|Any CPU.Build.0 = Release|Any CPU - {733EB608-B8B4-47FE-AB63-A4C7856C4209}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {733EB608-B8B4-47FE-AB63-A4C7856C4209}.Debug|Any CPU.Build.0 = Debug|Any CPU - {733EB608-B8B4-47FE-AB63-A4C7856C4209}.Release|Any CPU.ActiveCfg = Release|Any CPU - {733EB608-B8B4-47FE-AB63-A4C7856C4209}.Release|Any CPU.Build.0 = Release|Any CPU - {D6997ADC-E933-418E-831C-DE1A78897493}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {D6997ADC-E933-418E-831C-DE1A78897493}.Release|Any CPU.ActiveCfg = Release|Any CPU - {D6997ADC-E933-418E-831C-DE1A78897493}.Debug|Any CPU.Build.0 = Debug|Any CPU - {D6997ADC-E933-418E-831C-DE1A78897493}.Release|Any CPU.Build.0 = Release|Any CPU - {5EA4E26F-F623-473D-9CD7-E590A3E54239}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {5EA4E26F-F623-473D-9CD7-E590A3E54239}.Debug|Any CPU.Build.0 = Debug|Any CPU - {5EA4E26F-F623-473D-9CD7-E590A3E54239}.Release|Any CPU.ActiveCfg = Release|Any CPU - {5EA4E26F-F623-473D-9CD7-E590A3E54239}.Release|Any CPU.Build.0 = Release|Any CPU - {C33E3F7C-0C2A-4DD2-91E4-328866195997}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {C33E3F7C-0C2A-4DD2-91E4-328866195997}.Debug|Any CPU.Build.0 = Debug|Any CPU - {C33E3F7C-0C2A-4DD2-91E4-328866195997}.Release|Any CPU.ActiveCfg = Release|Any CPU - {C33E3F7C-0C2A-4DD2-91E4-328866195997}.Release|Any CPU.Build.0 = Release|Any CPU - {50A40BEB-1C22-41CF-908F-F24FB34B1699}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {50A40BEB-1C22-41CF-908F-F24FB34B1699}.Debug|Any CPU.Build.0 = Debug|Any CPU - {50A40BEB-1C22-41CF-908F-F24FB34B1699}.Release|Any CPU.ActiveCfg = Release|Any CPU - {50A40BEB-1C22-41CF-908F-F24FB34B1699}.Release|Any CPU.Build.0 = Release|Any CPU - EndGlobalSection - GlobalSection(SolutionProperties) = preSolution - HideSolutionNode = FALSE - EndGlobalSection - GlobalSection(NestedProjects) = preSolution - {4BE05F38-DAA3-45E3-A2F5-B7E6408941AD} = {9C336E9A-3FC8-4F77-A5B4-1D07E4E54924} - {733EB608-B8B4-47FE-AB63-A4C7856C4209} = {9C336E9A-3FC8-4F77-A5B4-1D07E4E54924} - {BE04AF1C-20CB-497B-9725-518C0C8109ED} = {0F267D58-B5AA-4D04-B346-12B283E37B68} - {D3AFFBE0-8F40-42C7-8A6A-BCCD2EDF4A3E} = {0F267D58-B5AA-4D04-B346-12B283E37B68} - {E7AD2461-309A-4BA7-A6EB-5C1F4F882BC2} = {E4B3DD3A-E36C-46D6-B35E-D824EB9B3C06} - {D6997ADC-E933-418E-831C-DE1A78897493} = {E89606EC-111B-4151-997C-8006627F1926} - {5EA4E26F-F623-473D-9CD7-E590A3E54239} = {9C336E9A-3FC8-4F77-A5B4-1D07E4E54924} - {C33E3F7C-0C2A-4DD2-91E4-328866195997} = {E4B3DD3A-E36C-46D6-B35E-D824EB9B3C06} - {50A40BEB-1C22-41CF-908F-F24FB34B1699} = {E4B3DD3A-E36C-46D6-B35E-D824EB9B3C06} - EndGlobalSection -EndGlobal diff --git a/proc.slnx b/proc.slnx new file mode 100644 index 0000000..6024603 --- /dev/null +++ b/proc.slnx @@ -0,0 +1,29 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/src/Proc.Fs/Proc.Fs.fsproj b/src/Proc.Fs/Proc.Fs.fsproj index 6532e1e..f7a765e 100644 --- a/src/Proc.Fs/Proc.Fs.fsproj +++ b/src/Proc.Fs/Proc.Fs.fsproj @@ -43,4 +43,5 @@ + diff --git a/src/Proc/Proc.csproj b/src/Proc/Proc.csproj index 6bd8bde..42d16f8 100644 --- a/src/Proc/Proc.csproj +++ b/src/Proc/Proc.csproj @@ -2,7 +2,7 @@ proc - netstandard2.0;netstandard2.1;net461;net8.0 + netstandard2.0;netstandard2.1;net461;net8.0;net10.0 ProcNet diff --git a/tests/Directory.Build.props b/tests/Directory.Build.props index ffdec46..aa14971 100644 --- a/tests/Directory.Build.props +++ b/tests/Directory.Build.props @@ -2,7 +2,6 @@ - - + diff --git a/tests/Proc.Tests.Binary/Proc.Tests.Binary.csproj b/tests/Proc.Tests.Binary/Proc.Tests.Binary.csproj index aad40ae..66309ed 100644 --- a/tests/Proc.Tests.Binary/Proc.Tests.Binary.csproj +++ b/tests/Proc.Tests.Binary/Proc.Tests.Binary.csproj @@ -1,7 +1,7 @@ Exe - net8.0 + net10.0 Proc.Tests.Binary Proc.Tests.Binary CS1701,CS1591 diff --git a/tests/Proc.Tests/ControlCTestCases.cs b/tests/Proc.Tests/ControlCTestCases.cs index 22da4dc..6a10262 100644 --- a/tests/Proc.Tests/ControlCTestCases.cs +++ b/tests/Proc.Tests/ControlCTestCases.cs @@ -67,13 +67,13 @@ public void ControlCIngoredByCmd() { var args = CmdTestCaseArguments("TrulyLongRunning"); args.SendControlCFirst = true; args.WaitForExit = TimeSpan.FromSeconds(2); - + var process = new ObservableProcess(args); process.SubscribeLines(c => { }); Action call = () => process.WaitForCompletion(TimeSpan.FromSeconds(1)); - call.ShouldNotThrow(); + call.Should().NotThrow(); } } } diff --git a/tests/Proc.Tests/Proc.Tests.csproj b/tests/Proc.Tests/Proc.Tests.csproj index 913694a..cb16058 100644 --- a/tests/Proc.Tests/Proc.Tests.csproj +++ b/tests/Proc.Tests/Proc.Tests.csproj @@ -1,6 +1,6 @@  - net8.0 + net10.0 Proc.Tests ProcNet.Tests false @@ -13,13 +13,17 @@ + + all + runtime; build; native; contentfiles; analyzers; buildtransitive + - - - + + + all runtime; build; native; contentfiles; analyzers; buildtransitive - + \ No newline at end of file diff --git a/tests/Proc.Tests/ProcTestCases.cs b/tests/Proc.Tests/ProcTestCases.cs index dedf30a..4760bb4 100644 --- a/tests/Proc.Tests/ProcTestCases.cs +++ b/tests/Proc.Tests/ProcTestCases.cs @@ -37,8 +37,8 @@ public void ReadKeyFirst() public void BadBinary() { Action call = () => Proc.Start("this-does-not-exist.exe"); - var shouldThrow = call.ShouldThrow(); - shouldThrow.And.InnerException.Message.Should().NotBeEmpty(); + var shouldThrow = call.Should().Throw(); + shouldThrow.And.InnerException?.Message.Should().NotBeEmpty(); shouldThrow.And.Message.Should().Contain("this-does-not-exist.exe"); } } diff --git a/tests/Proc.Tests/TestsBase.cs b/tests/Proc.Tests/TestsBase.cs index e155883..6652cdf 100644 --- a/tests/Proc.Tests/TestsBase.cs +++ b/tests/Proc.Tests/TestsBase.cs @@ -55,7 +55,7 @@ protected static LongRunningArguments LongRunningTestCaseArguments(string testca private static string GetDll() { - var dll = Path.Combine("bin", GetRunningConfiguration(), "net8.0", _procTestBinary + ".dll"); + var dll = Path.Combine("bin", GetRunningConfiguration(), "net10.0", _procTestBinary + ".dll"); var fullPath = Path.Combine(GetWorkingDir(), dll); if (!File.Exists(fullPath)) throw new Exception($"Can not find {fullPath}");