Skip to content

Commit aa54c06

Browse files
authored
ngen dependency manager (#8372)
1 parent 82f2483 commit aa54c06

File tree

2 files changed

+9
-15
lines changed

2 files changed

+9
-15
lines changed

src/fsharp/FSharp.DependencyManager/FSharp.DependencyManager.Utilities.fs

Lines changed: 8 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -12,11 +12,6 @@ open System.Runtime.Versioning
1212

1313
open Internal.Utilities.FSharpEnvironment
1414

15-
#if !(NETSTANDARD || NETCOREAPP)
16-
open Microsoft.Build.Evaluation
17-
open Microsoft.Build.Framework
18-
#endif
19-
2015
[<AttributeUsage(AttributeTargets.Assembly ||| AttributeTargets.Class , AllowMultiple = false)>]
2116
type DependencyManagerAttribute() = inherit System.Attribute()
2217

@@ -86,7 +81,6 @@ module Utilities =
8681

8782
let sdks = "Sdks"
8883

89-
#if !(NETSTANDARD || NETCOREAPP)
9084
let msbuildExePath =
9185
// Find msbuild.exe when invoked from desktop compiler.
9286
// 1. Look relative to F# compiler location Normal retail build
@@ -120,7 +114,7 @@ module Utilities =
120114
| _ -> None
121115

122116
roots |> Array.tryFind(fun root -> msbuildPathExists root) |> msbuildOption
123-
#else
117+
124118
let dotnetHostPath =
125119
// How to find dotnet.exe --- woe is me; probing rules make me sad.
126120
// Algorithm:
@@ -156,7 +150,6 @@ module Utilities =
156150
Some dotnet
157151
else
158152
None
159-
#endif
160153

161154
let drainStreamToFile (stream: StreamReader) filename =
162155
use file = File.OpenWrite(filename)
@@ -210,13 +203,13 @@ module Utilities =
210203
let workingDir = Path.GetDirectoryName projectPath
211204

212205
let succeeded =
213-
#if !(NETSTANDARD || NETCOREAPP)
214-
// The Desktop build uses "msbuild" to build
215-
executeBuild msbuildExePath (arguments "") workingDir
216-
#else
217-
// The coreclr uses "dotnet msbuild" to build
218-
executeBuild dotnetHostPath (arguments "msbuild") workingDir
219-
#endif
206+
if not (isRunningOnCoreClr) then
207+
// The Desktop build uses "msbuild" to build
208+
executeBuild msbuildExePath (arguments "") workingDir
209+
else
210+
// The coreclr uses "dotnet msbuild" to build
211+
executeBuild dotnetHostPath (arguments "msbuild") workingDir
212+
220213
let outputFile = projectPath + ".fsx"
221214
let resultOutFile = if succeeded && File.Exists(outputFile) then Some outputFile else None
222215
succeeded, resultOutFile

vsintegration/Vsix/VisualFSharpFull/Source.extension.vsixmanifest

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@
1919
<Action Type="Ngen" Path="FSharp.Compiler.Interactive.Settings.dll" />
2020
<Action Type="Ngen" Path="FSharp.Compiler.Server.Shared.dll" />
2121
<Action Type="Ngen" Path="FSharp.Core.dll" />
22+
<Action Type="Ngen" Path="FSharp.DependencyManager.dll" />
2223
<Action Type="Ngen" Path="FSharp.Editor.dll" />
2324
<Action Type="Ngen" Path="FSharp.Editor.Helpers.dll" />
2425
<Action Type="Ngen" Path="FSharp.UIResources.dll" />

0 commit comments

Comments
 (0)