Skip to content

Commit cd67844

Browse files
KevinRansombaronfel
authored andcommitted
Scripting package (#8173)
1 parent 37e74f6 commit cd67844

File tree

3 files changed

+15
-16
lines changed

3 files changed

+15
-16
lines changed

src/fsharp/FSharp.Compiler.Private.Scripting/FSharp.Compiler.Private.Scripting.fsproj

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@
2121
<ProjectReference Include="$(MSBuildThisFileDirectory)..\FSharp.Core\FSharp.Core.fsproj" />
2222
<ProjectReference Include="$(MSBuildThisFileDirectory)..\FSharp.Compiler.Private\FSharp.Compiler.Private.fsproj" />
2323
<ProjectReference Include="$(MSBuildThisFileDirectory)..\FSharp.DependencyManager\FSharp.DependencyManager.fsproj" />
24+
<ProjectReference Include="$(MSBuildThisFileDirectory)..\FSharp.Compiler.Interactive.Settings\FSharp.Compiler.Interactive.Settings.fsproj" />
2425
</ItemGroup>
2526

2627
</Project>

src/fsharp/FSharp.Compiler.Private.Scripting/FSharp.Compiler.Private.Scripting.nuspec

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,17 +5,20 @@
55
<language>en-US</language>
66
<dependencies>
77
<group targetFramework=".NETStandard2.0">
8-
<dependency id="FSharp.Core" version="$FSharpCoreVersion$" exclude="Build,Analyzers" />
98
</group>
109
</dependencies>
1110
</metadata>
1211
<files>
1312
$CommonFileElements$
13+
<file src="FSharp.Compiler.Private.Scripting\$Configuration$\$TargetFramework$\FSharp.Core.dll" target="lib\netstandard2.0" />
14+
<file src="FSharp.Compiler.Private.Scripting\$Configuration$\$TargetFramework$\FSharp.Core.xml" target="lib\netstandard2.0" />
1415
<file src="FSharp.Compiler.Private.Scripting\$Configuration$\$TargetFramework$\FSharp.Compiler.Private.Scripting.dll" target="lib\netstandard2.0" />
1516
<file src="FSharp.Compiler.Private.Scripting\$Configuration$\$TargetFramework$\FSharp.Compiler.Private.Scripting.xml" target="lib\netstandard2.0" />
1617
<file src="FSharp.Compiler.Private.Scripting\$Configuration$\$TargetFramework$\FSharp.Compiler.Private.dll" target="lib\netstandard2.0" />
1718
<file src="FSharp.Compiler.Private.Scripting\$Configuration$\$TargetFramework$\FSharp.Compiler.Private.xml" target="lib\netstandard2.0" />
1819
<file src="FSharp.Compiler.Private.Scripting\$Configuration$\$TargetFramework$\FSharp.DependencyManager.dll" target="lib\netstandard2.0" />
1920
<file src="FSharp.Compiler.Private.Scripting\$Configuration$\$TargetFramework$\FSharp.DependencyManager.xml" target="lib\netstandard2.0" />
21+
<file src="FSharp.Compiler.Private.Scripting\$Configuration$\$TargetFramework$\FSharp.Compiler.Interactive.Settings.dll" target="lib\netstandard2.0" />
22+
<file src="FSharp.Compiler.Private.Scripting\$Configuration$\$TargetFramework$\FSharp.Compiler.Interactive.Settings.xml" target="lib\netstandard2.0" />
2023
</files>
2124
</package>

src/utils/CompilerLocationUtils.fs

Lines changed: 10 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -182,10 +182,6 @@ module internal FSharpEnvironment =
182182
// - default location of fsi.exe in FSharp.VS.FSI.dll (REVIEW: check this)
183183
// - default F# binaries directory in (project system) Project.fs
184184
let BinFolderOfDefaultFSharpCompiler(probePoint:string option) =
185-
#if FX_NO_WIN_REGISTRY
186-
ignore probePoint
187-
Some AppDomain.CurrentDomain.BaseDirectory
188-
#else
189185
// Check for an app.config setting to redirect the default compiler location
190186
// Like fsharp-compiler-location
191187
try
@@ -200,18 +196,17 @@ module internal FSharpEnvironment =
200196
// Look in the probePoint if given, e.g. look for a compiler alongside of FSharp.Build.dll
201197
match probePoint with
202198
| Some p when safeExists (Path.Combine(p,"FSharp.Core.dll")) -> Some p
203-
| _ ->
204-
205-
// We let you set FSHARP_COMPILER_BIN. I've rarely seen this used and its not documented in the install instructions.
206-
let result = Environment.GetEnvironmentVariable("FSHARP_COMPILER_BIN")
207-
if not (String.IsNullOrEmpty(result)) then
208-
Some result
209-
else
210-
// For the prototype compiler, we can just use the current domain
211-
tryCurrentDomain()
199+
| _ ->
200+
// We let you set FSHARP_COMPILER_BIN. I've rarely seen this used and its not documented in the install instructions.
201+
let result = Environment.GetEnvironmentVariable("FSHARP_COMPILER_BIN")
202+
if not (String.IsNullOrEmpty(result)) then
203+
Some result
204+
else
205+
// For the prototype compiler, we can just use the current domain
206+
tryCurrentDomain()
212207
with e -> None
213208

214-
209+
#if !FX_NO_WIN_REGISTRY
215210
// Apply the given function to the registry entry corresponding to the subKey.
216211
// The reg key is disposed at the end of the scope.
217212
let useKey subKey f =
@@ -236,7 +231,7 @@ module internal FSharpEnvironment =
236231
IsNetFx45OrAboveInstalledAt @"SOFTWARE\Microsoft\NET Framework Setup\NDP\v4\Client" ||
237232
IsNetFx45OrAboveInstalledAt @"SOFTWARE\Microsoft\NET Framework Setup\NDP\v4\Full" ||
238233
runningOnMono
239-
234+
240235
// Check if the running framework version is 4.5 or above.
241236
// Use the presence of v4.5.x in the registry to distinguish between 4.0 and 4.5
242237
let IsRunningOnNetFx45OrAbove =

0 commit comments

Comments
 (0)