-
-
Notifications
You must be signed in to change notification settings - Fork 37
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
13 changed files
with
114 additions
and
27 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
<?xml version="1.0" encoding="utf-8"?> | ||
<configuration> | ||
<packageSources> | ||
<!--To inherit the global NuGet package sources remove the <clear/> line below --> | ||
<clear /> | ||
<add key="nuget" value="https://api.nuget.org/v3/index.json" /> | ||
</packageSources> | ||
</configuration> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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 | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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 <PATH> the path to a project file to load | ||
--solution <PATH> 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. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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. | ||
|
||
``` | ||
<PackageReference Include="Microsoft.Build.Framework" Version="17.2.0" ExcludeAssets="runtime" PrivateAssets="all" /> | ||
<PackageReference Include="NuGet.Frameworks" Version="6.2.1" ExcludeAssets="runtime" PrivateAssets="all" /> | ||
<PackageReference Include="Ionide.ProjInfo" Version="some_version" /> | ||
``` | ||
|
||
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. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters