* Add documentation about XLF localization and updating resx

* Clean up doc a little bit, and make some changes suggested by markdownlint

* Grammar

* Change wording

* Fix formatting mistake

* Fix another typo
This commit is contained in:
John Wostenberg 2018-03-13 06:55:56 -05:00 коммит произвёл Don Syme
Родитель ac9f2af432
Коммит a4927e182d
1 изменённых файлов: 32 добавлений и 24 удалений

Просмотреть файл

@ -2,21 +2,23 @@
Follow the instructions below to build and develop the F# Compiler, Core Library and tools on Windows, macOS and Linux.
* [Developing the F# Compiler (Windows)](#developing-the-f-compiler-windows)
* [Developing the F# Compiler (Linux)](#developing-the-f-compiler-linux)
* [Developing the F# Compiler (macOS)](#developing-the-f-compiler-macos)
* [Developing the Visual F# IDE Tools (Windows Only)](#developing-the-visual-f-ide-tools-windows-only)
* [Notes and Resources](#notes)
- [Developing the F# Compiler (Windows)](#developing-the-f-compiler-windows)
- [Developing the F# Compiler (Linux)](#developing-the-f-compiler-linux)
- [Developing the F# Compiler (macOS)](#developing-the-f-compiler-macos)
- [Developing the Visual F# IDE Tools (Windows Only)](#developing-the-visual-f-ide-tools-windows-only)
- [Notes and Resources](#notes)
### Developing the F# Compiler (Windows)
### Developing the F# Compiler (Windows)
Install
- [.NET 4.6](https://www.microsoft.com/en-gb/download/details.aspx?id=48130)
**NOTE on Windows:**
1. It is recommended to run the build.cmd and the qualifiers be on a command prompt with path set to have the location of MSBuild. If you have Visual Studio, we can also run using `Developer Command Prompt for Visual Studio 20xx` (depends on Visual Studio version). This developer command prompt is easier to use than normal command prompt, because it already has the correct path of Visual Studio and .NET's tooling set for us to use (including MSBuild).
2. The running command prompt must be run under Administrator right (`Run as Administrator`).
1. It is recommended to run `build.cmd` in a command prompt with path set to have the location of MSBuild. If you have Visual Studio, we can run using `Developer Command Prompt for Visual Studio 20xx` (depends on Visual Studio version). This developer command prompt is easier to use than normal command prompt, because it already has the correct path of Visual Studio and .NET's tooling set for us to use (including MSBuild).
2. The command prompt must have Administrator rights (`Run as Administrator`).
Before running the build scripts, ensure that you have cleaned up the visualfsharp repo by running this git command:
@ -59,18 +61,18 @@ After you build the first time you can open and use this solution:
or just build it directly:
msbuild FSharp.sln
msbuild FSharp.sln
If you are just developing the core compiler and library then building ``FSharp.sln`` will be enough.
### Developing the F# Compiler (Linux)
### Developing the F# Compiler (Linux)
For Linux/Mono, follow [these instructions](http://www.mono-project.com/docs/getting-started/install/linux/). Also you may need:
sudo apt-get install mono-complete make git
Then:
make
Then to replace your machine-wide installation:
@ -79,7 +81,7 @@ Then to replace your machine-wide installation:
Full testing is not yet enabled on Linux.
### Developing the F# Compiler (macOS)
### Developing the F# Compiler (macOS)
Install XCode command line tools (or homebrew equivalents) and Mono or Visual Studio for Mac.
@ -99,25 +101,25 @@ You can specify a custom installation path using the DESTDIR shell variable
DESTDIR=/my/path/to/fsharp make install
### Developing the F# Compiler (Linux or macOS - .NET Core)
### Developing the F# Compiler (Linux or macOS - .NET Core)
Install [the latest .NET SDK](https://www.microsoft.com/net/download/). Then use
src/buildfromsource.sh
src/buildfromsource.sh
Outputs are placed in
Outputs are placed in
BuildFromSource/Debug/...
BuildFromSource/Release/...
This uses an installed .NET SDK 2.0 to build the various duplicated project
Testing the .NET Core version of the F# compiler on macOS and Linux is TBD.
This uses an installed .NET SDK 2.0 to build the various duplicated project
Testing the .NET Core version of the F# compiler on macOS and Linux is TBD.
### Developing the Visual F# IDE Tools (Windows Only)
To build and test Visual F# IDE Tools, install these requirements:
- [Visual Studio 2017](https://www.visualstudio.com/downloads/)
- Under the "Windows" workloads, select ".NET desktop development"
- Select "F# desktop language support" under the optional components
@ -131,16 +133,16 @@ Steps to build:
Use ``VisualFSharp.sln`` if you're building the Visual F# IDE Tools.
Note on Debug vs Release: ``Release`` Configuration has a degraded debugging experience, so if you want to test a change locally, it is recommended to do it in the ``Debug`` configuration. For more information see https://github.com/Microsoft/visualfsharp/issues/2771 and https://github.com/Microsoft/visualfsharp/pull/2773.
Note on Debug vs Release: ``Release`` Configuration has a degraded debugging experience, so if you want to test a change locally, it is recommended to do it in the ``Debug`` configuration. For more information see issues [#2771](https://github.com/Microsoft/visualfsharp/issues/2771) and [#2773](https://github.com/Microsoft/visualfsharp/pull/2773).
Note: if you face this error [#2351](https://github.com/Microsoft/visualfsharp/issues/2351):
Note ([#2351](https://github.com/Microsoft/visualfsharp/issues/2351)): if you face this error:
> error VSSDK1077: Unable to locate the extensions directory. "ExternalSettingsManager::GetScopePaths failed to initialize PkgDefManager for C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\Common7\IDE\devenv.exe".
> error VSSDK1077: Unable to locate the extensions directory. "ExternalSettingsManager::GetScopePaths failed to initialize PkgDefManager for C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\Common7\IDE\devenv.exe".
Or hard crash on launch ("Unknown Error"), delete these folders:
* `%localappdata%\Microsoft\VisualStudio\15.0_(some number here)RoslynDev`
* `%localappdata%\Microsoft\VisualStudio\15.0_(some number here)`
- `%localappdata%\Microsoft\VisualStudio\15.0_(some number here)RoslynDev`
- `%localappdata%\Microsoft\VisualStudio\15.0_(some number here)`
#### [Optional] Install the Visual F# IDE Tools (Windows Only)
@ -183,7 +185,7 @@ This gives a much tighter inner development loop than uninstalling/reinstalling
#### [Optional] Clobber the F# SDK on the machine
**Note:** The step below will try to clobber the machine-wide installed F# SDK on your machine. This replaces the ``fsc.exe`` used by the standard install location or ``Microsoft.FSharp.Targets``. **Repairing Visual Studio 15 is currently the only way to revert this step.**
**Note:*- The step below will try to clobber the machine-wide installed F# SDK on your machine. This replaces the ``fsc.exe`` used by the standard install location or ``Microsoft.FSharp.Targets``. **Repairing Visual Studio 15 is currently the only way to revert this step.**
For **Debug**:
@ -230,6 +232,12 @@ If you are behind a proxy server, NuGet client tool must be configured to use it
Where you should set proper proxy address, user name and password.
#### When modifying, adding, or removing keywords or compiler messages
If your changes involve modifying the list of language keywords in any way, (e.g. when implementing a new keyword), the XLF localization files need to be synced with the corresponding resx files. This can be done automatically by running `msbuild FSharp.Compiler.Private.fsproj /t:UpdateXlf` (located in [src\fsharp\FSharp.Compiler.Private](https://github.com/Microsoft/visualfsharp/tree/master/src/fsharp/FSharp.Compiler.Private)). This only works on Windows/.NETStandard framework, so changing this from any other platform requires editing and syncing all of the XLF files manually.
After this, you must copy any differing `resx` files from the output directory into the corresponding subdirectory in [src\buildfromsource](https://github.com/Microsoft/visualfsharp/tree/master/src/fsharp/FSharp.Compiler.Private). This step will soon be eliminated (see issue [#3905](https://github.com/Microsoft/visualfsharp/issues/3905)).
#### Resources
The primary technical guide to the core compiler code is [The F# Compiler Technical Guide](http://fsharp.github.io/2015/09/29/fsharp-compiler-guide.html). Please read and contribute to that guide.