Skip to content

Commit

Permalink
Update DEVGUIDE with using custom FSharp.Core (dotnet#16781)
Browse files Browse the repository at this point in the history
Co-authored-by: rb <[email protected]>
  • Loading branch information
rbauduin and rb authored Feb 28, 2024
1 parent ecce0b6 commit 5087d7a
Showing 1 changed file with 20 additions and 1 deletion.
21 changes: 20 additions & 1 deletion DEVGUIDE.md
Original file line number Diff line number Diff line change
Expand Up @@ -130,7 +130,7 @@ Once the "proto" compiler is built, it won't be built again, so you may want to

## Using your custom compiler to build other projects

Building the compiler using `build.cmd` or `build.sh` will output artifacts in `artifacts\bin`.
Building the compiler using `build.cmd` or `build.sh` will output artifacts in `artifacts\bin`.

To use your custom build of `Fsc`, add the `DotnetFscCompilerPath` property to your project's `.fsproj` file, adjusted to point at your local build directory, build configuration, and target framework as appropriate:

Expand All @@ -140,6 +140,25 @@ To use your custom build of `Fsc`, add the `DotnetFscCompilerPath` property to y
</PropertyGroup>
```

### Changes in FSharp.Core

The FSharp compiler uses an implicit FSharp.Core. This means that if you introduce changes to FSharp.Core and want to use it in a project, you need to disable the implicit version used by the compiler, and add a reference to your custom FSharp.Core dll. Both are done in the `.fsproj` file of your project.

Disabling the implicit FSharp.Core is done with
```
<PropertyGroup>
<DisableImplicitFSharpCoreReference>true</DisableImplicitFSharpCoreReference>
</PropertyGroup>
```
and referencing your custom FSharp.Core, available after you build the compiler, is done with
```
<ItemGroup>
<Reference Include="FSharp.Core">
<HintPath>D:\Git\fsharp\artifacts\bin\FSharp.Core\Debug\netstandard2.1\FSharp.Core.dll<\HintPath>
</Reference>
</ItemGroup>
```

## Updating FSComp.fs, FSComp.resx and XLF

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
Expand Down

0 comments on commit 5087d7a

Please sign in to comment.