Skip to content

Commit b8fb519

Browse files
authored
Merge pull request #616 from enricosada/fix_preview2
Cleanup for .NET Core SDK preview2
2 parents 769668c + 45544de commit b8fb519

File tree

32 files changed

+351
-334
lines changed

32 files changed

+351
-334
lines changed

.gitignore

Lines changed: 4 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -192,18 +192,9 @@ src/fsharp/FSharp.Compiler.Service/pppars.fsi
192192
*.vstman
193193
project.lock.json
194194

195-
src/fsharp/FSharp.Compiler.Service.netcore/FSComp.fs
196-
src/fsharp/FSharp.Compiler.Service.netcore/FSComp.resx
197-
src/fsharp/FSharp.Compiler.Service.netcore/FSIstrings.fs
198-
src/fsharp/FSharp.Compiler.Service.netcore/FSIstrings.resx
199-
src/fsharp/FSharp.Compiler.Service.netcore/illex.fs
200-
src/fsharp/FSharp.Compiler.Service.netcore/ilpars.fs
201-
src/fsharp/FSharp.Compiler.Service.netcore/ilpars.fsi
202-
src/fsharp/FSharp.Compiler.Service.netcore/lex.fs
203-
src/fsharp/FSharp.Compiler.Service.netcore/pars.fs
204-
src/fsharp/FSharp.Compiler.Service.netcore/pars.fsi
205-
src/fsharp/FSharp.Compiler.Service.netcore/pplex.fs
206-
src/fsharp/FSharp.Compiler.Service.netcore/pppars.fs
207-
src/fsharp/FSharp.Compiler.Service.netcore/pppars.fsi
195+
src/fsharp/FSharp.Compiler.Service/FSComp.fs
196+
src/fsharp/FSharp.Compiler.Service/FSComp.resx
197+
src/fsharp/FSharp.Compiler.Service/FSIstrings.fs
198+
src/fsharp/FSharp.Compiler.Service/FSIstrings.resx
208199
Tools/
209200
Backup/

src/fsharp/FSharp.Compiler.Service.ProjectCracker.netcore/NuGet.Config renamed to NuGet.Config

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
<?xml version="1.0" encoding="utf-8"?>
22
<configuration>
33
<packageSources>
4-
<add key="fsharp-netcore-preview2" value="https://www.myget.org/F/fsharp-netcoresdk-preview2-betatest/api/v3/index.json" />
54
<!-- MSBuild -->
65
<add key="dotnet-buildtools" value="https://dotnet.myget.org/F/dotnet-buildtools/api/v3/index.json" />
76
</packageSources>

appveyor.yml

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -5,12 +5,7 @@ init:
55

66
environment:
77
matrix:
8-
- BUILD_TARGET: DotnetCliTests
9-
- BUILD_TARGET: NuGet
10-
11-
matrix:
12-
allow_failures:
13-
- BUILD_TARGET: DotnetCliTests
8+
- BUILD_TARGET: CreatePackage
149

1510
build_script:
1611
- ps: dotnet --info

build.fsx

Lines changed: 56 additions & 44 deletions
Original file line numberDiff line numberDiff line change
@@ -219,52 +219,64 @@ Target "GitHubRelease" (fun _ ->
219219
)
220220

221221
// --------------------------------------------------------------------------------------
222-
// .NET CLI and .NET Core
222+
// .NET Core and .NET Core SDK
223223

224-
let isDotnetCliInstalled = (try Shell.Exec("dotnet", "--info") = 0 with _ -> false)
224+
let isDotnetSDKInstalled = (try Shell.Exec("dotnet", "--info") = 0 with _ -> false)
225225
let assertExitCodeZero x = if x = 0 then () else failwithf "Command failed with exit code %i" x
226-
227-
Target "DotnetCliCodeGen" (fun _ ->
228-
let fsLex = @"lib/bootstrap/4.0/fslex.exe"
229-
let fsYacc = @"lib/bootstrap/4.0/fsyacc.exe"
230-
let lexArgs = @" --lexlib Internal.Utilities.Text.Lexing"
231-
let yaccArgs = @" --internal --parslib Internal.Utilities.Text.Parsing"
232-
let module1 = @" --module Microsoft.FSharp.Compiler.AbstractIL.Internal.AsciiParser"
233-
let module2 = @" --module Microsoft.FSharp.Compiler.Parser"
234-
let module3 = @" --module Microsoft.FSharp.Compiler.PPParser"
235-
let open1 = @" --open Microsoft.FSharp.Compiler.AbstractIL"
236-
let open2 = @" --open Microsoft.FSharp.Compiler"
237-
let open3 = @" --open Microsoft.FSharp.Compiler"
238-
239-
// restore tools
240-
let workDir = @"src/fsharp/FSharp.Compiler.Service.netcore/"
241-
Shell.Exec("dotnet", "restore -v Minimal", workDir) |> assertExitCodeZero
226+
let runCmdIn workDir exe = Printf.ksprintf (fun args -> Shell.Exec(exe, args, workDir) |> assertExitCodeZero)
227+
let run exe = runCmdIn "." exe
228+
229+
Target "DotnetCoreCodeGen" (fun _ ->
230+
let lexArgs = "--lexlib Internal.Utilities.Text.Lexing"
231+
let yaccArgs = "--internal --parslib Internal.Utilities.Text.Parsing"
232+
let module1 = "--module Microsoft.FSharp.Compiler.AbstractIL.Internal.AsciiParser"
233+
let module2 = "--module Microsoft.FSharp.Compiler.Parser"
234+
let module3 = "--module Microsoft.FSharp.Compiler.PPParser"
235+
let open1 = "--open Microsoft.FSharp.Compiler.AbstractIL"
236+
let open2 = "--open Microsoft.FSharp.Compiler"
237+
let open3 = "--open Microsoft.FSharp.Compiler"
238+
239+
// dotnet restore
240+
run "dotnet" "restore -v Information"
242241

243242
// run tools
244-
Shell.Exec("dotnet", "fssrgen ../FSComp.txt ./FSComp.fs ./FSComp.resx", workDir) |> assertExitCodeZero
245-
Shell.Exec("dotnet", "fssrgen ../fsi/FSIstrings.txt ./FSIstrings.fs ./FSIstrings.resx", workDir) |> assertExitCodeZero
246-
Shell.Exec(fsLex, @"../lex.fsl --unicode" + lexArgs + " -o lex.fs", workDir) |> assertExitCodeZero
247-
Shell.Exec(fsLex, @"../pplex.fsl --unicode" + lexArgs + " -o pplex.fs", workDir) |> assertExitCodeZero
248-
Shell.Exec(fsLex, @"../../absil/illex.fsl --unicode" + lexArgs + " -o illex.fs", workDir) |> assertExitCodeZero
249-
Shell.Exec(fsYacc, @"../../absil/ilpars.fsy" + lexArgs + yaccArgs + module1 + open1 + " -o ilpars.fs", workDir) |> assertExitCodeZero
250-
Shell.Exec(fsYacc, @"../pars.fsy" + lexArgs + yaccArgs + module2 + open2 + " -o pars.fs", workDir) |> assertExitCodeZero
251-
Shell.Exec(fsYacc, @"../pppars.fsy" + lexArgs + yaccArgs + module3 + open3 + " -o pppars.fs", workDir) |> assertExitCodeZero
243+
let runInDir exe = runCmdIn "src/fsharp/FSharp.Compiler.Service/" exe
244+
let fsLex fslFilePath outFilePath = runInDir "lib/bootstrap/4.0/fslex.exe" @"%s --unicode %s -o %s" fslFilePath lexArgs outFilePath
245+
let fsYacc = runInDir "lib/bootstrap/4.0/fsyacc.exe"
246+
247+
runInDir "dotnet" "fssrgen ../FSComp.txt ./FSComp.fs ./FSComp.resx"
248+
runInDir "dotnet" "fssrgen ../fsi/FSIstrings.txt ./FSIstrings.fs ./FSIstrings.resx"
249+
fsLex "../lex.fsl" "lex.fs"
250+
fsLex "../pplex.fsl" "pplex.fs"
251+
fsLex "../../absil/illex.fsl" "illex.fs"
252+
fsYacc "../../absil/ilpars.fsy %s %s %s %s -o ilpars.fs" lexArgs yaccArgs module1 open1
253+
fsYacc "../pars.fsy %s %s %s %s -o pars.fs" lexArgs yaccArgs module2 open2
254+
fsYacc "../pppars.fsy %s %s %s %s -o pppars.fs" lexArgs yaccArgs module3 open3
252255
)
253256

254-
Target "DotnetCliBuild" (fun _ ->
255-
let workDir = @"src/fsharp/FSharp.Compiler.Service.netcore/"
256-
Shell.Exec("dotnet", "restore -v Information", workDir) |> assertExitCodeZero
257-
Shell.Exec("dotnet", "-v pack -c Release -o ../../../" + buildDir, workDir) |> assertExitCodeZero
258-
259-
let workDir = @"src/fsharp/FSharp.Compiler.Service.ProjectCracker.netcore/"
260-
Shell.Exec("dotnet", "restore -v Information", workDir) |> assertExitCodeZero
261-
Shell.Exec("dotnet", "-v pack -c Release -o ../../../" + buildDir, workDir) |> assertExitCodeZero
257+
Target "Build.NetCore" (fun _ ->
258+
[ "src/fsharp/FSharp.Compiler.Service/";
259+
"src/fsharp/FSharp.Compiler.Service.ProjectCracker/";
260+
"src/fsharp/FSharp.Compiler.Service.ProjectCrackerTool/" ]
261+
|> List.iter (run "dotnet" "-v pack %s -c Release")
262262
)
263263

264-
Target "DotnetCliTests" (fun _ ->
265-
let workDir = @"tests/FSharp.Compiler.Service.Tests.netcore/"
266-
Shell.Exec("dotnet", "restore -v Information", workDir) |> assertExitCodeZero
267-
Shell.Exec("dotnet", "-v run -c Release", workDir) |> assertExitCodeZero
264+
Target "RunTests.NetCore" (fun _ ->
265+
runCmdIn "tests/service/" "dotnet" "test -c Release --result:TestResults.NetCore.xml;format=nunit3"
266+
)
267+
268+
269+
//use dotnet-mergenupkg to merge the .netcore nuget package into the default one
270+
Target "Nuget.AddNetCore" (fun _ ->
271+
do
272+
let nupkg = sprintf "../../../%s/FSharp.Compiler.Service.%s.nupkg" buildDir (release.AssemblyVersion)
273+
let netcoreNupkg = sprintf "bin/Release/FSharp.Compiler.Service.%s.nupkg" (release.AssemblyVersion)
274+
runCmdIn "src/fsharp/FSharp.Compiler.Service" "dotnet" "mergenupkg --source %s --other %s --framework netstandard1.6" nupkg netcoreNupkg
275+
276+
do
277+
let nupkg = sprintf "../../../%s/FSharp.Compiler.Service.ProjectCracker.%s.nupkg" buildDir (release.AssemblyVersion)
278+
let netcoreNupkg = sprintf "bin/Release/FSharp.Compiler.Service.ProjectCracker.%s.nupkg" (release.AssemblyVersion)
279+
runCmdIn "src/fsharp/FSharp.Compiler.Service.ProjectCracker" "dotnet" "mergenupkg --source %s --other %s --framework netstandard1.6" nupkg netcoreNupkg
268280
)
269281

270282
// --------------------------------------------------------------------------------------
@@ -274,26 +286,26 @@ Target "Prepare" DoNothing
274286
Target "PrepareRelease" DoNothing
275287
Target "All" DoNothing
276288
Target "Release" DoNothing
277-
Target "DotnetCli" DoNothing
278-
279-
"DotnetCli"
280-
=?> ("DotnetCliCodeGen", isDotnetCliInstalled)
281-
=?> ("DotnetCliBuild", isDotnetCliInstalled)
282-
=?> ("DotnetCliTests", isDotnetCliInstalled)
289+
Target "CreatePackage" DoNothing
283290

284291
"Clean"
285292
=?> ("BuildVersion", isAppVeyorBuild)
286293
==> "AssemblyInfo"
287294
==> "GenerateFSIStrings"
288295
==> "Prepare"
289296
==> "Build"
297+
=?> ("DotnetCoreCodeGen", isDotnetSDKInstalled)
298+
=?> ("Build.NetCore", isDotnetSDKInstalled)
290299
==> "RunTests"
300+
=?> ("RunTests.NetCore", isDotnetSDKInstalled)
291301
==> "All"
292302

293303
"All"
294304
==> "PrepareRelease"
295305
==> "SourceLink"
296306
==> "NuGet"
307+
=?> ("Nuget.AddNetCore", isDotnetSDKInstalled)
308+
==> "CreatePackage"
297309
==> "GitHubRelease"
298310
==> "PublishNuGet"
299311
==> "Release"

global.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
{
22
"projects": [ "src/fsharp", "tests" ]
3-
}
3+
}

src/fsharp/FSharp.Build/project.json

Lines changed: 0 additions & 22 deletions
This file was deleted.

src/fsharp/FSharp.Compiler.Service.ProjectCracker.netcore/Program.fs

Lines changed: 0 additions & 21 deletions
This file was deleted.

src/fsharp/FSharp.Compiler.Service.ProjectCracker.netcore/ProjectCracker.fs

Lines changed: 0 additions & 48 deletions
This file was deleted.

src/fsharp/FSharp.Compiler.Service.ProjectCracker.netcore/project.json

Lines changed: 0 additions & 73 deletions
This file was deleted.

src/fsharp/FSharp.Compiler.Service.ProjectCracker/FSharp.Compiler.Service.ProjectCracker.fsproj

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@
1515
<Name>FSharp.Compiler.Service.ProjectCracker</Name>
1616
<OutputPath>..\..\..\bin\$(TargetFrameworkVersion)</OutputPath>
1717
<DocumentationFile>..\..\..\bin\$(TargetFrameworkVersion)\FSharp.Compiler.Service.ProjectCracker.xml</DocumentationFile>
18+
<ResolveNuGetPackages>false</ResolveNuGetPackages>
1819
</PropertyGroup>
1920
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
2021
<DebugSymbols>true</DebugSymbols>

0 commit comments

Comments
 (0)