提交 88e4df59 编写于 作者: D Don Syme 提交者: GitHub

FCS build updates (#3502)

* FCS build updates

* update doc generation
上级 86fcbe34
......@@ -38,7 +38,7 @@
</Compile>-->
</ItemGroup>
<ItemGroup>
<ProjectReference Include="../FSharp.Compiler.Service/FSharp.Compiler.Service.netcore.fsproj" />
<ProjectReference Include="../FSharp.Compiler.Service.netstandard/FSharp.Compiler.Service.netstandard.fsproj" />
</ItemGroup>
<ItemGroup>
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="15.0.0" />
......
......@@ -7,6 +7,7 @@
<TargetFramework>netstandard1.6</TargetFramework>
<AssemblyName>FSharp.Compiler.Service</AssemblyName>
<DefineConstants>$(DefineConstants);BUILDING_WITH_LKG</DefineConstants>
<DefineConstants>$(DefineConstants);COMPILER_PUBLIC_API</DefineConstants>
<DefineConstants>$(DefineConstants);COMPILER_SERVICE_AS_DLL</DefineConstants>
<DefineConstants>$(DefineConstants);COMPILER</DefineConstants>
<DefineConstants>$(DefineConstants);COMPILER_SERVICE</DefineConstants>
......
......@@ -34,35 +34,35 @@ To update the version number a global replace through fcs\... is currently neede
To build the package use any of:
cd fcs
build Build.NetFx
build Test.NetFx
build NuGet.NetFx
fcs\build Build.NetFx
fcs\build Test.NetFx
fcs\build NuGet.NetFx
build Build.NetStd
build Test.NetStd
build NuGet.NetStd
fcs\build Build.NetStd
fcs\build Test.NetStd
fcs\build NuGet.NetStd
build Build
build Test
build NuGet
build Release
fcs\build Build
fcs\build Test
fcs\build NuGet
fcs\build Release
which does things like:
cd fcs
.paket\paket.bootstrapper.exe
.paket\paket.exe restore
dotnet restore tools.proj
packages\FAKE\tools\FAKE.exe build.fsx WhateverTarget
### Manual push of packages
Yu can push the packages if you have permissions, either automatically using ``build Release`` or manually
cd fcs
set APIKEY=...
..\.nuget\nuget.exe push ..\Release\FSharp.Compiler.Service.14.0.1.nupkg %APIKEY% -Source https://nuget.org -Timeout 500
..\.nuget\nuget.exe push ..\Release\FSharp.Compiler.Service.MSBuild.v12.14.0.1.nupkg %APIKEY% -Source https://nuget.org -Timeout 500
..\.nuget\nuget.exe push ..\Release\FSharp.Compiler.Service.ProjectCracker.14.0.1.nupkg %APIKEY% -Source https://nuget.org -Timeout 500
.nuget\nuget.exe push Release\FSharp.Compiler.Service.14.0.2.nupkg %APIKEY% -Source https://nuget.org
.nuget\nuget.exe push Release\FSharp.Compiler.Service.MSBuild.v12.14.0.2.nupkg %APIKEY% -Source https://nuget.org
.nuget\nuget.exe push Release\FSharp.Compiler.Service.ProjectCracker.14.0.2.nupkg %APIKEY% -Source https://nuget.org
### Use of Paket and FAKE
......@@ -78,7 +78,7 @@ Testing reuses the test files from ..\tests\service which were are also FCS test
### Documentation Generation
build GenerateDocs
fcs\build GenerateDocs
Output is in ``docs``. In the ``FSharp.Compiler.Service`` repo this is checked in and hosted as http://fsharp.github.io/FSharp.Compiler.Service.
......
#### 14.0.2
* Fix non-public API in .NET Standard 1.6 version
#### 14.0.1
* Integrate latest changes from visualfsharp
* Trial release for new build in fcs\...
......
@echo off
.nuget\NuGet.exe restore -PackagesDirectory packages
setlocal
cd fcs
.paket\paket.bootstrapper.exe
dotnet restore tools.fsproj
if errorlevel 1 (
endlocal
exit /b %errorlevel%
)
.paket\paket.exe restore
if errorlevel 1 (
endlocal
exit /b %errorlevel%
)
packages\FAKE\tools\FAKE.exe build.fsx %*
if errorlevel 1 (
endlocal
exit /b %errorlevel%
)
endlocal
exit /b 0
......@@ -5,11 +5,10 @@
#I "packages/FAKE/tools"
#r "packages/FAKE/tools/FakeLib.dll"
open System
open Fake.AppVeyor
open System.IO
open Fake
open Fake.Git
open Fake.AppVeyor
open Fake.ReleaseNotesHelper
open Fake.UserInputHelper
#if MONO
// prevent incorrect output encoding (e.g. https://github.com/fsharp/FAKE/issues/1196)
......@@ -21,38 +20,24 @@ System.Console.OutputEncoding <- System.Text.Encoding.UTF8
// --------------------------------------------------------------------------------------
let assertExitCodeZero x = if x = 0 then () else failwithf "Command failed with exit code %i" x
let runCmdIn mono workDir exe = Printf.ksprintf (fun args ->
if mono then
printfn "mono %s/%s %s" workDir exe args
let runCmdIn workDir (exe:string) = Printf.ksprintf (fun (args:string) ->
#if MONO
let exe = exe.Replace("\\","/")
let args = args.Replace("\\","/")
printfn "[%s] mono %s %s" workDir exe args
Shell.Exec("mono", sprintf "%s %s" exe args, workDir)
|> assertExitCodeZero
else
printfn "%s/%s %s" workDir exe args
#else
printfn "[%s] %s %s" workDir exe args
Shell.Exec(exe, args, workDir)
#endif
|> assertExitCodeZero
)
let run mono exe = runCmdIn mono "." exe
// --------------------------------------------------------------------------------------
// Information about the project to be used at NuGet
// --------------------------------------------------------------------------------------
let project = "FSharp.Compiler.Service"
let authors = ["Microsoft Corporation, Dave Thomas, Anh-Dung Phan, Tomas Petricek"]
let gitOwner = "fsharp"
let gitHome = "https://github.com/" + gitOwner
let gitName = "FSharp.Compiler.Service"
let gitRaw = environVarOrDefault "gitRaw" "https://raw.githubusercontent.com/fsharp"
let netFrameworks = [(* "v4.0"; *) "v4.5"]
// --------------------------------------------------------------------------------------
// The rest of the code is standard F# build script
// --------------------------------------------------------------------------------------
let releaseDir = "../Release"
let releaseDir = Path.Combine(__SOURCE_DIRECTORY__, "../Release")
// Read release notes & version info from RELEASE_NOTES.md
......@@ -84,8 +69,6 @@ let buildVersion =
else if isAppVeyorBuild then sprintf "%s-b%s" assemblyVersion AppVeyorEnvironment.BuildNumber
else assemblyVersion
let netstdsln = gitName + ".netstandard.sln";
Target "BuildVersion" (fun _ ->
Shell.Exec("appveyor", sprintf "UpdateBuild -Version \"%s\"" buildVersion) |> ignore
)
......@@ -95,7 +78,7 @@ Target "BuildVersion" (fun _ ->
Target "Build.NetFx" (fun _ ->
!! (project + ".sln")
!! "FSharp.Compiler.Service.sln"
|> MSBuild "" "Build" ["Configuration","Release" ]
|> Log (".NETFxBuild-Output: ")
)
......@@ -116,9 +99,9 @@ Target "Test.NetFx" (fun _ ->
// --------------------------------------------------------------------------------------
// Build a NuGet package
Target "NuGet.NetFx" (fun _ ->
run false @"..\.nuget\nuget.exe" @"pack nuget\FSharp.Compiler.Service.nuspec -OutputDirectory %s" releaseDir
run false @"..\.nuget\nuget.exe" @"pack nuget\FSharp.Compiler.Service.MSBuild.v12.nuspec -OutputDirectory %s" releaseDir
run false @"..\.nuget\nuget.exe" @"pack nuget\FSharp.Compiler.Service.ProjectCracker.nuspec -OutputDirectory %s" releaseDir
runCmdIn __SOURCE_DIRECTORY__ @"..\.nuget\NuGet.exe" @"pack nuget\FSharp.Compiler.Service.nuspec -OutputDirectory %s" releaseDir
runCmdIn __SOURCE_DIRECTORY__ @"..\.nuget\NuGet.exe" @"pack nuget\FSharp.Compiler.Service.MSBuild.v12.nuspec -OutputDirectory %s" releaseDir
runCmdIn __SOURCE_DIRECTORY__ @"..\.nuget\NuGet.exe" @"pack nuget\FSharp.Compiler.Service.ProjectCracker.nuspec -OutputDirectory %s" releaseDir
)
......@@ -140,28 +123,27 @@ let isDotnetSDKInstalled =
Target "Build.NetStd" (fun _ ->
run false "dotnet" "pack %s -v n -c Release" netstdsln
runCmdIn __SOURCE_DIRECTORY__ "dotnet" "pack %s -v n -c Release" "FSharp.Compiler.Service.netstandard.sln"
)
Target "Test.NetStd" (fun _ ->
run false "dotnet" "run -p FSharp.Compiler.Service.Tests.netcore/FSharp.Compiler.Service.Tests.netcore.fsproj -c Release -- --result:TestResults.NetStd.xml;format=nunit3"
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"
)
//use dotnet-mergenupkg to merge the .NETstandard nuget package into the default one
Target "Nuget.AddNetStd" (fun _ ->
do
let nupkg = sprintf "%s/FSharp.Compiler.Service.%s.nupkg" releaseDir release.AssemblyVersion
let netcoreNupkg = sprintf "FSharp.Compiler.Service.netstandard/bin/Release/FSharp.Compiler.Service.%s.nupkg" release.AssemblyVersion
runCmdIn false "." "dotnet" "mergenupkg --source %s --other %s --framework netstandard1.6" nupkg netcoreNupkg
let nupkg = sprintf "%s/FSharp.Compiler.Service.%s.nupkg" releaseDir release.AssemblyVersion
let netcoreNupkg = sprintf "FSharp.Compiler.Service.netstandard/bin/Release/FSharp.Compiler.Service.%s.nupkg" release.AssemblyVersion
runCmdIn __SOURCE_DIRECTORY__ "dotnet" "mergenupkg --source %s --other %s --framework netstandard1.6" nupkg netcoreNupkg
)
// --------------------------------------------------------------------------------------
// Generate the documentation
Target "GenerateDocs" (fun _ ->
Target "GenerateDocsEn" (fun _ ->
executeFSIWithArgs "docsrc/tools" "generate.fsx" ["--define:RELEASE"] [] |> ignore
)
......@@ -187,10 +169,11 @@ Target "PublishNuGet" (fun _ ->
// Run all targets by default. Invoke 'build <Target>' to override
Target "Clean" DoNothing
Target "CleanDocs" DoNothing
Target "Release" DoNothing
Target "NuGet" DoNothing
Target "Build" DoNothing
Target "GenerateDocs" DoNothing
Target "TestAndNuGet" DoNothing
"Clean"
=?> ("BuildVersion", isAppVeyorBuild)
......@@ -218,14 +201,29 @@ Target "Build" DoNothing
=?> ("Nuget.AddNetStd", isDotnetSDKInstalled)
==> "NuGet"
"Test.NetFx"
==> "TestAndNuGet"
"NuGet"
==> "TestAndNuGet"
//"Test.NetStd"
// ==> "TestAndNuGet"
"Build"
==> "NuGet"
==> "PublishNuGet"
==> "Release"
"CleanDocs"
"Build"
==> "GenerateDocsEn"
==> "GenerateDocs"
"Build"
==> "GenerateDocsJa"
==> "GenerateDocs"
"GenerateDocs"
==> "Release"
RunTargetOrDefault "Build"
......@@ -2,25 +2,19 @@
if test "$OS" = "Windows_NT"
then
# use .Net
.paket/paket.bootstrapper.exe
exit_code=$?
if [ $exit_code -ne 0 ]; then
exit $exit_code
fi
cmd fcs/build.cmd $@
else
mono .nuget/NuGet.exe restore -PackagesDirectory packages
.paket/paket.exe restore
exit_code=$?
if [ $exit_code -ne 0 ]; then
exit $exit_code
fi
cd fcs
packages/FAKE/tools/FAKE.exe build.fsx $@
else
# use mono
if [[ ! -e ~/.config/.mono/certs ]]; then
mozroots --import --sync --quiet
fi
dotnet restore tools.fsproj
mono .paket/paket.bootstrapper.exe
exit_code=$?
if [ $exit_code -ne 0 ]; then
......
......@@ -34,7 +34,7 @@ let root = "."
// Paths with template/source/output locations
let bin = __SOURCE_DIRECTORY__ @@ "../../../Release/fcs/net45"
let content = __SOURCE_DIRECTORY__ @@ "../content"
let output = __SOURCE_DIRECTORY__ @@ "../../docs"
let output = __SOURCE_DIRECTORY__ @@ "../../../docs"
let files = __SOURCE_DIRECTORY__ @@ "../files"
let templates = __SOURCE_DIRECTORY__ @@ "templates"
let formatting = __SOURCE_DIRECTORY__ @@ "../../packages/FSharp.Formatting/"
......@@ -52,6 +52,9 @@ let copyFiles () =
CopyRecursive (formatting @@ "styles") (output @@ "content") true
|> Log "Copying styles and scripts: "
let clr = System.Runtime.InteropServices.RuntimeEnvironment.GetRuntimeDirectory()
let fsfmt = __SOURCE_DIRECTORY__ @@ ".." @@ ".." @@ @"packages" @@ "FSharp.Formatting" @@ "lib" @@ "net40"
// Build API reference from XML comments
let buildReference () =
CleanDir (output @@ "reference")
......@@ -60,7 +63,24 @@ let buildReference () =
( bin @@ lib, output @@ "reference", layoutRoots,
parameters = ("root", root)::info,
sourceRepo = "https://github.com/fsharp/FSharp.Compiler.Service/tree/master/src",
sourceFolder = @"..\..\..\src" )
sourceFolder = @"..\..\..\src",
assemblyReferences =
[clr @@ "System.Runtime.dll"
clr @@ "System.dll"
clr @@ "System.Core.dll"
clr @@ "Microsoft.CSharp.dll"
clr @@ "System.Linq.dll"
clr @@ "System.dll"
bin @@ "System.Reflection.Metadata.dll"
clr @@ "System.Numerics.dll"
bin @@ "System.Collections.Immutable.dll"
clr @@ "System.IO.dll"
clr @@ "mscorlib.dll"
fsfmt @@ "FSharp.MetadataFormat.dll"
fsfmt @@ "RazorEngine.dll"
bin @@ "FSharp.Core.dll"
bin @@ "FSharp.Compiler.Service.dll"
] )
// Build documentation from `fsx` and `md` files in `docsrc/content`
let buildDocumentation () =
......@@ -73,6 +93,6 @@ let buildDocumentation () =
// Generate
copyFiles()
//buildDocumentation()
buildDocumentation()
buildReference()
......@@ -3,8 +3,6 @@
// (the generated documentation is stored in the 'docs' directory)
// --------------------------------------------------------------------------------------
// Binaries that have XML documentation (in a corresponding generated XML file)
let referenceBinaries = [ "FSharp.Compiler.Service.dll" ]
// Web site location for the generated documentation
let website = "/FSharp.Compiler.Service/ja"
......@@ -49,20 +47,16 @@ let root = "file://" + (__SOURCE_DIRECTORY__ @@ "../output/ja")
// Paths with template/source/output locations
let bin = __SOURCE_DIRECTORY__ @@ "../../../Release/fcs/net45"
let content = __SOURCE_DIRECTORY__ @@ "../content/ja"
let output = __SOURCE_DIRECTORY__ @@ "../../docs"
let outputJa = __SOURCE_DIRECTORY__ @@ "../../docs/ja"
let outputJa = __SOURCE_DIRECTORY__ @@ "../../../docs/ja"
let files = __SOURCE_DIRECTORY__ @@ "../files"
let templates = __SOURCE_DIRECTORY__ @@ "templates/ja"
let reference = __SOURCE_DIRECTORY__ @@ "reference"
let formatting = __SOURCE_DIRECTORY__ @@ "../../packages/FSharp.Formatting/"
let docTemplate = formatting @@ "templates/docpage.cshtml"
// Where to look for *.csproj templates (in this order)
let layoutRoots =
[ templates
reference
formatting @@ "templates"
formatting @@ "templates/reference" ]
formatting @@ "templates"]
// Copy static files and CSS + JS from F# Formatting
// Build documentation from `fsx` and `md` files in `docsrc/content`
......
......@@ -3,7 +3,7 @@
<Project ToolsVersion="4.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup>
<VersionPrefix>14.0.1</VersionPrefix>
<VersionPrefix>14.0.2</VersionPrefix>
<!-- FSharp.Compiler.Tools is currently only used to get a working FSI.EXE to execute some scripts during the build -->
<!-- The LKG FSI.EXE requires MSBuild 15 to be installed, which is painful -->
<FsiToolPath>$(FSharpSourcesRoot)\..\packages\FSharp.Compiler.Tools.4.1.23\tools</FsiToolPath>
......
......@@ -8,7 +8,7 @@
</description>
<language>en-US</language>
<requireLicenseAcceptance>false</requireLicenseAcceptance>
<version>14.0.1</version>
<version>14.0.2</version>
<authors>Microsoft Corporation and F# community contributors</authors>
<licenseUrl>https://github.com/fsharp/FSharp.Compiler.Service/blob/master/LICENSE</licenseUrl>
<projectUrl>https://github.com/fsharp/FSharp.Compiler.Service</projectUrl>
......
......@@ -10,7 +10,7 @@
</description>
<language>en-US</language>
<requireLicenseAcceptance>false</requireLicenseAcceptance>
<version>14.0.1</version>
<version>14.0.2</version>
<authors>Microsoft Corporation and F# community contributors</authors>
<licenseUrl>https://github.com/fsharp/FSharp.Compiler.Service/blob/master/LICENSE</licenseUrl>
<projectUrl>https://github.com/fsharp/FSharp.Compiler.Service</projectUrl>
......
......@@ -10,7 +10,7 @@
</description>
<language>en-US</language>
<requireLicenseAcceptance>false</requireLicenseAcceptance>
<version>14.0.1</version>
<version>14.0.2</version>
<authors>Microsoft Corporation and F# community contributors</authors>
<licenseUrl>https://github.com/fsharp/FSharp.Compiler.Service/blob/master/LICENSE</licenseUrl>
<projectUrl>https://github.com/fsharp/FSharp.Compiler.Service</projectUrl>
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册