Skip to content

Commit 558bb68

Browse files
committed
Merge pull request #556 from ncave/netcore
dotnet core cli build
2 parents 4c49bae + 5f92417 commit 558bb68

File tree

16 files changed

+507
-100
lines changed

16 files changed

+507
-100
lines changed

.gitignore

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -136,3 +136,17 @@ src/fsharp/FSharp.Compiler.Service/pppars.fsi
136136
*.cto
137137
tests/**/FSharp.Core.dll
138138
project.lock.json
139+
140+
src/fsharp/FSharp.Compiler.Service.netcore/FSComp.fs
141+
src/fsharp/FSharp.Compiler.Service.netcore/FSComp.resx
142+
src/fsharp/FSharp.Compiler.Service.netcore/FSIstrings.fs
143+
src/fsharp/FSharp.Compiler.Service.netcore/FSIstrings.resx
144+
src/fsharp/FSharp.Compiler.Service.netcore/illex.fs
145+
src/fsharp/FSharp.Compiler.Service.netcore/ilpars.fs
146+
src/fsharp/FSharp.Compiler.Service.netcore/ilpars.fsi
147+
src/fsharp/FSharp.Compiler.Service.netcore/lex.fs
148+
src/fsharp/FSharp.Compiler.Service.netcore/pars.fs
149+
src/fsharp/FSharp.Compiler.Service.netcore/pars.fsi
150+
src/fsharp/FSharp.Compiler.Service.netcore/pplex.fs
151+
src/fsharp/FSharp.Compiler.Service.netcore/pppars.fs
152+
src/fsharp/FSharp.Compiler.Service.netcore/pppars.fsi

FSharp.Compiler.Service.sln

Lines changed: 19 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
Microsoft Visual Studio Solution File, Format Version 12.00
22
# Visual Studio 14
3-
VisualStudioVersion = 14.0.24720.0
3+
VisualStudioVersion = 14.0.25123.0
44
MinimumVisualStudioVersion = 10.0.40219.1
55
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "project", "project", "{B6B68AE6-E7A4-4D43-9B34-FFA74BFE192B}"
66
ProjectSection(SolutionItems) = preProject
@@ -76,21 +76,24 @@ Global
7676
Release|x86 = Release|x86
7777
EndGlobalSection
7878
GlobalSection(ProjectConfigurationPlatforms) = postSolution
79-
{2E4D67B4-522D-4CF7-97E4-BA940F0B18F3}.Debug|Any CPU.ActiveCfg = Debug|x86
80-
{2E4D67B4-522D-4CF7-97E4-BA940F0B18F3}.Debug|Mixed Platforms.ActiveCfg = Debug|x86
81-
{2E4D67B4-522D-4CF7-97E4-BA940F0B18F3}.Debug|Mixed Platforms.Build.0 = Debug|x86
82-
{2E4D67B4-522D-4CF7-97E4-BA940F0B18F3}.Debug|x86.ActiveCfg = Debug|x86
83-
{2E4D67B4-522D-4CF7-97E4-BA940F0B18F3}.Debug|x86.Build.0 = Debug|x86
84-
{2E4D67B4-522D-4CF7-97E4-BA940F0B18F3}.Proto|Any CPU.ActiveCfg = Release|x86
85-
{2E4D67B4-522D-4CF7-97E4-BA940F0B18F3}.Proto|Mixed Platforms.ActiveCfg = Release|x86
86-
{2E4D67B4-522D-4CF7-97E4-BA940F0B18F3}.Proto|Mixed Platforms.Build.0 = Release|x86
87-
{2E4D67B4-522D-4CF7-97E4-BA940F0B18F3}.Proto|x86.ActiveCfg = Release|x86
88-
{2E4D67B4-522D-4CF7-97E4-BA940F0B18F3}.Proto|x86.Build.0 = Release|x86
89-
{2E4D67B4-522D-4CF7-97E4-BA940F0B18F3}.Release|Any CPU.ActiveCfg = Release|x86
90-
{2E4D67B4-522D-4CF7-97E4-BA940F0B18F3}.Release|Mixed Platforms.ActiveCfg = Release|x86
91-
{2E4D67B4-522D-4CF7-97E4-BA940F0B18F3}.Release|Mixed Platforms.Build.0 = Release|x86
92-
{2E4D67B4-522D-4CF7-97E4-BA940F0B18F3}.Release|x86.ActiveCfg = Release|x86
93-
{2E4D67B4-522D-4CF7-97E4-BA940F0B18F3}.Release|x86.Build.0 = Release|x86
79+
{2E4D67B4-522D-4CF7-97E4-BA940F0B18F3}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
80+
{2E4D67B4-522D-4CF7-97E4-BA940F0B18F3}.Debug|Any CPU.Build.0 = Debug|Any CPU
81+
{2E4D67B4-522D-4CF7-97E4-BA940F0B18F3}.Debug|Mixed Platforms.ActiveCfg = Debug|Any CPU
82+
{2E4D67B4-522D-4CF7-97E4-BA940F0B18F3}.Debug|Mixed Platforms.Build.0 = Debug|Any CPU
83+
{2E4D67B4-522D-4CF7-97E4-BA940F0B18F3}.Debug|x86.ActiveCfg = Debug|Any CPU
84+
{2E4D67B4-522D-4CF7-97E4-BA940F0B18F3}.Debug|x86.Build.0 = Debug|Any CPU
85+
{2E4D67B4-522D-4CF7-97E4-BA940F0B18F3}.Proto|Any CPU.ActiveCfg = Release|Any CPU
86+
{2E4D67B4-522D-4CF7-97E4-BA940F0B18F3}.Proto|Any CPU.Build.0 = Release|Any CPU
87+
{2E4D67B4-522D-4CF7-97E4-BA940F0B18F3}.Proto|Mixed Platforms.ActiveCfg = Release|Any CPU
88+
{2E4D67B4-522D-4CF7-97E4-BA940F0B18F3}.Proto|Mixed Platforms.Build.0 = Release|Any CPU
89+
{2E4D67B4-522D-4CF7-97E4-BA940F0B18F3}.Proto|x86.ActiveCfg = Release|Any CPU
90+
{2E4D67B4-522D-4CF7-97E4-BA940F0B18F3}.Proto|x86.Build.0 = Release|Any CPU
91+
{2E4D67B4-522D-4CF7-97E4-BA940F0B18F3}.Release|Any CPU.ActiveCfg = Release|Any CPU
92+
{2E4D67B4-522D-4CF7-97E4-BA940F0B18F3}.Release|Any CPU.Build.0 = Release|Any CPU
93+
{2E4D67B4-522D-4CF7-97E4-BA940F0B18F3}.Release|Mixed Platforms.ActiveCfg = Release|Any CPU
94+
{2E4D67B4-522D-4CF7-97E4-BA940F0B18F3}.Release|Mixed Platforms.Build.0 = Release|Any CPU
95+
{2E4D67B4-522D-4CF7-97E4-BA940F0B18F3}.Release|x86.ActiveCfg = Release|Any CPU
96+
{2E4D67B4-522D-4CF7-97E4-BA940F0B18F3}.Release|x86.Build.0 = Release|Any CPU
9497
{A40507D6-FA48-43D3-B18A-AE3DAACE4020}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
9598
{A40507D6-FA48-43D3-B18A-AE3DAACE4020}.Debug|Any CPU.Build.0 = Debug|Any CPU
9699
{A40507D6-FA48-43D3-B18A-AE3DAACE4020}.Debug|Mixed Platforms.ActiveCfg = Debug|Any CPU

build.fsx

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -213,6 +213,41 @@ Target "GitHubRelease" (fun _ ->
213213
|> Async.RunSynchronously
214214
)
215215

216+
// --------------------------------------------------------------------------------------
217+
// .NET CLI and .NET Core
218+
219+
// TODO: rework next line when workaround is available
220+
let isDotnetCliInstalled = buildServer = BuildServer.LocalBuild && Shell.Exec("dotnet", "--info") = 0
221+
let assertExitCodeZero x = if x = 0 then () else failwithf "Command failed with exit code %i" x
222+
223+
Target "DotnetCliBuild" (fun _ ->
224+
let fsLex = @"lib/bootstrap/4.0/fslex.exe"
225+
let fsYacc = @"lib/bootstrap/4.0/fsyacc.exe"
226+
let outPath = @"src/fsharp/FSharp.Compiler.Service.netcore/"
227+
let lexArgs = @" --lexlib Internal.Utilities.Text.Lexing"
228+
let yaccArgs = @" --internal --parslib Internal.Utilities.Text.Parsing"
229+
let module1 = @" --module Microsoft.FSharp.Compiler.AbstractIL.Internal.AsciiParser"
230+
let module2 = @" --module Microsoft.FSharp.Compiler.Parser"
231+
let module3 = @" --module Microsoft.FSharp.Compiler.PPParser"
232+
let open1 = @" --open Microsoft.FSharp.Compiler.AbstractIL"
233+
let open2 = @" --open Microsoft.FSharp.Compiler"
234+
let open3 = @" --open Microsoft.FSharp.Compiler"
235+
let options = " --configuration Release"
236+
237+
Shell.Exec("dotnet", "restore", outPath) |> ignore //assertExitCodeZero
238+
239+
Shell.Exec("dotnet", "fssrgen ../FSComp.txt ./FSComp.fs ./FSComp.resx", outPath) |> assertExitCodeZero
240+
Shell.Exec("dotnet", "fssrgen ../fsi/FSIstrings.txt ./FSIstrings.fs ./FSIstrings.resx", outPath) |> assertExitCodeZero
241+
Shell.Exec(fsLex, @"../lex.fsl --unicode" + lexArgs + " -o lex.fs", outPath) |> assertExitCodeZero
242+
Shell.Exec(fsLex, @"../pplex.fsl --unicode" + lexArgs + " -o pplex.fs", outPath) |> assertExitCodeZero
243+
Shell.Exec(fsLex, @"../../absil/illex.fsl --unicode" + lexArgs + " -o illex.fs", outPath) |> assertExitCodeZero
244+
Shell.Exec(fsYacc, @"../../absil/ilpars.fsy" + lexArgs + yaccArgs + module1 + open1 + " -o ilpars.fs", outPath) |> assertExitCodeZero
245+
Shell.Exec(fsYacc, @"../pars.fsy" + lexArgs + yaccArgs + module2 + open2 + " -o pars.fs", outPath) |> assertExitCodeZero
246+
Shell.Exec(fsYacc, @"../pppars.fsy" + lexArgs + yaccArgs + module3 + open3 + " -o pppars.fs", outPath) |> assertExitCodeZero
247+
248+
Shell.Exec("dotnet", "--verbose pack" + options, outPath) |> assertExitCodeZero
249+
)
250+
216251
// --------------------------------------------------------------------------------------
217252
// Run all targets by default. Invoke 'build <Target>' to override
218253

@@ -226,6 +261,7 @@ Target "Release" DoNothing
226261
==> "AssemblyInfo"
227262
==> "GenerateFSIStrings"
228263
==> "Prepare"
264+
=?> ("DotnetCliBuild", isDotnetCliInstalled)
229265
==> "Build"
230266
==> "RunTests"
231267
==> "All"

src/absil/il.fs

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -13,18 +13,12 @@ open Microsoft.FSharp.Compiler.AbstractIL
1313
open Microsoft.FSharp.Compiler.AbstractIL.Internal
1414
open Microsoft.FSharp.Compiler.AbstractIL.Internal.Library
1515
open Microsoft.FSharp.Compiler.AbstractIL.Diagnostics
16-
open System
1716
open System.Collections
1817
open System.Collections.Generic
1918
open System.Collections.Concurrent
2019

2120
let logging = false
2221

23-
let runningOnWindows =
24-
match System.Environment.OSVersion.Platform with
25-
| PlatformID.Win32NT | PlatformID.Win32S | PlatformID.Win32Windows | PlatformID.WinCE -> true
26-
| _ -> false
27-
2822
let runningOnMono =
2923
#if ENABLE_MONO_SUPPORT
3024
// Officially supported way to detect if we are running on Mono.

src/absil/il.fsi

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2276,7 +2276,6 @@ type ILPropertyRef =
22762276
member Name: string
22772277
interface System.IComparable
22782278

2279-
val runningOnWindows: bool
22802279
val runningOnMono: bool
22812280

22822281
type ILReferences =

src/absil/ilread.fs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3970,7 +3970,8 @@ let ClosePdbReader pdb =
39703970
#endif
39713971

39723972
let OpenILModuleReader infile opts =
3973-
if IL.runningOnWindows then
3973+
3974+
if not runningOnMono then
39743975
let mmap = MemoryMappedFile.Create infile
39753976
let modul,ilAssemblyRefs,pdb = genOpenBinaryReader infile mmap opts
39763977
{ modul = modul;
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
<?xml version="1.0" encoding="utf-8"?>
2+
<configuration>
3+
<packageSources>
4+
<!--To inherit the global NuGet package sources remove the <clear/> line below -->
5+
<clear />
6+
<add key="dotnet-cli" value="https://dotnet.myget.org/F/dotnet-cli/api/v3/index.json" />
7+
<add key="dotnet-core" value="https://dotnet.myget.org/F/dotnet-core/api/v3/index.json" />
8+
<add key="api.nuget.org" value="https://api.nuget.org/v3/index.json" />
9+
<add key="fsharp-daily" value="https://www.myget.org/F/fsharp-daily/api/v3/index.json" />
10+
</packageSources>
11+
</configuration>

0 commit comments

Comments
 (0)