From 0e15b52e4df395f6dbf9282fb87d33bb1f45f06b Mon Sep 17 00:00:00 2001 From: Jimmy Byrd Date: Mon, 18 Nov 2024 17:52:18 -0500 Subject: [PATCH] Update Proj-Info to use FCS and FSharp.Core from 9.0.100 (#219) This change * removes .NET 6 and 7 targets, adding a .NET 9 target * removes Paket in favor of NuGet CPM * updates the packaging of the app to include READMEs Co-authored-by: Chet Husk Co-authored-by: Chet Husk --- .config/dotnet-tools.json | 31 +- .editorconfig | 10 - .github/workflows/build.yml | 36 +- .github/workflows/publish.yml | 13 +- .paket/Paket.Restore.targets | 557 ------------------ CONTRIBUTING.md | 31 +- Directory.Packages.props | 60 ++ build/Program.fs | 12 +- build/build.fsproj | 20 +- build/paket.references | 13 - global.json | 10 +- install_mono_from_microsoft_deb_packages.sh | 15 - nuget.config | 8 + paket.dependencies | 52 -- paket.lock | 461 --------------- src/Directory.Build.props | 14 +- .../Ionide.ProjInfo.FCS.fsproj | 12 +- src/Ionide.ProjInfo.FCS/README.md | 11 + src/Ionide.ProjInfo.FCS/paket.references | 4 - src/Ionide.ProjInfo.ProjectSystem/FSIRefs.fs | 13 +- .../Ionide.ProjInfo.ProjectSystem.fsproj | 14 +- src/Ionide.ProjInfo.ProjectSystem/README.md | 12 + .../paket.references | 6 - .../Ionide.ProjInfo.Sln.csproj | 7 +- src/Ionide.ProjInfo.Sln/paket.references | 2 - .../Ionide.ProjInfo.Tool.fsproj | 37 +- src/Ionide.ProjInfo.Tool/README.md | 21 + src/Ionide.ProjInfo.Tool/paket.references | 6 - src/Ionide.ProjInfo/Ionide.ProjInfo.fsproj | 14 +- src/Ionide.ProjInfo/Library.fs | 11 +- src/Ionide.ProjInfo/README.md | 38 ++ src/Ionide.ProjInfo/paket.references | 6 - .../Ionide.ProjInfo.Tests.fsproj | 19 +- test/Ionide.ProjInfo.Tests/Program.fs | 13 +- test/Ionide.ProjInfo.Tests/Tests.fs | 20 +- test/Ionide.ProjInfo.Tests/paket.references | 12 - 36 files changed, 344 insertions(+), 1277 deletions(-) delete mode 100644 .paket/Paket.Restore.targets create mode 100644 Directory.Packages.props delete mode 100644 build/paket.references delete mode 100755 install_mono_from_microsoft_deb_packages.sh create mode 100644 nuget.config delete mode 100644 paket.dependencies delete mode 100644 paket.lock create mode 100644 src/Ionide.ProjInfo.FCS/README.md delete mode 100644 src/Ionide.ProjInfo.FCS/paket.references create mode 100644 src/Ionide.ProjInfo.ProjectSystem/README.md delete mode 100644 src/Ionide.ProjInfo.ProjectSystem/paket.references delete mode 100644 src/Ionide.ProjInfo.Sln/paket.references create mode 100644 src/Ionide.ProjInfo.Tool/README.md delete mode 100644 src/Ionide.ProjInfo.Tool/paket.references create mode 100644 src/Ionide.ProjInfo/README.md delete mode 100644 src/Ionide.ProjInfo/paket.references delete mode 100644 test/Ionide.ProjInfo.Tests/paket.references diff --git a/.config/dotnet-tools.json b/.config/dotnet-tools.json index aa272694..eb3eba54 100644 --- a/.config/dotnet-tools.json +++ b/.config/dotnet-tools.json @@ -1,30 +1,5 @@ { - "version": 1, - "isRoot": true, - "tools": { - "paket": { - "version": "8.0.3", - "commands": [ - "paket" - ] - }, - "fake-cli": { - "version": "6.0.0", - "commands": [ - "fake" - ] - }, - "octonav": { - "version": "0.0.1", - "commands": [ - "octonav" - ] - }, - "fantomas": { - "version": "6.1.2", - "commands": [ - "fantomas" - ] - } - } + "version": 1, + "isRoot": true, + "tools": {} } \ No newline at end of file diff --git a/.editorconfig b/.editorconfig index bc2cd779..d0574e74 100644 --- a/.editorconfig +++ b/.editorconfig @@ -55,16 +55,6 @@ end_of_line = crlf [*.{ps1, psm1}] end_of_line = crlf -# Paket files -[paket.*] -trim_trailing_whitespace = true -indent_size = 2 - -[*.paket.references] -trim_trailing_whitespace = true -indent_size = 2 - - # YAML Files [*.{yml,yaml}] indent_size = 2 diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 6b63052f..a8fdd773 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -11,30 +11,27 @@ jobs: strategy: matrix: os: [ubuntu-latest, windows-latest, macOS-latest] - dotnet-version: ["", "6.0.x", "7.0.x"] + dotnet-version: ["", "8.0.x", "9.0.x"] # these entries will mesh with the above combinations include: # just use what's in the repo - global-json-file: "global.json" dotnet-version: "" - include-prerelease: false label: "repo global.json" - build_net7: false - globaljson-command: "dotnet new globaljson --sdk-version 6.0.400" - # latest 6.0 stable + build_net9: false + globaljson-command: "dotnet new globaljson --sdk-version 8.0.400" + # latest 8.0 stable - global-json-file: "global.json" - dotnet-version: "6.0.x" - include-prerelease: false - label: "6.0 stable" - build_net7: false - globaljson-command: "dotnet new globaljson --sdk-version 6.0.0 --roll-forward latestMinor" - # latest 7.0 preview + dotnet-version: "8.0.x" + label: "8.0 stable" + build_net9: false + globaljson-command: "dotnet new globaljson --sdk-version 8.0.0 --roll-forward latestMinor" + # latest 9.0 stable - global-json-file: "global.json" - dotnet-version: "7.0.x" - include-prerelease: true - label: "7.0 preview" - build_net7: true - globaljson-command: "dotnet new globaljson --sdk-version 7.0.0 --roll-forward latestMinor" + dotnet-version: "9.0.x" + label: "9.0 stable" + build_net9: true + globaljson-command: "dotnet new globaljson --sdk-version 9.0.0 --roll-forward latestMinor" fail-fast: false # we have timing issues on some OS, so we want them all to run runs-on: ${{ matrix.os }} timeout-minutes: 15 @@ -46,13 +43,12 @@ jobs: # setup .NET per the repo global.json - name: Setup .NET - uses: actions/setup-dotnet@v2 + uses: actions/setup-dotnet@v4 # setup .NET per test session - name: Setup .NET - uses: actions/setup-dotnet@v2 + uses: actions/setup-dotnet@v4 with: - include-prerelease: ${{ matrix.include-prerelease }} global-json-file: ${{ matrix.global-json-file }} dotnet-version: ${{ matrix.dotnet-version }} @@ -72,7 +68,7 @@ jobs: - name: Run build and test run: dotnet run --project build env: - BuildNet7: ${{ matrix.build_net7 }} + BuildNet9: ${{ matrix.build_net9 }} - name: Archive test results uses: actions/upload-artifact@v3 diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml index 7721c707..278e1a79 100644 --- a/.github/workflows/publish.yml +++ b/.github/workflows/publish.yml @@ -12,12 +12,11 @@ jobs: steps: - uses: actions/checkout@v3 - name: Setup .NET Core - uses: actions/setup-dotnet@v2 + uses: actions/setup-dotnet@v4 with: dotnet-version: | - 6.0.x - 7.0.x - include-prerelease: true + 8.0.x + 9.0.x # since we're packaging for net7 now... - name: remove global.json run: rm global.json @@ -28,11 +27,11 @@ jobs: - name: Run build run: dotnet run --project build env: - BuildNet7: true + BuildNet9: true IgnoreTests: true - name: Get Changelog Entry id: changelog_reader - uses: mindsers/changelog-reader-action@v1.1.0 + uses: mindsers/changelog-reader-action@v2 with: version: ${{ github.ref }} path: ./CHANGELOG.md @@ -48,7 +47,7 @@ jobs: draft: false prerelease: false - name: Upload binaries to release - uses: svenstaro/upload-release-action@v1-release + uses: svenstaro/upload-release-action@v2 with: repo_token: ${{ secrets.GITHUB_TOKEN }} file: src/**/*.nupkg diff --git a/.paket/Paket.Restore.targets b/.paket/Paket.Restore.targets deleted file mode 100644 index e230bb21..00000000 --- a/.paket/Paket.Restore.targets +++ /dev/null @@ -1,557 +0,0 @@ - - - - - - - $(MSBuildAllProjects);$(MSBuildThisFileFullPath) - - $(MSBuildVersion) - 15.0.0 - false - true - - true - $(MSBuildThisFileDirectory) - $(MSBuildThisFileDirectory)..\ - $(PaketRootPath)paket-files\paket.restore.cached - $(PaketRootPath)paket.lock - classic - proj - assembly - native - /Library/Frameworks/Mono.framework/Commands/mono - mono - - - $(PaketRootPath)paket.bootstrapper.exe - $(PaketToolsPath)paket.bootstrapper.exe - $([System.IO.Path]::GetDirectoryName("$(PaketBootStrapperExePath)"))\ - - "$(PaketBootStrapperExePath)" - $(MonoPath) --runtime=v4.0.30319 "$(PaketBootStrapperExePath)" - - - - - true - true - - - True - - - False - - $(BaseIntermediateOutputPath.TrimEnd('\').TrimEnd('\/')) - - - - - - - - - $(PaketRootPath)paket - $(PaketToolsPath)paket - - - - - - $(PaketRootPath)paket.exe - $(PaketToolsPath)paket.exe - - - - - - <_DotnetToolsJson Condition="Exists('$(PaketRootPath)/.config/dotnet-tools.json')">$([System.IO.File]::ReadAllText("$(PaketRootPath)/.config/dotnet-tools.json")) - <_ConfigContainsPaket Condition=" '$(_DotnetToolsJson)' != ''">$(_DotnetToolsJson.Contains('"paket"')) - <_ConfigContainsPaket Condition=" '$(_ConfigContainsPaket)' == ''">false - - - - - - - - - - - <_PaketCommand>dotnet paket - - - - - - $(PaketToolsPath)paket - $(PaketBootStrapperExeDir)paket - - - paket - - - - - <_PaketExeExtension>$([System.IO.Path]::GetExtension("$(PaketExePath)")) - <_PaketCommand Condition=" '$(_PaketCommand)' == '' AND '$(_PaketExeExtension)' == '.dll' ">dotnet "$(PaketExePath)" - <_PaketCommand Condition=" '$(_PaketCommand)' == '' AND '$(OS)' != 'Windows_NT' AND '$(_PaketExeExtension)' == '.exe' ">$(MonoPath) --runtime=v4.0.30319 "$(PaketExePath)" - <_PaketCommand Condition=" '$(_PaketCommand)' == '' ">"$(PaketExePath)" - - - - - - - - - - - - - - - - - - - - - true - $(NoWarn);NU1603;NU1604;NU1605;NU1608 - false - true - - - - - - - - - $([System.IO.File]::ReadAllText('$(PaketRestoreCacheFile)')) - - - - - - - $([System.Text.RegularExpressions.Regex]::Split(`%(Identity)`, `": "`)[0].Replace(`"`, ``).Replace(` `, ``)) - $([System.Text.RegularExpressions.Regex]::Split(`%(Identity)`, `": "`)[1].Replace(`"`, ``).Replace(` `, ``)) - - - - - %(PaketRestoreCachedKeyValue.Value) - %(PaketRestoreCachedKeyValue.Value) - - - - - true - false - true - - - - - true - - - - - - - - - - - - - - - - - - - $(PaketIntermediateOutputPath)\$(MSBuildProjectFile).paket.references.cached - - $(MSBuildProjectFullPath).paket.references - - $(MSBuildProjectDirectory)\$(MSBuildProjectName).paket.references - - $(MSBuildProjectDirectory)\paket.references - - false - true - true - references-file-or-cache-not-found - - - - - $([System.IO.File]::ReadAllText('$(PaketReferencesCachedFilePath)')) - $([System.IO.File]::ReadAllText('$(PaketOriginalReferencesFilePath)')) - references-file - false - - - - - false - - - - - true - target-framework '$(TargetFramework)' or '$(TargetFrameworks)' files @(PaketResolvedFilePaths) - - - - - - - - - - - false - true - - - - - - - - - - - $([System.String]::Copy('%(PaketReferencesFileLines.Identity)').Split(',').Length) - $([System.String]::Copy('%(PaketReferencesFileLines.Identity)').Split(',')[0]) - $([System.String]::Copy('%(PaketReferencesFileLines.Identity)').Split(',')[1]) - $([System.String]::Copy('%(PaketReferencesFileLines.Identity)').Split(',')[4]) - $([System.String]::Copy('%(PaketReferencesFileLines.Identity)').Split(',')[5]) - $([System.String]::Copy('%(PaketReferencesFileLines.Identity)').Split(',')[6]) - $([System.String]::Copy('%(PaketReferencesFileLines.Identity)').Split(',')[7]) - - - %(PaketReferencesFileLinesInfo.PackageVersion) - All - runtime - $(ExcludeAssets);contentFiles - $(ExcludeAssets);build;buildMultitargeting;buildTransitive - true - true - - - - - $(PaketIntermediateOutputPath)/$(MSBuildProjectFile).paket.clitools - - - - - - - - - $([System.String]::Copy('%(PaketCliToolFileLines.Identity)').Split(',')[0]) - $([System.String]::Copy('%(PaketCliToolFileLines.Identity)').Split(',')[1]) - - - %(PaketCliToolFileLinesInfo.PackageVersion) - - - - - - - - - - false - - - - - - <_NuspecFilesNewLocation Include="$(PaketIntermediateOutputPath)\$(Configuration)\*.nuspec"/> - - - - - - $(MSBuildProjectDirectory)/$(MSBuildProjectFile) - true - false - true - false - true - false - true - false - true - false - true - $(PaketIntermediateOutputPath)\$(Configuration) - $(PaketIntermediateOutputPath) - - - - <_NuspecFiles Include="$(AdjustedNuspecOutputPath)\*.$(PackageVersion.Split(`+`)[0]).nuspec"/> - - - - - - - - - - - - - - - - - - - - - - - diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index fb804438..7fb6270f 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -2,8 +2,37 @@ 1. Clone repo. 2. Install local tools with `dotnet tool restore` + +## Testing + +Testing against different .NET runtimes is a bit of a chore because we want to let the runtime load the current runtime's Microsoft.Build assemblies. Unfortunately, we can't have the `global.json` set to `net9.0` because the `Microsoft.Build` assemblies are compatible with the .NET 9 runtime, and will try to load them, even in a net8.0 TFM context. + +Our current algorithm is + +* run `dotnet --version` in the workspace directory +* use the output of that to determine which SDK to load from + +So if you set global.json to a 9.0.xxx SDK, you'll _always_ use the 9.x MSBuild libraries, which will require the 9.0 runtime to load. If you want to test while loading older MSBuilds, you'll need to somehow constraint the tests to 8.0.xxx SDKs, and the easiest way to do this is to make a global.json with a 8.0.xxx version and a `rollForward: latestPatch` constraint on it. + +### Against LTS (net8.0) +1. Run tests with `dotnet run --project .\build\ -- -t Test` + 1. This should chose the `Test:net8.0` target and run against that runtime + + +### Against STS (net9.0) +1. Change global.json to use net9.0 + ```json + "sdk": { + "version": "9.0.100", + "rollForward": "latestMinor", + "allowPrerelease": true + } + ``` +2. Set environment variable `BuildNet9` to `true` + 1. Bash: `export BuildNet9=true` + 2. PowerShell: `$env:BuildNet9 = "true"` 3. Run tests with `dotnet run --project .\build\ -- -t Test` -4. Create packages with `dotnet run --project .\build\ -- -t Pack` + 1. This should chose the `Test:net9.0` target and run against that runtime ## Release diff --git a/Directory.Packages.props b/Directory.Packages.props new file mode 100644 index 00000000..9c85d113 --- /dev/null +++ b/Directory.Packages.props @@ -0,0 +1,60 @@ + + + true + true + 17.2 + + 6.0.0 + + 9.0.100 + 43.9.100 + 10.2.1 + 6.1.3 + direct + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/build/Program.fs b/build/Program.fs index c8682f16..46803d61 100644 --- a/build/Program.fs +++ b/build/Program.fs @@ -34,9 +34,9 @@ let DoNothing = ignore let init args = initializeContext args - let buildNet7 = + let buildNet9 = match - System.Environment.GetEnvironmentVariable("BuildNet7") + System.Environment.GetEnvironmentVariable("BuildNet9") |> bool.TryParse with | true, v -> v @@ -76,16 +76,16 @@ let init args = Target.create "Test" DoNothing - Target.create "Test:net6.0" (fun _ -> testTFM "net6.0") - Target.create "Test:net7.0" (fun _ -> testTFM "net7.0") + Target.create "Test:net8.0" (fun _ -> testTFM "net8.0") + Target.create "Test:net9.0" (fun _ -> testTFM "net9.0") "Build" - =?> ("Test:net6.0", not buildNet7) + =?> ("Test:net8.0", not buildNet9) =?> ("Test", not ignoreTests) |> ignore "Build" - =?> ("Test:net7.0", buildNet7) + =?> ("Test:net9.0", buildNet9) =?> ("Test", not ignoreTests) |> ignore diff --git a/build/build.fsproj b/build/build.fsproj index 1bc438bc..00504b0e 100644 --- a/build/build.fsproj +++ b/build/build.fsproj @@ -1,12 +1,26 @@  Exe - net6.0 + net8.0 false false - - \ No newline at end of file + + + + + + + + + + + + + + + + diff --git a/build/paket.references b/build/paket.references deleted file mode 100644 index b162c57b..00000000 --- a/build/paket.references +++ /dev/null @@ -1,13 +0,0 @@ -group Build -Fake.Core.Target -Fake.Core.Process -Fake.DotNet.Cli -Fake.Core.ReleaseNotes -Fake.DotNet.AssemblyInfoFile -Fake.DotNet.Paket -Fake.Tools.Git -Fake.Core.Environment -Fake.Core.UserInput -Fake.IO.FileSystem -Fake.DotNet.MsBuild -Fake.Api.GitHub \ No newline at end of file diff --git a/global.json b/global.json index b1cfba0a..fe136d19 100644 --- a/global.json +++ b/global.json @@ -1,7 +1,7 @@ { - "sdk": { - "version": "6.0.400", - "rollForward": "latestMajor", - "allowPrerelease": true - } + "sdk": { + "version": "8.0.100", + "rollForward": "latestMinor", + "allowPrerelease": true + } } \ No newline at end of file diff --git a/install_mono_from_microsoft_deb_packages.sh b/install_mono_from_microsoft_deb_packages.sh deleted file mode 100755 index c9c029c1..00000000 --- a/install_mono_from_microsoft_deb_packages.sh +++ /dev/null @@ -1,15 +0,0 @@ -#!/usr/bin/env bash -set -euxo pipefail - -source /etc/os-release - -# required by apt-key -sudo apt install -y gnupg2 -# required by apt-update when pulling from mono-project.com -sudo apt install -y ca-certificates - -# taken from http://www.mono-project.com/download/stable/#download-lin -sudo apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv-keys 3FA7E0328081BFF6A14DA29AA6A19B38D3D831EF -sudo echo "deb https://download.mono-project.com/repo/ubuntu stable-$UBUNTU_CODENAME main" | sudo tee /etc/apt/sources.list.d/mono-official-stable.list -sudo apt update -sudo apt install -y fsharp diff --git a/nuget.config b/nuget.config new file mode 100644 index 00000000..6ce97590 --- /dev/null +++ b/nuget.config @@ -0,0 +1,8 @@ + + + + + + + + diff --git a/paket.dependencies b/paket.dependencies deleted file mode 100644 index d2577f97..00000000 --- a/paket.dependencies +++ /dev/null @@ -1,52 +0,0 @@ -source https://api.nuget.org/v3/index.json -# this is the FCS nightly feed, re-enable at your own risk! -# source https://pkgs.dev.azure.com/dnceng/public/_packaging/dotnet-tools/nuget/v3/index.json - -storage: none -framework: net6.0, net7.0 - -nuget FSharp.Core -nuget FSharp.Compiler.Service >= 7.0.400 -nuget Argu - -# copy_local: true because this is a build-time dependency only -nuget Dotnet.ReproducibleBuilds copy_local: true -nuget GitHubActionsTestLogger -nuget Ionide.KeepAChangelog.Tasks copy_local:true - -nuget Expecto -nuget Expecto.Diff -nuget Expecto.TestResults -nuget MedallionShell ~> 1.5.0 - -# copy_local: false excludes runtime assets (desired for msbuild) -nuget Microsoft.Build copy_local: false -nuget Microsoft.Build.Framework copy_local: false -nuget Microsoft.Build.Utilities.Core copy_local: false -nuget Microsoft.Build.Tasks.Core copy_local: false -nuget Microsoft.NET.Test.Sdk -nuget Newtonsoft.Json -nuget Fsharp.Control.Reactive -nuget SemanticVersioning -nuget YoloDev.Expecto.TestSdk - -// [ FAKE GROUP ] -group Build - source https://api.nuget.org/v3/index.json - - framework: net6.0 - storage: none - - nuget Fake.Core.Target - nuget Fake.Core.Process - nuget Fake.DotNet.Cli - nuget Fake.Core.ReleaseNotes - nuget Fake.DotNet.AssemblyInfoFile - nuget Fake.DotNet.Paket - nuget Fake.Tools.Git - nuget Fake.Core.Environment - nuget Fake.Core.UserInput - nuget Fake.IO.FileSystem - nuget Fake.DotNet.MsBuild - nuget Fake.Api.GitHub - nuget MSBuild.StructuredLogger diff --git a/paket.lock b/paket.lock deleted file mode 100644 index 4f6dece1..00000000 --- a/paket.lock +++ /dev/null @@ -1,461 +0,0 @@ -STORAGE: NONE -RESTRICTION: || (== net6.0) (== net7.0) -NUGET - remote: https://api.nuget.org/v3/index.json - Argu (6.1.1) - FSharp.Core (>= 4.3.2) - System.Configuration.ConfigurationManager (>= 4.4) - DiffPlex (1.7.1) - DotNet.ReproducibleBuilds (1.1.1) - copy_local: true - Microsoft.SourceLink.AzureRepos.Git (>= 1.1.1) - Microsoft.SourceLink.Bitbucket.Git (>= 1.1.1) - Microsoft.SourceLink.GitHub (>= 1.1.1) - Microsoft.SourceLink.GitLab (>= 1.1.1) - Expecto (9.0.4) - FSharp.Core (>= 4.6) - Mono.Cecil (>= 0.11.3) - Expecto.Diff (9.0.4) - DiffPlex (>= 1.6.3) - Expecto (>= 9.0.4) - FSharp.Core (>= 4.6) - Expecto.TestResults (8.13.2) - Expecto (>= 8.13.2) - FSharp.Core (>= 4.6) - FSharp.Compiler.Service (43.8.400) - FSharp.Core (8.0.400) - System.Buffers (>= 4.5.1) - System.Collections.Immutable (>= 8.0) - System.Diagnostics.DiagnosticSource (>= 8.0) - System.Memory (>= 4.5.5) - System.Reflection.Emit (>= 4.7) - System.Reflection.Metadata (>= 8.0) - System.Runtime.CompilerServices.Unsafe (>= 6.0) - FSharp.Control.Reactive (5.0.5) - FSharp.Core (>= 4.7.2) - System.Reactive (>= 5.0 < 6.0) - FSharp.Core (8.0.400) - GitHubActionsTestLogger (2.0.1) - Microsoft.TestPlatform.ObjectModel (>= 17.2) - Ionide.KeepAChangelog.Tasks (0.1.8) - copy_local: true - MedallionShell (1.5.1) - NETStandard.Library (>= 1.6) - System.Diagnostics.Process (>= 4.1) - Microsoft.Build (17.2) - copy_local: false - Microsoft.Build.Framework (>= 17.2) - Microsoft.NET.StringTools (>= 1.0) - Microsoft.Win32.Registry (>= 4.3) - System.Collections.Immutable (>= 5.0) - System.Configuration.ConfigurationManager (>= 4.7) - System.Reflection.Metadata (>= 1.6) - System.Security.Principal.Windows (>= 4.7) - System.Text.Encoding.CodePages (>= 4.0.1) - System.Text.Json (>= 6.0) - System.Threading.Tasks.Dataflow (>= 6.0) - Microsoft.Build.Framework (17.2) - copy_local: false - Microsoft.Win32.Registry (>= 4.3) - System.Security.Permissions (>= 4.7) - Microsoft.Build.Tasks.Core (17.2) - copy_local: false - Microsoft.Build.Framework (>= 17.2) - Microsoft.Build.Utilities.Core (>= 17.2) - Microsoft.NET.StringTools (>= 1.0) - Microsoft.Win32.Registry (>= 4.3) - System.CodeDom (>= 4.4) - System.Collections.Immutable (>= 5.0) - System.Reflection.Metadata (>= 1.6) - System.Resources.Extensions (>= 4.6) - System.Security.Cryptography.Pkcs (>= 4.7) - System.Security.Cryptography.Xml (>= 4.7) - System.Security.Permissions (>= 4.7) - System.Threading.Tasks.Dataflow (>= 6.0) - Microsoft.Build.Tasks.Git (1.1.1) - copy_local: true - Microsoft.Build.Utilities.Core (17.2) - copy_local: false - Microsoft.Build.Framework (>= 17.2) - Microsoft.NET.StringTools (>= 1.0) - Microsoft.Win32.Registry (>= 4.3) - System.Collections.Immutable (>= 5.0) - System.Configuration.ConfigurationManager (>= 4.7) - Microsoft.CodeCoverage (17.5) - Microsoft.NET.StringTools (1.0) - copy_local: false - System.Memory (>= 4.5.4) - System.Runtime.CompilerServices.Unsafe (>= 5.0) - Microsoft.NET.Test.Sdk (17.5) - Microsoft.CodeCoverage (>= 17.5) - Microsoft.TestPlatform.TestHost (>= 17.5) - Microsoft.NETCore.Platforms (6.0.2) - Microsoft.NETCore.Targets (5.0) - Microsoft.SourceLink.AzureRepos.Git (1.1.1) - copy_local: true - Microsoft.Build.Tasks.Git (>= 1.1.1) - Microsoft.SourceLink.Common (>= 1.1.1) - Microsoft.SourceLink.Bitbucket.Git (1.1.1) - copy_local: true - Microsoft.Build.Tasks.Git (>= 1.1.1) - Microsoft.SourceLink.Common (>= 1.1.1) - Microsoft.SourceLink.Common (1.1.1) - copy_local: true - Microsoft.SourceLink.GitHub (1.1.1) - copy_local: true - Microsoft.Build.Tasks.Git (>= 1.1.1) - Microsoft.SourceLink.Common (>= 1.1.1) - Microsoft.SourceLink.GitLab (1.1.1) - copy_local: true - Microsoft.Build.Tasks.Git (>= 1.1.1) - Microsoft.SourceLink.Common (>= 1.1.1) - Microsoft.TestPlatform.ObjectModel (17.5) - NuGet.Frameworks (>= 5.11) - System.Reflection.Metadata (>= 1.6) - Microsoft.TestPlatform.TestHost (17.5) - Microsoft.TestPlatform.ObjectModel (>= 17.5) - Newtonsoft.Json (>= 13.0.1) - Microsoft.Win32.Primitives (4.3) - Microsoft.NETCore.Platforms (>= 1.1) - Microsoft.NETCore.Targets (>= 1.1) - System.Runtime (>= 4.3) - Microsoft.Win32.Registry (5.0) - copy_local: false - System.Security.AccessControl (>= 5.0) - System.Security.Principal.Windows (>= 5.0) - Microsoft.Win32.SystemEvents (6.0) - copy_local: false - Mono.Cecil (0.11.4) - NETStandard.Library (2.0.3) - Microsoft.NETCore.Platforms (>= 1.1) - Newtonsoft.Json (13.0.1) - NuGet.Frameworks (6.4) - runtime.native.System (4.3.1) - Microsoft.NETCore.Platforms (>= 1.1.1) - Microsoft.NETCore.Targets (>= 1.1.3) - SemanticVersioning (2.0.2) - System.Buffers (4.5.1) - System.CodeDom (6.0) - copy_local: false - System.Collections (4.3) - Microsoft.NETCore.Platforms (>= 1.1) - Microsoft.NETCore.Targets (>= 1.1) - System.Runtime (>= 4.3) - System.Collections.Immutable (8.0) - System.Runtime.CompilerServices.Unsafe (>= 6.0) - restriction: || (== net6.0) (&& (== net7.0) (>= net462)) (&& (== net7.0) (< net6.0)) - System.Configuration.ConfigurationManager (6.0) - copy_local: false - System.Security.Cryptography.ProtectedData (>= 6.0) - System.Security.Permissions (>= 6.0) - System.Diagnostics.Debug (4.3) - Microsoft.NETCore.Platforms (>= 1.1) - Microsoft.NETCore.Targets (>= 1.1) - System.Runtime (>= 4.3) - System.Diagnostics.DiagnosticSource (8.0.1) - System.Runtime.CompilerServices.Unsafe (>= 6.0) - restriction: || (== net6.0) (&& (== net7.0) (>= net462)) (&& (== net7.0) (< net6.0)) - System.Diagnostics.Process (4.3) - Microsoft.NETCore.Platforms (>= 1.1) - Microsoft.Win32.Primitives (>= 4.3) - Microsoft.Win32.Registry (>= 4.3) - runtime.native.System (>= 4.3) - System.Collections (>= 4.3) - System.Diagnostics.Debug (>= 4.3) - System.Globalization (>= 4.3) - System.IO (>= 4.3) - System.IO.FileSystem (>= 4.3) - System.IO.FileSystem.Primitives (>= 4.3) - System.Resources.ResourceManager (>= 4.3) - System.Runtime (>= 4.3) - System.Runtime.Extensions (>= 4.3) - System.Runtime.Handles (>= 4.3) - System.Runtime.InteropServices (>= 4.3) - System.Text.Encoding (>= 4.3) - System.Text.Encoding.Extensions (>= 4.3) - System.Threading (>= 4.3) - System.Threading.Tasks (>= 4.3) - System.Threading.Thread (>= 4.3) - System.Threading.ThreadPool (>= 4.3) - System.Drawing.Common (6.0) - copy_local: false - Microsoft.Win32.SystemEvents (>= 6.0) - System.Formats.Asn1 (6.0) - copy_local: false - System.Globalization (4.3) - Microsoft.NETCore.Platforms (>= 1.1) - Microsoft.NETCore.Targets (>= 1.1) - System.Runtime (>= 4.3) - System.IO (4.3) - Microsoft.NETCore.Platforms (>= 1.1) - Microsoft.NETCore.Targets (>= 1.1) - System.Runtime (>= 4.3) - System.Text.Encoding (>= 4.3) - System.Threading.Tasks (>= 4.3) - System.IO.FileSystem (4.3) - Microsoft.NETCore.Platforms (>= 1.1) - Microsoft.NETCore.Targets (>= 1.1) - System.IO (>= 4.3) - System.IO.FileSystem.Primitives (>= 4.3) - System.Runtime (>= 4.3) - System.Runtime.Handles (>= 4.3) - System.Text.Encoding (>= 4.3) - System.Threading.Tasks (>= 4.3) - System.IO.FileSystem.Primitives (4.3) - System.Runtime (>= 4.3) - System.Memory (4.5.5) - System.Reactive (5.0) - System.Reflection (4.3) - Microsoft.NETCore.Platforms (>= 1.1) - Microsoft.NETCore.Targets (>= 1.1) - System.IO (>= 4.3) - System.Reflection.Primitives (>= 4.3) - System.Runtime (>= 4.3) - System.Reflection.Emit (4.7) - System.Reflection.Metadata (8.0) - System.Collections.Immutable (>= 8.0) - System.Reflection.Primitives (4.3) - Microsoft.NETCore.Platforms (>= 1.1) - Microsoft.NETCore.Targets (>= 1.1) - System.Runtime (>= 4.3) - System.Resources.Extensions (6.0) - copy_local: false - System.Resources.ResourceManager (4.3) - Microsoft.NETCore.Platforms (>= 1.1) - Microsoft.NETCore.Targets (>= 1.1) - System.Globalization (>= 4.3) - System.Reflection (>= 4.3) - System.Runtime (>= 4.3) - System.Runtime (4.3.1) - Microsoft.NETCore.Platforms (>= 1.1.1) - Microsoft.NETCore.Targets (>= 1.1.3) - System.Runtime.CompilerServices.Unsafe (6.0) - System.Runtime.Extensions (4.3.1) - Microsoft.NETCore.Platforms (>= 1.1.1) - Microsoft.NETCore.Targets (>= 1.1.3) - System.Runtime (>= 4.3.1) - System.Runtime.Handles (4.3) - Microsoft.NETCore.Platforms (>= 1.1) - Microsoft.NETCore.Targets (>= 1.1) - System.Runtime (>= 4.3) - System.Runtime.InteropServices (4.3) - Microsoft.NETCore.Platforms (>= 1.1) - Microsoft.NETCore.Targets (>= 1.1) - System.Reflection (>= 4.3) - System.Reflection.Primitives (>= 4.3) - System.Runtime (>= 4.3) - System.Runtime.Handles (>= 4.3) - System.Security.AccessControl (6.0) - copy_local: false - System.Security.Cryptography.Pkcs (6.0) - copy_local: false - System.Formats.Asn1 (>= 6.0) - System.Security.Cryptography.ProtectedData (6.0) - copy_local: false - System.Security.Cryptography.Xml (6.0) - copy_local: false - System.Security.AccessControl (>= 6.0) - System.Security.Cryptography.Pkcs (>= 6.0) - System.Security.Permissions (6.0) - copy_local: false - System.Security.AccessControl (>= 6.0) - System.Windows.Extensions (>= 6.0) - System.Security.Principal.Windows (5.0) - copy_local: false - System.Text.Encoding (4.3) - Microsoft.NETCore.Platforms (>= 1.1) - Microsoft.NETCore.Targets (>= 1.1) - System.Runtime (>= 4.3) - System.Text.Encoding.CodePages (6.0) - copy_local: false - System.Runtime.CompilerServices.Unsafe (>= 6.0) - System.Text.Encoding.Extensions (4.3) - Microsoft.NETCore.Platforms (>= 1.1) - Microsoft.NETCore.Targets (>= 1.1) - System.Runtime (>= 4.3) - System.Text.Encoding (>= 4.3) - System.Text.Encodings.Web (6.0) - copy_local: false - System.Runtime.CompilerServices.Unsafe (>= 6.0) - System.Text.Json (6.0.5) - copy_local: false - System.Runtime.CompilerServices.Unsafe (>= 6.0) - System.Text.Encodings.Web (>= 6.0) - System.Threading (4.3) - System.Runtime (>= 4.3) - System.Threading.Tasks (>= 4.3) - System.Threading.Tasks (4.3) - Microsoft.NETCore.Platforms (>= 1.1) - Microsoft.NETCore.Targets (>= 1.1) - System.Runtime (>= 4.3) - System.Threading.Tasks.Dataflow (6.0) - copy_local: false - System.Threading.Thread (4.3) - System.Runtime (>= 4.3) - System.Threading.ThreadPool (4.3) - System.Runtime (>= 4.3) - System.Runtime.Handles (>= 4.3) - System.Windows.Extensions (6.0) - copy_local: false - System.Drawing.Common (>= 6.0) - YoloDev.Expecto.TestSdk (0.13.3) - Expecto (>= 9.0 < 10.0) - FSharp.Core (>= 4.6.2) - System.Collections.Immutable (>= 6.0) - -GROUP Build -STORAGE: NONE -RESTRICTION: == net6.0 -NUGET - remote: https://api.nuget.org/v3/index.json - BlackFox.VsWhere (1.1) - FSharp.Core (>= 4.2.3) - Microsoft.Win32.Registry (>= 4.7) - Fake.Api.GitHub (5.22) - FSharp.Core (>= 6.0) - Octokit (>= 0.50) - Fake.Core.CommandLineParsing (5.22) - FParsec (>= 1.1.1) - FSharp.Core (>= 6.0) - Fake.Core.Context (5.22) - FSharp.Core (>= 6.0) - Fake.Core.Environment (5.22) - FSharp.Core (>= 6.0) - Fake.Core.FakeVar (5.22) - Fake.Core.Context (>= 5.22) - FSharp.Core (>= 6.0) - Fake.Core.Process (5.22) - Fake.Core.Environment (>= 5.22) - Fake.Core.FakeVar (>= 5.22) - Fake.Core.String (>= 5.22) - Fake.Core.Trace (>= 5.22) - Fake.IO.FileSystem (>= 5.22) - FSharp.Core (>= 6.0) - System.Collections.Immutable (>= 5.0) - Fake.Core.ReleaseNotes (5.22) - Fake.Core.SemVer (>= 5.22) - Fake.Core.String (>= 5.22) - FSharp.Core (>= 6.0) - Fake.Core.SemVer (5.22) - FSharp.Core (>= 6.0) - Fake.Core.String (5.22) - FSharp.Core (>= 6.0) - Fake.Core.Target (5.22) - Fake.Core.CommandLineParsing (>= 5.22) - Fake.Core.Context (>= 5.22) - Fake.Core.Environment (>= 5.22) - Fake.Core.FakeVar (>= 5.22) - Fake.Core.Process (>= 5.22) - Fake.Core.String (>= 5.22) - Fake.Core.Trace (>= 5.22) - FSharp.Control.Reactive (>= 5.0.2) - FSharp.Core (>= 6.0) - Fake.Core.Tasks (5.22) - Fake.Core.Trace (>= 5.22) - FSharp.Core (>= 6.0) - Fake.Core.Trace (5.22) - Fake.Core.Environment (>= 5.22) - Fake.Core.FakeVar (>= 5.22) - FSharp.Core (>= 6.0) - Fake.Core.UserInput (5.22) - FSharp.Core (>= 6.0) - Fake.Core.Xml (5.22) - Fake.Core.String (>= 5.22) - FSharp.Core (>= 6.0) - Fake.DotNet.AssemblyInfoFile (5.22) - Fake.Core.Environment (>= 5.22) - Fake.Core.String (>= 5.22) - Fake.Core.Trace (>= 5.22) - Fake.IO.FileSystem (>= 5.22) - FSharp.Core (>= 6.0) - Fake.DotNet.Cli (5.22) - Fake.Core.Environment (>= 5.22) - Fake.Core.Process (>= 5.22) - Fake.Core.String (>= 5.22) - Fake.Core.Trace (>= 5.22) - Fake.DotNet.MSBuild (>= 5.22) - Fake.DotNet.NuGet (>= 5.22) - Fake.IO.FileSystem (>= 5.22) - FSharp.Core (>= 6.0) - Mono.Posix.NETStandard (>= 1.0) - Newtonsoft.Json (>= 13.0.1) - Fake.DotNet.MSBuild (5.22) - BlackFox.VsWhere (>= 1.1) - Fake.Core.Environment (>= 5.22) - Fake.Core.Process (>= 5.22) - Fake.Core.String (>= 5.22) - Fake.Core.Trace (>= 5.22) - Fake.IO.FileSystem (>= 5.22) - FSharp.Core (>= 6.0) - MSBuild.StructuredLogger (>= 2.1.545) - Fake.DotNet.NuGet (5.22) - Fake.Core.Environment (>= 5.22) - Fake.Core.Process (>= 5.22) - Fake.Core.SemVer (>= 5.22) - Fake.Core.String (>= 5.22) - Fake.Core.Tasks (>= 5.22) - Fake.Core.Trace (>= 5.22) - Fake.Core.Xml (>= 5.22) - Fake.IO.FileSystem (>= 5.22) - Fake.Net.Http (>= 5.22) - FSharp.Core (>= 6.0) - Newtonsoft.Json (>= 13.0.1) - NuGet.Protocol (>= 5.11) - Fake.DotNet.Paket (5.22) - Fake.Core.Process (>= 5.22) - Fake.Core.String (>= 5.22) - Fake.Core.Trace (>= 5.22) - Fake.DotNet.Cli (>= 5.22) - Fake.IO.FileSystem (>= 5.22) - FSharp.Core (>= 6.0) - Fake.IO.FileSystem (5.22) - Fake.Core.String (>= 5.22) - FSharp.Core (>= 6.0) - Fake.Net.Http (5.22) - Fake.Core.Trace (>= 5.22) - FSharp.Core (>= 6.0) - Fake.Tools.Git (5.22) - Fake.Core.Environment (>= 5.22) - Fake.Core.Process (>= 5.22) - Fake.Core.SemVer (>= 5.22) - Fake.Core.String (>= 5.22) - Fake.Core.Trace (>= 5.22) - Fake.IO.FileSystem (>= 5.22) - FSharp.Core (>= 6.0) - FParsec (1.1.1) - FSharp.Core (>= 4.3.4) - FSharp.Control.Reactive (5.0.2) - FSharp.Core (>= 4.7.2) - System.Reactive (>= 5.0) - FSharp.Core (6.0.3) - Microsoft.Build.Framework (17.1) - Microsoft.Win32.Registry (>= 4.3) - System.Security.Permissions (>= 4.7) - Microsoft.Build.Utilities.Core (17.1) - Microsoft.Build.Framework (>= 17.1) - Microsoft.NET.StringTools (>= 1.0) - Microsoft.Win32.Registry (>= 4.3) - System.Collections.Immutable (>= 5.0) - System.Configuration.ConfigurationManager (>= 4.7) - System.Security.Permissions (>= 4.7) - System.Text.Encoding.CodePages (>= 4.0.1) - Microsoft.NET.StringTools (1.0) - System.Memory (>= 4.5.4) - System.Runtime.CompilerServices.Unsafe (>= 5.0) - Microsoft.Win32.Registry (5.0) - System.Security.AccessControl (>= 5.0) - System.Security.Principal.Windows (>= 5.0) - Microsoft.Win32.SystemEvents (6.0) - Mono.Posix.NETStandard (1.0) - MSBuild.StructuredLogger (2.1.768) - Microsoft.Build.Framework (>= 16.10) - Microsoft.Build.Utilities.Core (>= 16.10) - Newtonsoft.Json (13.0.1) - NuGet.Common (6.1) - NuGet.Frameworks (>= 6.1) - NuGet.Configuration (6.1) - NuGet.Common (>= 6.1) - System.Security.Cryptography.ProtectedData (>= 4.4) - NuGet.Frameworks (6.1) - NuGet.Packaging (6.1) - Newtonsoft.Json (>= 13.0.1) - NuGet.Configuration (>= 6.1) - NuGet.Versioning (>= 6.1) - System.Security.Cryptography.Cng (>= 5.0) - System.Security.Cryptography.Pkcs (>= 5.0) - NuGet.Protocol (6.1) - NuGet.Packaging (>= 6.1) - NuGet.Versioning (6.1) - Octokit (0.50) - System.Collections.Immutable (6.0) - System.Runtime.CompilerServices.Unsafe (>= 6.0) - System.Configuration.ConfigurationManager (6.0) - System.Security.Cryptography.ProtectedData (>= 6.0) - System.Security.Permissions (>= 6.0) - System.Drawing.Common (6.0) - Microsoft.Win32.SystemEvents (>= 6.0) - System.Formats.Asn1 (6.0) - System.Memory (4.5.4) - System.Reactive (5.0) - System.Runtime.CompilerServices.Unsafe (6.0) - System.Security.AccessControl (6.0) - System.Security.Cryptography.Cng (5.0) - System.Formats.Asn1 (>= 5.0) - System.Security.Cryptography.Pkcs (6.0) - System.Formats.Asn1 (>= 6.0) - System.Security.Cryptography.ProtectedData (6.0) - System.Security.Permissions (6.0) - System.Security.AccessControl (>= 6.0) - System.Windows.Extensions (>= 6.0) - System.Security.Principal.Windows (5.0) - System.Text.Encoding.CodePages (6.0) - System.Runtime.CompilerServices.Unsafe (>= 6.0) - System.Windows.Extensions (6.0) - System.Drawing.Common (>= 6.0) diff --git a/src/Directory.Build.props b/src/Directory.Build.props index bf9b43a5..41c4972d 100644 --- a/src/Directory.Build.props +++ b/src/Directory.Build.props @@ -1,4 +1,4 @@ - + true true @@ -13,5 +13,15 @@ MIT MSBuild evaluation, fsproj file loading, and project system for F# tooling true + README.md - \ No newline at end of file + + + + + + + + + + diff --git a/src/Ionide.ProjInfo.FCS/Ionide.ProjInfo.FCS.fsproj b/src/Ionide.ProjInfo.FCS/Ionide.ProjInfo.FCS.fsproj index 20d209d6..6dd31fd7 100644 --- a/src/Ionide.ProjInfo.FCS/Ionide.ProjInfo.FCS.fsproj +++ b/src/Ionide.ProjInfo.FCS/Ionide.ProjInfo.FCS.fsproj @@ -1,8 +1,8 @@  - net6.0 - $(TargetFrameworks);net7.0 + net8.0 + $(TargetFrameworks);net9.0 @@ -12,5 +12,9 @@ - - \ No newline at end of file + + + + + + diff --git a/src/Ionide.ProjInfo.FCS/README.md b/src/Ionide.ProjInfo.FCS/README.md new file mode 100644 index 00000000..abc97e00 --- /dev/null +++ b/src/Ionide.ProjInfo.FCS/README.md @@ -0,0 +1,11 @@ +# Ionide.ProjInfo.FCS + +This is a helper library that provides APIs to map Ionide.ProjInfo.Types.ProjectOptions instances to FSharp.Compiler.CodeAnalysis.FSharpProjectOptions instances. + +Assuming you've already done the steps in Ionide.ProjInfo to get the ProjectOptions instances, you can use the following code to get the FSharpProjectOptions for those instances efficiently + +```fsharp +open Ionide.ProjInfo + +let fcsProjectOptions = FCS.mapManyOptions projectOptions +``` diff --git a/src/Ionide.ProjInfo.FCS/paket.references b/src/Ionide.ProjInfo.FCS/paket.references deleted file mode 100644 index aa5a094f..00000000 --- a/src/Ionide.ProjInfo.FCS/paket.references +++ /dev/null @@ -1,4 +0,0 @@ -FSharp.Core -FSharp.Compiler.Service -Dotnet.ReproducibleBuilds -Ionide.KeepAChangelog.Tasks \ No newline at end of file diff --git a/src/Ionide.ProjInfo.ProjectSystem/FSIRefs.fs b/src/Ionide.ProjInfo.ProjectSystem/FSIRefs.fs index 31ee83b2..42803551 100644 --- a/src/Ionide.ProjInfo.ProjectSystem/FSIRefs.fs +++ b/src/Ionide.ProjInfo.ProjectSystem/FSIRefs.fs @@ -144,10 +144,21 @@ let tfmForRuntime = let netcore5 = Version(5, 0, 100, "") let netcore6 = Version(6, 0, 100, "") let netcore7 = Version(7, 0, 100, "") + let netcore8 = Version(8, 0, 100, "") + let netcore9 = Version(9, 0, 100, "") fun (sdkVersion: Version) -> - if + netcore9 + <= sdkVersion + then + "net9.0" + else if + netcore8 + <= sdkVersion + then + "net7.0" + else if netcore7 <= sdkVersion then diff --git a/src/Ionide.ProjInfo.ProjectSystem/Ionide.ProjInfo.ProjectSystem.fsproj b/src/Ionide.ProjInfo.ProjectSystem/Ionide.ProjInfo.ProjectSystem.fsproj index 10fdc7bc..76a4996a 100644 --- a/src/Ionide.ProjInfo.ProjectSystem/Ionide.ProjInfo.ProjectSystem.fsproj +++ b/src/Ionide.ProjInfo.ProjectSystem/Ionide.ProjInfo.ProjectSystem.fsproj @@ -1,8 +1,8 @@  - net6.0 - $(TargetFrameworks);net7.0 + net8.0 + $(TargetFrameworks);net9.0 @@ -17,9 +17,7 @@ - - @@ -28,5 +26,9 @@ <_Parameter1>Ionide.ProjInfo.Tests - - \ No newline at end of file + + + + + + diff --git a/src/Ionide.ProjInfo.ProjectSystem/README.md b/src/Ionide.ProjInfo.ProjectSystem/README.md new file mode 100644 index 00000000..4fa5b720 --- /dev/null +++ b/src/Ionide.ProjInfo.ProjectSystem/README.md @@ -0,0 +1,12 @@ +# Ionide.ProjInfo.ProjectSystem + +This library provides helpers for operating an entire project system based on the data structures returned by the Ionide.ProjInfo library. + +The main entrypoint is the `ProjectController` API in the Ionide.ProjInfo.ProjectSystem workspace: + +```fsharp +type ProjectController(toolsPath: ToolsPath, workspaceLoaderFactory: ToolsPath -> IWorkspaceLoader) = + ... +``` + +From there you can load specific projects, get their dependencies, and more. diff --git a/src/Ionide.ProjInfo.ProjectSystem/paket.references b/src/Ionide.ProjInfo.ProjectSystem/paket.references deleted file mode 100644 index 03c71e30..00000000 --- a/src/Ionide.ProjInfo.ProjectSystem/paket.references +++ /dev/null @@ -1,6 +0,0 @@ -FSharp.Core -FSharp.Compiler.Service -Newtonsoft.Json -Dotnet.ReproducibleBuilds -Ionide.KeepAChangelog.Tasks -Fsharp.Control.Reactive \ No newline at end of file diff --git a/src/Ionide.ProjInfo.Sln/Ionide.ProjInfo.Sln.csproj b/src/Ionide.ProjInfo.Sln/Ionide.ProjInfo.Sln.csproj index 15966cd6..44c668aa 100644 --- a/src/Ionide.ProjInfo.Sln/Ionide.ProjInfo.Sln.csproj +++ b/src/Ionide.ProjInfo.Sln/Ionide.ProjInfo.Sln.csproj @@ -1,11 +1,10 @@ - net6.0 + net8.0 + $(TargetFrameworks);net9.0 Parse sln files FULL_SLN_PARSER;STANDALONEBUILD;$(DefineConstants) true - - - \ No newline at end of file + diff --git a/src/Ionide.ProjInfo.Sln/paket.references b/src/Ionide.ProjInfo.Sln/paket.references deleted file mode 100644 index 79f4a7a1..00000000 --- a/src/Ionide.ProjInfo.Sln/paket.references +++ /dev/null @@ -1,2 +0,0 @@ -Dotnet.ReproducibleBuilds -Ionide.KeepAChangelog.Tasks \ No newline at end of file diff --git a/src/Ionide.ProjInfo.Tool/Ionide.ProjInfo.Tool.fsproj b/src/Ionide.ProjInfo.Tool/Ionide.ProjInfo.Tool.fsproj index 438210e1..ffa4aa04 100644 --- a/src/Ionide.ProjInfo.Tool/Ionide.ProjInfo.Tool.fsproj +++ b/src/Ionide.ProjInfo.Tool/Ionide.ProjInfo.Tool.fsproj @@ -1,21 +1,26 @@  - - Exe - net6.0 - $(TargetFrameworks);net7.0 - true - proj-info - LatestMajor - + + Exe + net8.0 + $(TargetFrameworks);net9.0 + true + proj-info + LatestMajor + - - - + + + - - - + + + - - \ No newline at end of file + + + + + + diff --git a/src/Ionide.ProjInfo.Tool/README.md b/src/Ionide.ProjInfo.Tool/README.md new file mode 100644 index 00000000..d453b1ac --- /dev/null +++ b/src/Ionide.ProjInfo.Tool/README.md @@ -0,0 +1,21 @@ +# Ionide.ProjInfo.Tool + +A .NET SDK tool that allows for quick parsing of projects and solutions. + +Broadly, the tool has three kinds of arguments: + + +### Loading args + +``` +--project the path to a project file to load +--solution the path to a solution file to load +``` + +### How to load a project + +By default you will use the standard MSBuild loader, but specifying `--graph` will use the MSBuild graph loader. + +### What to parse the results into + +By default you will get a structured text version of the Ionide project options for the project(s). If you want, you can get the FCS ProjectOptions versions by adding the `--fcs` flag. Finally, you can get project JSON with `--serialize` as well. diff --git a/src/Ionide.ProjInfo.Tool/paket.references b/src/Ionide.ProjInfo.Tool/paket.references deleted file mode 100644 index 98c8f2bc..00000000 --- a/src/Ionide.ProjInfo.Tool/paket.references +++ /dev/null @@ -1,6 +0,0 @@ -FSharp.Core -Argu -Microsoft.Build copy_local: true -Microsoft.Build.Framework copy_local: true -Dotnet.ReproducibleBuilds -Ionide.KeepAChangelog.Tasks \ No newline at end of file diff --git a/src/Ionide.ProjInfo/Ionide.ProjInfo.fsproj b/src/Ionide.ProjInfo/Ionide.ProjInfo.fsproj index 9fddfaa7..ab313443 100644 --- a/src/Ionide.ProjInfo/Ionide.ProjInfo.fsproj +++ b/src/Ionide.ProjInfo/Ionide.ProjInfo.fsproj @@ -1,8 +1,8 @@  - net6.0 - $(TargetFrameworks);net7.0 + net8.0 + $(TargetFrameworks);net9.0 @@ -15,5 +15,11 @@ - - \ No newline at end of file + + + + + + + + diff --git a/src/Ionide.ProjInfo/Library.fs b/src/Ionide.ProjInfo/Library.fs index 9c2efb33..92a1a75c 100644 --- a/src/Ionide.ProjInfo/Library.fs +++ b/src/Ionide.ProjInfo/Library.fs @@ -102,7 +102,7 @@ module SdkDiscovery = Path: DirectoryInfo } - /// Given the DOTNET_sROOT, that is the directory where the `dotnet` binary is present and the sdk/runtimes/etc are, + /// Given the DOTNET_ROOT, that is the directory where the `dotnet` binary is present and the sdk/runtimes/etc are, /// enumerates the available SDKs in descending version order let sdks (dotnetBinaryPath: FileInfo) : DotnetSdkInfo[] = execDotnet true dotnetBinaryPath.Directory dotnetBinaryPath [ "--list-sdks" ] @@ -1204,11 +1204,10 @@ type WorkspaceLoaderViaProjectGraph private (toolsPath, ?globalProperties: (stri let gbr = GraphBuildRequestData( - projects, - ProjectLoader.designTimeBuildTargets false, - null, - BuildRequestDataFlags.ReplaceExistingProjectInstance - ||| BuildRequestDataFlags.ClearCachesAfterBuild + projectGraph = projects, + targetsToBuild=ProjectLoader.designTimeBuildTargets false, + hostServices=null, + flags= (BuildRequestDataFlags.ReplaceExistingProjectInstance ||| BuildRequestDataFlags.ClearCachesAfterBuild) ) let bm = BuildManager.DefaultBuildManager diff --git a/src/Ionide.ProjInfo/README.md b/src/Ionide.ProjInfo/README.md new file mode 100644 index 00000000..0c9c7ab8 --- /dev/null +++ b/src/Ionide.ProjInfo/README.md @@ -0,0 +1,38 @@ +# Ionide.Proj-Info + +This project loads some MSBuild specific assemblies at runtime so that you can use an existing MSBuild installation instead of (incorrectly) bundling it yourself. Somewhat similar to how [MSBuildLocator](https://github.com/microsoft/MSBuildLocator) loads the correct assemblies. +Because of this you need to add a direct dependency on `Microsoft.Build.Framework` and `NuGet.Frameworks` but keep excluded them at runtime. + +``` + + + +``` + +Next, you first need to initialize the MsBuild integration. + +```fsharp +open Ionide.ProjInfo + +let projectDirectory: DirectoryInfo = yourProjectOrSolutionFolder +let toolsPath = Init.init projectDirectory None +``` + +With the `toolsPath` you can create a `loader` + +```fsharp +let defaultLoader: IWorkspaceLoader = WorkspaceLoader.Create(toolsPath, []) +// or +let graphLoader: IWorkspaceLoader = WorkspaceLoaderViaProjectGraph.Create(toolsPath, []) +``` + +Using the `IWorkspaceLoader` you can load projects or solutions. +Events are being emitted while projects/solutions are loaded. +You typically want to subscribe to this before you load anything. + +```fsharp +let subscription: System.IDisposable = defaultLoader.Notifications.Subscribe(fun msg -> printfn "%A" msg) +let projectOptions = loader.LoadProjects([ yourFsProjPath ]) |> Seq.toArray +``` + +From here consider using Ionide.ProjInfo.FCS to map the `projectOptions` to F# Compiler `ProjectOptions`, or use the `projectOptions` directly to get information about the project. diff --git a/src/Ionide.ProjInfo/paket.references b/src/Ionide.ProjInfo/paket.references deleted file mode 100644 index 219b7433..00000000 --- a/src/Ionide.ProjInfo/paket.references +++ /dev/null @@ -1,6 +0,0 @@ -Microsoft.Build copy_local: false -Microsoft.Build.Framework copy_local: false -FSharp.Core -Dotnet.ReproducibleBuilds -Ionide.KeepAChangelog.Tasks -SemanticVersioning \ No newline at end of file diff --git a/test/Ionide.ProjInfo.Tests/Ionide.ProjInfo.Tests.fsproj b/test/Ionide.ProjInfo.Tests/Ionide.ProjInfo.Tests.fsproj index 5a0d1e30..bc70fe39 100644 --- a/test/Ionide.ProjInfo.Tests/Ionide.ProjInfo.Tests.fsproj +++ b/test/Ionide.ProjInfo.Tests/Ionide.ProjInfo.Tests.fsproj @@ -2,8 +2,8 @@ Exe - net6.0 - $(TargetFrameworks);net7.0 + net8.0 + $(TargetFrameworks);net9.0 false true false @@ -32,5 +32,16 @@ ContinueOnError="false" /> - - \ No newline at end of file + + + + + + + + + + + + + diff --git a/test/Ionide.ProjInfo.Tests/Program.fs b/test/Ionide.ProjInfo.Tests/Program.fs index 094d47b0..7e57ccbb 100644 --- a/test/Ionide.ProjInfo.Tests/Program.fs +++ b/test/Ionide.ProjInfo.Tests/Program.fs @@ -18,11 +18,12 @@ let tests = Tests.tests toolsPath let main argv = let toolsPath = Init.init (IO.DirectoryInfo Environment.CurrentDirectory) None - Tests.runTestsWithArgs - { - defaultConfig with - printer = TestPrinters.summaryPrinter defaultConfig.printer - verbosity = LogLevel.Verbose - } + let args = [ + CLIArguments.Printer (TestPrinters.summaryPrinter defaultConfig.printer) + CLIArguments.Verbosity LogLevel.Verbose + ] + + Tests.runTestsWithCLIArgs + args argv tests diff --git a/test/Ionide.ProjInfo.Tests/Tests.fs b/test/Ionide.ProjInfo.Tests/Tests.fs index 4f9d3bc0..1458f514 100644 --- a/test/Ionide.ProjInfo.Tests/Tests.fs +++ b/test/Ionide.ProjInfo.Tests/Tests.fs @@ -414,11 +414,11 @@ let testSample2 toolsPath workspaceLoader isRelease (workspaceFactory: ToolsPath projDir / ("obj/" + config - + "/netstandard2.0/.NETStandard,Version=v2.0.AssemblyAttributes.fs") + + "/netstandard2.0/n1.AssemblyInfo.fs") projDir / ("obj/" + config - + "/netstandard2.0/n1.AssemblyInfo.fs") + + "/netstandard2.0/.NETStandard,Version=v2.0.AssemblyAttributes.fs") projDir / "Library.fs" if isRelease then @@ -595,11 +595,11 @@ let testSample4 toolsPath workspaceLoader (workspaceFactory: ToolsPath -> IWorks let m1ExpectedSources = [ - projDir - / "obj/Debug/netstandard2.0/.NETStandard,Version=v2.0.AssemblyAttributes.fs" projDir / "obj/Debug/netstandard2.0/m1.AssemblyInfo.fs" projDir + / "obj/Debug/netstandard2.0/.NETStandard,Version=v2.0.AssemblyAttributes.fs" + projDir / "LibraryA.fs" ] |> List.map Path.GetFullPath @@ -879,11 +879,11 @@ let testSample9 toolsPath workspaceLoader (workspaceFactory: ToolsPath -> IWorks let expectedSources = [ - projDir - / "obj2/Debug/netstandard2.0/.NETStandard,Version=v2.0.AssemblyAttributes.fs" projDir / "obj2/Debug/netstandard2.0/n1.AssemblyInfo.fs" projDir + / "obj2/Debug/netstandard2.0/.NETStandard,Version=v2.0.AssemblyAttributes.fs" + projDir / "Library.fs" ] |> List.map Path.GetFullPath @@ -945,11 +945,11 @@ let testSample10 toolsPath workspaceLoader isRelease (workspaceFactory: ToolsPat projDir / ("obj/" + config - + "/netstandard2.0/.NETStandard,Version=v2.0.AssemblyAttributes.fs") + + "/netstandard2.0/n1.AssemblyInfo.fs") projDir / ("obj/" + config - + "/netstandard2.0/n1.AssemblyInfo.fs") + + "/netstandard2.0/.NETStandard,Version=v2.0.AssemblyAttributes.fs") projDir / "BeforeBuild.fs" projDir @@ -1614,11 +1614,11 @@ let testSample2WithBinLog toolsPath workspaceLoader (workspaceFactory: ToolsPath let expectedSources = [ - projDir - / "obj/Debug/netstandard2.0/.NETStandard,Version=v2.0.AssemblyAttributes.fs" projDir / "obj/Debug/netstandard2.0/n1.AssemblyInfo.fs" projDir + / "obj/Debug/netstandard2.0/.NETStandard,Version=v2.0.AssemblyAttributes.fs" + projDir / "Library.fs" ] |> List.map Path.GetFullPath diff --git a/test/Ionide.ProjInfo.Tests/paket.references b/test/Ionide.ProjInfo.Tests/paket.references deleted file mode 100644 index 40fc2156..00000000 --- a/test/Ionide.ProjInfo.Tests/paket.references +++ /dev/null @@ -1,12 +0,0 @@ -FSharp.Core -Expecto -Expecto.TestResults -Expecto.Diff -MedallionShell -YoloDev.Expecto.TestSdk -FSharp.Compiler.Service -Microsoft.NET.Test.Sdk -GitHubActionsTestLogger -Microsoft.Build.Framework copy_local: false -Microsoft.Build.Utilities.Core copy_local: false -Microsoft.Build.Tasks.Core copy_local: false \ No newline at end of file