diff --git a/Directory.Build.props b/Directory.Build.props index 7a8ddc9cca..d2c654e577 100644 --- a/Directory.Build.props +++ b/Directory.Build.props @@ -35,6 +35,7 @@ Some common use cases include: true true NU1603 + true true true diff --git a/Directory.Packages.props b/Directory.Packages.props index 32edc83e42..b247dc8275 100644 --- a/Directory.Packages.props +++ b/Directory.Packages.props @@ -27,7 +27,7 @@ - + diff --git a/NuGet.config b/NuGet.config index 322a22ed53..dba2cef5d7 100644 --- a/NuGet.config +++ b/NuGet.config @@ -3,5 +3,16 @@ + + + + + + + + + + + \ No newline at end of file diff --git a/build.fsx b/build.fsx index 93d7dd4060..a78c069d06 100644 --- a/build.fsx +++ b/build.fsx @@ -28,20 +28,14 @@ let cleanFolders (input: string seq) = } let benchmarkAssembly = - "src" - "Fantomas.Benchmarks" - "bin" - "Release" - "net7.0" - "Fantomas.Benchmarks.dll" + "artifacts/bin/Fantomas.Benchmarks/release/Fantomas.Benchmarks.dll" let semanticVersioning = __SOURCE_DIRECTORY__ - "src" - "Fantomas" + "artifacts" "bin" - "Release" - "net6.0" + "Fantomas" + "release" "SemanticVersioning.dll" let pushPackage nupkg = @@ -62,25 +56,11 @@ let analysisReportsDir = "analysisreports" pipeline "Build" { workingDir __SOURCE_DIRECTORY__ stage "RestoreTools" { run "dotnet tool restore" } - stage "Clean" { - run ( - cleanFolders - [| analysisReportsDir - "bin" - "src/Fantomas.FCS/bin/Release" - "src/Fantomas.FCS/obj/Release" - "src/Fantomas.Core/bin/Release" - "src/Fantomas.Core/obj/Release" - "src/Fantomas/bin/Release" - "src/Fantomas/obj/Release" - "src/Fantomas.Client/bin/Release" - "src/Fantomas.Client/obj/Release" |] - ) - } + stage "Clean" { run (cleanFolders [| analysisReportsDir; "artifacts" |]) } stage "CheckFormat" { run "dotnet fantomas src docs build.fsx --check" } - stage "Build" { run "dotnet build -c Release" } - stage "UnitTests" { run "dotnet test -c Release" } - stage "Pack" { run "dotnet pack --no-restore -c Release -o ./bin" } + stage "Build" { run "dotnet build -c Release --tl" } + stage "UnitTests" { run "dotnet test -c Release --tl" } + stage "Pack" { run "dotnet pack --no-restore -c Release --tl" } stage "Docs" { whenNot { platformOSX } envVars @@ -94,7 +74,7 @@ pipeline "Build" { pipeline "Benchmark" { workingDir __SOURCE_DIRECTORY__ - stage "Prepare" { run "dotnet build -c Release src/Fantomas.Benchmarks" } + stage "Prepare" { run "dotnet build -c Release src/Fantomas.Benchmarks --tl" } stage "Benchmark" { run $"dotnet {benchmarkAssembly}" } runIfOnlySpecified true } @@ -154,7 +134,11 @@ pipeline "PushClient" { run (fun _ -> async { return! - Directory.EnumerateFiles("bin", "Fantomas.Client.*.nupkg", SearchOption.TopDirectoryOnly) + Directory.EnumerateFiles( + "artifacts/package/release", + "Fantomas.Client.*.nupkg", + SearchOption.TopDirectoryOnly + ) |> Seq.tryExactlyOne |> Option.map pushPackage |> Option.defaultValue ( @@ -449,7 +433,7 @@ pipeline "Release" { else // Push packages to NuGet let nugetPackages = - Directory.EnumerateFiles("bin", "*.nupkg", SearchOption.TopDirectoryOnly) + Directory.EnumerateFiles("artifacts/package/release", "*.nupkg", SearchOption.TopDirectoryOnly) |> Seq.filter (fun nupkg -> not (nupkg.Contains("Fantomas.Client"))) |> Seq.toArray diff --git a/docs/docs/end-users/Configuration.fsx b/docs/docs/end-users/Configuration.fsx index 4264990ae4..26b93c9621 100644 --- a/docs/docs/end-users/Configuration.fsx +++ b/docs/docs/end-users/Configuration.fsx @@ -20,8 +20,8 @@ UI might be available depending on the IDE. *) (*** hide ***) -#r "../../../src/Fantomas/bin/Release/net6.0/Fantomas.FCS.dll" -#r "../../../src/Fantomas/bin/Release/net6.0/Fantomas.Core.dll" +#r "../../../artifacts/bin/Fantomas.FCS/release/Fantomas.FCS.dll" +#r "../../../artifacts/bin/Fantomas.Core/release/Fantomas.Core.dll" printf $"version: {Fantomas.Core.CodeFormatter.GetVersion()}" (*** include-output ***) diff --git a/docs/docs/end-users/GeneratingCode.fsx b/docs/docs/end-users/GeneratingCode.fsx index 4ead8ae3b2..99ad8a2ec3 100644 --- a/docs/docs/end-users/GeneratingCode.fsx +++ b/docs/docs/end-users/GeneratingCode.fsx @@ -32,8 +32,8 @@ In simple scenarios this can work out, but in the long run it doesn't scale well To illustrate the API, lets generate a simple value binding: `let a = 0`. *) -#r "../../../src/Fantomas/bin/Release/net6.0/Fantomas.FCS.dll" -#r "../../../src/Fantomas/bin/Release/net6.0/Fantomas.Core.dll" // In production use #r "nuget: Fantomas.Core, 6.*" +#r "../../../artifacts/bin/Fantomas.FCS/release/Fantomas.FCS.dll" +#r "../../../artifacts/bin/Fantomas.Core/release/Fantomas.Core.dll" // In production use #r "nuget: Fantomas.Core, 6.*" open Fantomas.FCS.Text open Fantomas.Core.SyntaxOak diff --git a/docs/docs/end-users/GettingStarted.fsx b/docs/docs/end-users/GettingStarted.fsx index 93559887c3..4d38cd9148 100644 --- a/docs/docs/end-users/GettingStarted.fsx +++ b/docs/docs/end-users/GettingStarted.fsx @@ -34,7 +34,7 @@ For the overview how to use the tool, you can type the command open System.Diagnostics let fantomasDll = - System.IO.Path.Combine(__SOURCE_DIRECTORY__, "../../../src/Fantomas/bin/Release/net6.0/fantomas.dll") + System.IO.Path.Combine(__SOURCE_DIRECTORY__, "../../../artifacts/bin/fantomas/release/fantomas.dll") let output = let psi = ProcessStartInfo("dotnet", $"{fantomasDll} --help") diff --git a/src/Fantomas.Benchmarks/Fantomas.Benchmarks.fsproj b/src/Fantomas.Benchmarks/Fantomas.Benchmarks.fsproj index 939e463e56..5152fe51d8 100644 --- a/src/Fantomas.Benchmarks/Fantomas.Benchmarks.fsproj +++ b/src/Fantomas.Benchmarks/Fantomas.Benchmarks.fsproj @@ -2,7 +2,7 @@ Exe - net7.0 + net8.0 false diff --git a/src/Fantomas.Benchmarks/packages.lock.json b/src/Fantomas.Benchmarks/packages.lock.json index e7d5cddbfc..85611addd4 100644 --- a/src/Fantomas.Benchmarks/packages.lock.json +++ b/src/Fantomas.Benchmarks/packages.lock.json @@ -1,14 +1,14 @@ { "version": 2, "dependencies": { - "net7.0": { + "net8.0": { "BenchmarkDotNet": { "type": "Direct", - "requested": "[0.13.11, )", - "resolved": "0.13.11", - "contentHash": "BSsrfesUFgrjy/MtlupiUrZKgcBCCKmFXmNaVQLrBCs0/2iE/qH1puN7lskTE9zM0+MdiCr09zKk6MXKmwmwxw==", + "requested": "[0.13.13-nightly.20240213.132, )", + "resolved": "0.13.13-nightly.20240213.132", + "contentHash": "2dGQPEr47nGnsgipskl3rWS+dVWm+xkVzS/1jAF49VdDdGh6JLQkaVv5k59UewMF6ofGV1EvF5HeO55wwTRaww==", "dependencies": { - "BenchmarkDotNet.Annotations": "0.13.11", + "BenchmarkDotNet.Annotations": "0.13.13-nightly.20240213.132", "CommandLineParser": "2.9.1", "Gee.External.Capstone": "2.3.0", "Iced": "1.17.0", @@ -46,8 +46,8 @@ }, "BenchmarkDotNet.Annotations": { "type": "Transitive", - "resolved": "0.13.11", - "contentHash": "JOX+Bhp+PNnAtu/er9iGiN8QRIrYzilxUcJbwrF8VYyTNE8r4jlewa17/FbW1G7Jp2JUZwVS1A8a0bGILKhikw==" + "resolved": "0.13.13-nightly.20240213.132", + "contentHash": "G40jV79QmtgQbqaIPUmQ2CCswnfO7j/tdL0ENbAevVsuBW5rGoxj2V3NlMiSUQO9MogRk3rWMnXytFYcRFmP4w==" }, "CommandLineParser": { "type": "Transitive", diff --git a/src/Fantomas.Client.Tests/Fantomas.Client.Tests.fsproj b/src/Fantomas.Client.Tests/Fantomas.Client.Tests.fsproj index 6776ff1eaf..3fe6e272c0 100644 --- a/src/Fantomas.Client.Tests/Fantomas.Client.Tests.fsproj +++ b/src/Fantomas.Client.Tests/Fantomas.Client.Tests.fsproj @@ -2,7 +2,7 @@ FS0988 - net7.0 + net8.0 false false Major diff --git a/src/Fantomas.Client.Tests/packages.lock.json b/src/Fantomas.Client.Tests/packages.lock.json index ae4c9ff944..5d90348e5f 100644 --- a/src/Fantomas.Client.Tests/packages.lock.json +++ b/src/Fantomas.Client.Tests/packages.lock.json @@ -1,7 +1,7 @@ { "version": 2, "dependencies": { - "net7.0": { + "net8.0": { "CliWrap": { "type": "Direct", "requested": "[3.6.4, )", diff --git a/src/Fantomas.Core.Tests/Fantomas.Core.Tests.fsproj b/src/Fantomas.Core.Tests/Fantomas.Core.Tests.fsproj index dcaf08cfa3..78718e4321 100644 --- a/src/Fantomas.Core.Tests/Fantomas.Core.Tests.fsproj +++ b/src/Fantomas.Core.Tests/Fantomas.Core.Tests.fsproj @@ -1,7 +1,7 @@ FS0988 - net7.0 + net8.0 FS0025 false Major diff --git a/src/Fantomas.Core.Tests/packages.lock.json b/src/Fantomas.Core.Tests/packages.lock.json index d1be070131..e97b4ff286 100644 --- a/src/Fantomas.Core.Tests/packages.lock.json +++ b/src/Fantomas.Core.Tests/packages.lock.json @@ -1,7 +1,7 @@ { "version": 2, "dependencies": { - "net7.0": { + "net8.0": { "FsCheck": { "type": "Direct", "requested": "[2.16.5, )", diff --git a/src/Fantomas.Tests/Fantomas.Tests.fsproj b/src/Fantomas.Tests/Fantomas.Tests.fsproj index ff15063af2..8243c389c8 100644 --- a/src/Fantomas.Tests/Fantomas.Tests.fsproj +++ b/src/Fantomas.Tests/Fantomas.Tests.fsproj @@ -1,7 +1,7 @@  - net7.0 + net8.0 false false FS0988 diff --git a/src/Fantomas.Tests/Integration/ForceTests.fs b/src/Fantomas.Tests/Integration/ForceTests.fs index ff4b8a548a..75ea1a94ea 100644 --- a/src/Fantomas.Tests/Integration/ForceTests.fs +++ b/src/Fantomas.Tests/Integration/ForceTests.fs @@ -15,7 +15,11 @@ let ``code that was invalid should be still be written`` () = let pwd = Path.GetDirectoryName(typeof.Assembly.Location) let sourceFile = - Path.Combine(pwd, "..", "..", "..", "..", "..", "tests", "data", "CheckDeclarations.fs") + Path.Combine(pwd, "..", "..", "..", "..", "tests", "data", "CheckDeclarations.fs") + |> Path.GetFullPath + + if not (File.Exists sourceFile) then + failwithf $"CheckDeclarations.fs was not found at \"%s{sourceFile}\"" use outputFixture = new OutputFile() diff --git a/src/Fantomas.Tests/TestHelpers.fs b/src/Fantomas.Tests/TestHelpers.fs index ad7f536ecb..c7be7892e4 100644 --- a/src/Fantomas.Tests/TestHelpers.fs +++ b/src/Fantomas.Tests/TestHelpers.fs @@ -118,13 +118,17 @@ let getFantomasToolStartInfo arguments : ProcessStartInfo = let configuration = #if DEBUG - "Debug" + "debug" #else - "Release" + "release" #endif let fantomasDll = - Path.Combine(pwd, "..", "..", "..", "..", "Fantomas", "bin", configuration, "net6.0", "fantomas.dll") + Path.Combine(pwd, "..", "..", "Fantomas", configuration, "fantomas.dll") + |> Path.GetFullPath + + if not (File.Exists fantomasDll) then + failwithf $"The fantomas dll at \"%s{fantomasDll}\" does not exist!" let startInfo = ProcessStartInfo("dotnet") startInfo.UseShellExecute <- false diff --git a/src/Fantomas.Tests/packages.lock.json b/src/Fantomas.Tests/packages.lock.json index 46cba92859..c1bd3d15c8 100644 --- a/src/Fantomas.Tests/packages.lock.json +++ b/src/Fantomas.Tests/packages.lock.json @@ -1,7 +1,7 @@ { "version": 2, "dependencies": { - "net7.0": { + "net8.0": { "FsCheck": { "type": "Direct", "requested": "[2.16.5, )",