Skip to content

Commit 88e4df5

Browse files
authored
FCS build updates (#3502)
* FCS build updates * update doc generation
1 parent 86fcbe3 commit 88e4df5

File tree

13 files changed

+107
-85
lines changed

13 files changed

+107
-85
lines changed

fcs/FSharp.Compiler.Service.Tests.netcore/FSharp.Compiler.Service.Tests.netcore.fsproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@
3838
</Compile>-->
3939
</ItemGroup>
4040
<ItemGroup>
41-
<ProjectReference Include="../FSharp.Compiler.Service/FSharp.Compiler.Service.netcore.fsproj" />
41+
<ProjectReference Include="../FSharp.Compiler.Service.netstandard/FSharp.Compiler.Service.netstandard.fsproj" />
4242
</ItemGroup>
4343
<ItemGroup>
4444
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="15.0.0" />

fcs/FSharp.Compiler.Service.netstandard/FSharp.Compiler.Service.netstandard.fsproj

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77
<TargetFramework>netstandard1.6</TargetFramework>
88
<AssemblyName>FSharp.Compiler.Service</AssemblyName>
99
<DefineConstants>$(DefineConstants);BUILDING_WITH_LKG</DefineConstants>
10+
<DefineConstants>$(DefineConstants);COMPILER_PUBLIC_API</DefineConstants>
1011
<DefineConstants>$(DefineConstants);COMPILER_SERVICE_AS_DLL</DefineConstants>
1112
<DefineConstants>$(DefineConstants);COMPILER</DefineConstants>
1213
<DefineConstants>$(DefineConstants);COMPILER_SERVICE</DefineConstants>

fcs/README.md

Lines changed: 16 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -34,35 +34,35 @@ To update the version number a global replace through fcs\... is currently neede
3434

3535
To build the package use any of:
3636

37-
cd fcs
38-
build Build.NetFx
39-
build Test.NetFx
40-
build NuGet.NetFx
37+
fcs\build Build.NetFx
38+
fcs\build Test.NetFx
39+
fcs\build NuGet.NetFx
4140

42-
build Build.NetStd
43-
build Test.NetStd
44-
build NuGet.NetStd
41+
fcs\build Build.NetStd
42+
fcs\build Test.NetStd
43+
fcs\build NuGet.NetStd
4544

46-
build Build
47-
build Test
48-
build NuGet
49-
build Release
45+
fcs\build Build
46+
fcs\build Test
47+
fcs\build NuGet
48+
fcs\build Release
5049

5150
which does things like:
5251

52+
cd fcs
5353
.paket\paket.bootstrapper.exe
5454
.paket\paket.exe restore
55+
dotnet restore tools.proj
5556
packages\FAKE\tools\FAKE.exe build.fsx WhateverTarget
5657

5758
### Manual push of packages
5859

5960
Yu can push the packages if you have permissions, either automatically using ``build Release`` or manually
6061

61-
cd fcs
6262
set APIKEY=...
63-
..\.nuget\nuget.exe push ..\Release\FSharp.Compiler.Service.14.0.1.nupkg %APIKEY% -Source https://nuget.org -Timeout 500
64-
..\.nuget\nuget.exe push ..\Release\FSharp.Compiler.Service.MSBuild.v12.14.0.1.nupkg %APIKEY% -Source https://nuget.org -Timeout 500
65-
..\.nuget\nuget.exe push ..\Release\FSharp.Compiler.Service.ProjectCracker.14.0.1.nupkg %APIKEY% -Source https://nuget.org -Timeout 500
63+
.nuget\nuget.exe push Release\FSharp.Compiler.Service.14.0.2.nupkg %APIKEY% -Source https://nuget.org
64+
.nuget\nuget.exe push Release\FSharp.Compiler.Service.MSBuild.v12.14.0.2.nupkg %APIKEY% -Source https://nuget.org
65+
.nuget\nuget.exe push Release\FSharp.Compiler.Service.ProjectCracker.14.0.2.nupkg %APIKEY% -Source https://nuget.org
6666

6767

6868
### Use of Paket and FAKE
@@ -78,7 +78,7 @@ Testing reuses the test files from ..\tests\service which were are also FCS test
7878

7979
### Documentation Generation
8080

81-
build GenerateDocs
81+
fcs\build GenerateDocs
8282

8383
Output is in ``docs``. In the ``FSharp.Compiler.Service`` repo this is checked in and hosted as http://fsharp.github.io/FSharp.Compiler.Service.
8484

fcs/RELEASE_NOTES.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
1+
#### 14.0.2
2+
* Fix non-public API in .NET Standard 1.6 version
3+
14
#### 14.0.1
25
* Integrate latest changes from visualfsharp
36
* Trial release for new build in fcs\...

fcs/build.cmd

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,24 @@
11
@echo off
2+
.nuget\NuGet.exe restore -PackagesDirectory packages
3+
setlocal
4+
cd fcs
25
.paket\paket.bootstrapper.exe
6+
dotnet restore tools.fsproj
37
if errorlevel 1 (
8+
endlocal
49
exit /b %errorlevel%
510
)
611

712
.paket\paket.exe restore
813
if errorlevel 1 (
14+
endlocal
915
exit /b %errorlevel%
1016
)
1117

1218
packages\FAKE\tools\FAKE.exe build.fsx %*
19+
if errorlevel 1 (
20+
endlocal
21+
exit /b %errorlevel%
22+
)
23+
endlocal
24+
exit /b 0

fcs/build.fsx

Lines changed: 39 additions & 41 deletions
Original file line numberDiff line numberDiff line change
@@ -5,11 +5,10 @@
55
#I "packages/FAKE/tools"
66
#r "packages/FAKE/tools/FakeLib.dll"
77
open System
8-
open Fake.AppVeyor
8+
open System.IO
99
open Fake
10-
open Fake.Git
10+
open Fake.AppVeyor
1111
open Fake.ReleaseNotesHelper
12-
open Fake.UserInputHelper
1312

1413
#if MONO
1514
// prevent incorrect output encoding (e.g. https://github.com/fsharp/FAKE/issues/1196)
@@ -21,38 +20,24 @@ System.Console.OutputEncoding <- System.Text.Encoding.UTF8
2120
// --------------------------------------------------------------------------------------
2221

2322
let assertExitCodeZero x = if x = 0 then () else failwithf "Command failed with exit code %i" x
24-
let runCmdIn mono workDir exe = Printf.ksprintf (fun args ->
25-
if mono then
26-
printfn "mono %s/%s %s" workDir exe args
23+
let runCmdIn workDir (exe:string) = Printf.ksprintf (fun (args:string) ->
24+
#if MONO
25+
let exe = exe.Replace("\\","/")
26+
let args = args.Replace("\\","/")
27+
printfn "[%s] mono %s %s" workDir exe args
2728
Shell.Exec("mono", sprintf "%s %s" exe args, workDir)
28-
|> assertExitCodeZero
29-
else
30-
printfn "%s/%s %s" workDir exe args
29+
#else
30+
printfn "[%s] %s %s" workDir exe args
3131
Shell.Exec(exe, args, workDir)
32+
#endif
3233
|> assertExitCodeZero
3334
)
34-
let run mono exe = runCmdIn mono "." exe
35-
36-
// --------------------------------------------------------------------------------------
37-
// Information about the project to be used at NuGet
38-
// --------------------------------------------------------------------------------------
39-
40-
let project = "FSharp.Compiler.Service"
41-
let authors = ["Microsoft Corporation, Dave Thomas, Anh-Dung Phan, Tomas Petricek"]
42-
43-
let gitOwner = "fsharp"
44-
let gitHome = "https://github.com/" + gitOwner
45-
46-
let gitName = "FSharp.Compiler.Service"
47-
let gitRaw = environVarOrDefault "gitRaw" "https://raw.githubusercontent.com/fsharp"
48-
49-
let netFrameworks = [(* "v4.0"; *) "v4.5"]
5035

5136
// --------------------------------------------------------------------------------------
5237
// The rest of the code is standard F# build script
5338
// --------------------------------------------------------------------------------------
5439

55-
let releaseDir = "../Release"
40+
let releaseDir = Path.Combine(__SOURCE_DIRECTORY__, "../Release")
5641

5742

5843
// Read release notes & version info from RELEASE_NOTES.md
@@ -84,8 +69,6 @@ let buildVersion =
8469
else if isAppVeyorBuild then sprintf "%s-b%s" assemblyVersion AppVeyorEnvironment.BuildNumber
8570
else assemblyVersion
8671

87-
let netstdsln = gitName + ".netstandard.sln";
88-
8972
Target "BuildVersion" (fun _ ->
9073
Shell.Exec("appveyor", sprintf "UpdateBuild -Version \"%s\"" buildVersion) |> ignore
9174
)
@@ -95,7 +78,7 @@ Target "BuildVersion" (fun _ ->
9578

9679

9780
Target "Build.NetFx" (fun _ ->
98-
!! (project + ".sln")
81+
!! "FSharp.Compiler.Service.sln"
9982
|> MSBuild "" "Build" ["Configuration","Release" ]
10083
|> Log (".NETFxBuild-Output: ")
10184
)
@@ -116,9 +99,9 @@ Target "Test.NetFx" (fun _ ->
11699
// --------------------------------------------------------------------------------------
117100
// Build a NuGet package
118101
Target "NuGet.NetFx" (fun _ ->
119-
run false @"..\.nuget\nuget.exe" @"pack nuget\FSharp.Compiler.Service.nuspec -OutputDirectory %s" releaseDir
120-
run false @"..\.nuget\nuget.exe" @"pack nuget\FSharp.Compiler.Service.MSBuild.v12.nuspec -OutputDirectory %s" releaseDir
121-
run false @"..\.nuget\nuget.exe" @"pack nuget\FSharp.Compiler.Service.ProjectCracker.nuspec -OutputDirectory %s" releaseDir
102+
runCmdIn __SOURCE_DIRECTORY__ @"..\.nuget\NuGet.exe" @"pack nuget\FSharp.Compiler.Service.nuspec -OutputDirectory %s" releaseDir
103+
runCmdIn __SOURCE_DIRECTORY__ @"..\.nuget\NuGet.exe" @"pack nuget\FSharp.Compiler.Service.MSBuild.v12.nuspec -OutputDirectory %s" releaseDir
104+
runCmdIn __SOURCE_DIRECTORY__ @"..\.nuget\NuGet.exe" @"pack nuget\FSharp.Compiler.Service.ProjectCracker.nuspec -OutputDirectory %s" releaseDir
122105
)
123106

124107

@@ -140,28 +123,27 @@ let isDotnetSDKInstalled =
140123

141124

142125
Target "Build.NetStd" (fun _ ->
143-
run false "dotnet" "pack %s -v n -c Release" netstdsln
126+
runCmdIn __SOURCE_DIRECTORY__ "dotnet" "pack %s -v n -c Release" "FSharp.Compiler.Service.netstandard.sln"
144127
)
145128

146129

147130
Target "Test.NetStd" (fun _ ->
148-
run false "dotnet" "run -p FSharp.Compiler.Service.Tests.netcore/FSharp.Compiler.Service.Tests.netcore.fsproj -c Release -- --result:TestResults.NetStd.xml;format=nunit3"
131+
runCmdIn __SOURCE_DIRECTORY__ "dotnet" "run -p FSharp.Compiler.Service.Tests.netcore/FSharp.Compiler.Service.Tests.netcore.fsproj -c Release -- --result:TestResults.NetStd.xml;format=nunit3"
149132
)
150133

151134

152135
//use dotnet-mergenupkg to merge the .NETstandard nuget package into the default one
153136
Target "Nuget.AddNetStd" (fun _ ->
154-
do
155-
let nupkg = sprintf "%s/FSharp.Compiler.Service.%s.nupkg" releaseDir release.AssemblyVersion
156-
let netcoreNupkg = sprintf "FSharp.Compiler.Service.netstandard/bin/Release/FSharp.Compiler.Service.%s.nupkg" release.AssemblyVersion
157-
runCmdIn false "." "dotnet" "mergenupkg --source %s --other %s --framework netstandard1.6" nupkg netcoreNupkg
137+
let nupkg = sprintf "%s/FSharp.Compiler.Service.%s.nupkg" releaseDir release.AssemblyVersion
138+
let netcoreNupkg = sprintf "FSharp.Compiler.Service.netstandard/bin/Release/FSharp.Compiler.Service.%s.nupkg" release.AssemblyVersion
139+
runCmdIn __SOURCE_DIRECTORY__ "dotnet" "mergenupkg --source %s --other %s --framework netstandard1.6" nupkg netcoreNupkg
158140
)
159141

160142

161143
// --------------------------------------------------------------------------------------
162144
// Generate the documentation
163145

164-
Target "GenerateDocs" (fun _ ->
146+
Target "GenerateDocsEn" (fun _ ->
165147
executeFSIWithArgs "docsrc/tools" "generate.fsx" ["--define:RELEASE"] [] |> ignore
166148
)
167149

@@ -187,10 +169,11 @@ Target "PublishNuGet" (fun _ ->
187169
// Run all targets by default. Invoke 'build <Target>' to override
188170

189171
Target "Clean" DoNothing
190-
Target "CleanDocs" DoNothing
191172
Target "Release" DoNothing
192173
Target "NuGet" DoNothing
193174
Target "Build" DoNothing
175+
Target "GenerateDocs" DoNothing
176+
Target "TestAndNuGet" DoNothing
194177

195178
"Clean"
196179
=?> ("BuildVersion", isAppVeyorBuild)
@@ -218,14 +201,29 @@ Target "Build" DoNothing
218201
=?> ("Nuget.AddNetStd", isDotnetSDKInstalled)
219202
==> "NuGet"
220203

204+
"Test.NetFx"
205+
==> "TestAndNuGet"
206+
207+
"NuGet"
208+
==> "TestAndNuGet"
209+
210+
//"Test.NetStd"
211+
// ==> "TestAndNuGet"
212+
221213
"Build"
222214
==> "NuGet"
223215
==> "PublishNuGet"
224216
==> "Release"
225217

226-
"CleanDocs"
218+
"Build"
219+
==> "GenerateDocsEn"
227220
==> "GenerateDocs"
221+
222+
"Build"
228223
==> "GenerateDocsJa"
224+
==> "GenerateDocs"
225+
226+
"GenerateDocs"
229227
==> "Release"
230228

231229
RunTargetOrDefault "Build"

fcs/build.sh

Lines changed: 6 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -2,25 +2,19 @@
22
if test "$OS" = "Windows_NT"
33
then
44
# use .Net
5-
.paket/paket.bootstrapper.exe
6-
exit_code=$?
7-
if [ $exit_code -ne 0 ]; then
8-
exit $exit_code
9-
fi
5+
cmd fcs/build.cmd $@
6+
else
7+
mono .nuget/NuGet.exe restore -PackagesDirectory packages
108

11-
.paket/paket.exe restore
12-
exit_code=$?
13-
if [ $exit_code -ne 0 ]; then
14-
exit $exit_code
15-
fi
9+
cd fcs
1610

17-
packages/FAKE/tools/FAKE.exe build.fsx $@
18-
else
1911
# use mono
2012
if [[ ! -e ~/.config/.mono/certs ]]; then
2113
mozroots --import --sync --quiet
2214
fi
2315

16+
dotnet restore tools.fsproj
17+
2418
mono .paket/paket.bootstrapper.exe
2519
exit_code=$?
2620
if [ $exit_code -ne 0 ]; then

fcs/docsrc/tools/generate.fsx

Lines changed: 23 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ let root = "."
3434
// Paths with template/source/output locations
3535
let bin = __SOURCE_DIRECTORY__ @@ "../../../Release/fcs/net45"
3636
let content = __SOURCE_DIRECTORY__ @@ "../content"
37-
let output = __SOURCE_DIRECTORY__ @@ "../../docs"
37+
let output = __SOURCE_DIRECTORY__ @@ "../../../docs"
3838
let files = __SOURCE_DIRECTORY__ @@ "../files"
3939
let templates = __SOURCE_DIRECTORY__ @@ "templates"
4040
let formatting = __SOURCE_DIRECTORY__ @@ "../../packages/FSharp.Formatting/"
@@ -52,6 +52,9 @@ let copyFiles () =
5252
CopyRecursive (formatting @@ "styles") (output @@ "content") true
5353
|> Log "Copying styles and scripts: "
5454

55+
let clr = System.Runtime.InteropServices.RuntimeEnvironment.GetRuntimeDirectory()
56+
let fsfmt = __SOURCE_DIRECTORY__ @@ ".." @@ ".." @@ @"packages" @@ "FSharp.Formatting" @@ "lib" @@ "net40"
57+
5558
// Build API reference from XML comments
5659
let buildReference () =
5760
CleanDir (output @@ "reference")
@@ -60,7 +63,24 @@ let buildReference () =
6063
( bin @@ lib, output @@ "reference", layoutRoots,
6164
parameters = ("root", root)::info,
6265
sourceRepo = "https://github.com/fsharp/FSharp.Compiler.Service/tree/master/src",
63-
sourceFolder = @"..\..\..\src" )
66+
sourceFolder = @"..\..\..\src",
67+
assemblyReferences =
68+
[clr @@ "System.Runtime.dll"
69+
clr @@ "System.dll"
70+
clr @@ "System.Core.dll"
71+
clr @@ "Microsoft.CSharp.dll"
72+
clr @@ "System.Linq.dll"
73+
clr @@ "System.dll"
74+
bin @@ "System.Reflection.Metadata.dll"
75+
clr @@ "System.Numerics.dll"
76+
bin @@ "System.Collections.Immutable.dll"
77+
clr @@ "System.IO.dll"
78+
clr @@ "mscorlib.dll"
79+
fsfmt @@ "FSharp.MetadataFormat.dll"
80+
fsfmt @@ "RazorEngine.dll"
81+
bin @@ "FSharp.Core.dll"
82+
bin @@ "FSharp.Compiler.Service.dll"
83+
] )
6484

6585
// Build documentation from `fsx` and `md` files in `docsrc/content`
6686
let buildDocumentation () =
@@ -73,6 +93,6 @@ let buildDocumentation () =
7393

7494
// Generate
7595
copyFiles()
76-
//buildDocumentation()
96+
buildDocumentation()
7797
buildReference()
7898

fcs/docsrc/tools/generate.ja.fsx

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,6 @@
33
// (the generated documentation is stored in the 'docs' directory)
44
// --------------------------------------------------------------------------------------
55

6-
// Binaries that have XML documentation (in a corresponding generated XML file)
7-
let referenceBinaries = [ "FSharp.Compiler.Service.dll" ]
86
// Web site location for the generated documentation
97
let website = "/FSharp.Compiler.Service/ja"
108

@@ -49,20 +47,16 @@ let root = "file://" + (__SOURCE_DIRECTORY__ @@ "../output/ja")
4947
// Paths with template/source/output locations
5048
let bin = __SOURCE_DIRECTORY__ @@ "../../../Release/fcs/net45"
5149
let content = __SOURCE_DIRECTORY__ @@ "../content/ja"
52-
let output = __SOURCE_DIRECTORY__ @@ "../../docs"
53-
let outputJa = __SOURCE_DIRECTORY__ @@ "../../docs/ja"
50+
let outputJa = __SOURCE_DIRECTORY__ @@ "../../../docs/ja"
5451
let files = __SOURCE_DIRECTORY__ @@ "../files"
5552
let templates = __SOURCE_DIRECTORY__ @@ "templates/ja"
56-
let reference = __SOURCE_DIRECTORY__ @@ "reference"
5753
let formatting = __SOURCE_DIRECTORY__ @@ "../../packages/FSharp.Formatting/"
5854
let docTemplate = formatting @@ "templates/docpage.cshtml"
5955

6056
// Where to look for *.csproj templates (in this order)
6157
let layoutRoots =
6258
[ templates
63-
reference
64-
formatting @@ "templates"
65-
formatting @@ "templates/reference" ]
59+
formatting @@ "templates"]
6660

6761
// Copy static files and CSS + JS from F# Formatting
6862
// Build documentation from `fsx` and `md` files in `docsrc/content`

0 commit comments

Comments
 (0)