Skip to content

Commit 0c3ab22

Browse files
KevinRansombaronfel
authored andcommitted
merge
2 parents 59c7318 + 69a2525 commit 0c3ab22

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

60 files changed

+837
-984
lines changed

FSharpBuild.Directory.Build.targets

Lines changed: 31 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
<Project>
2+
23
<Import Project="Sdk.targets" Sdk="Microsoft.DotNet.Arcade.Sdk" />
34
<Import Project="eng\targets\Imports.targets" />
45
<Import Project="eng\targets\NuGet.targets" />
@@ -8,28 +9,32 @@
89
<Target Name="NoneSubstituteTextFiles"
910
Inputs="@(NoneSubstituteText)"
1011
Outputs="@(NoneSubstituteText->'$(IntermediateOutputPath)%(Filename)%(Extension)')"
11-
BeforeTargets="AssignTargetPaths;BeforeBuild">
12+
BeforeTargets="AssignTargetPaths;BeforeBuild;GenerateFSharpTextResources">
1213

1314
<PropertyGroup>
1415
<__TargetFilePath>@(NoneSubstituteText->'$(IntermediateOutputPath)%(Filename)%(Extension)')</__TargetFilePath>
1516
<__TargetFileName>@(NoneSubstituteText->'%(Filename)%(Extension)')</__TargetFileName>
17+
<__TargetLink>@(NoneSubstituteText->'%(Link)')</__TargetLink>
1618

1719
<_ReplacementText>$([System.IO.File]::ReadAllText('%(NoneSubstituteText.FullPath)'))</_ReplacementText>
1820
<_ReplacementText Condition="'%(NoneSubstituteText.Pattern1)' != ''">$(_ReplacementText.Replace('%(NoneSubstituteText.Pattern1)', '%(NoneSubstituteText.Replacement1)'))</_ReplacementText>
1921
<_ReplacementText Condition="'%(NoneSubstituteText.Pattern2)' != ''">$(_ReplacementText.Replace('%(NoneSubstituteText.Pattern2)', '%(NoneSubstituteText.Replacement2)'))</_ReplacementText>
2022

2123
<_CopyToOutputDirectory Condition="'%(NoneSubstituteText.CopyToOutputDirectory)' != ''">%(NoneSubstituteText.CopyToOutputDirectory)</_CopyToOutputDirectory>
2224
<_CopyToOutputDirectory Condition="'%(NoneSubstituteText.CopyToOutputDirectory)' == ''">Never</_CopyToOutputDirectory>
25+
26+
<_IncludeInVsix>false</_IncludeInVsix>
27+
<_IncludeInVsix Condition="'%(NoneSubstituteText.IncludeInVsix)' == 'true'">true</_IncludeInVsix>
2328
</PropertyGroup>
2429

2530
<MakeDir Directories="$(IntermediateOutputPath)"
2631
Condition="!Exists('$(IntermediateOutputPath)')" />
2732
<WriteLinesToFile File="$(__TargetFilePath)" Lines="$(_ReplacementText)" Overwrite="true" WriteOnlyWhenDifferent="true" />
2833

29-
<!-- Make sure it will get cleaned -->
30-
<ItemGroup >
34+
<ItemGroup>
3135
<None Include="$(__TargetFilePath)" CopyToOutputDirectory="$(_CopyToOutputDirectory)" />
3236
<FileWrites Include="$(__TargetFilePath)" Condition="'$(__TargetFileName)' != 'App.config'" />
37+
<Content Include="$(__TargetFilePath)" CopyToOutputDirectory="Always" IncludeInVsix="true" Link="$(__TargetLink)" Condition="'$(_IncludeInVsix)'=='true'" />
3338
</ItemGroup>
3439
</Target>
3540

@@ -61,4 +66,27 @@
6166
</ItemGroup>
6267
</Target>
6368

69+
<Target Name="BeforeResGen"
70+
Inputs="@(EmbeddedResource->'$(IntermediateOutputPath)%(Filename)%(Extension)')"
71+
Outputs="@(EmbeddedResource->'$(IntermediateOutputPath)resources\%(Filename)%(Extension)')"
72+
DependsOnTargets="CopyVsixResources"
73+
Condition="'$(Configuration)' != 'Proto' and '$(Language)'=='F#' and '$(DisableCompilerRedirection)' != 'true' ">
74+
75+
<SubstituteText EmbeddedResources="@(EmbeddedResource)">
76+
<Output TaskParameter="CopiedFiles" ItemName="CopiedFiles" />
77+
</SubstituteText>
78+
79+
<ItemGroup>
80+
<EmbeddedResource Remove="@(EmbeddedResource)"/>
81+
<EmbeddedResource Include="@(CopiedFiles)"/>
82+
</ItemGroup>
83+
84+
<MakeDir Directories="$(IntermediateOutputPath)" Condition="!Exists('$(IntermediateOutputPath)')" />
85+
<MakeDir Directories="$(IntermediateOutputPath)resources\" Condition="!Exists('$(IntermediateOutputPath)resources\')" />
86+
</Target>
87+
88+
<Target Name="CopyVsixResources">
89+
<Copy SourceFiles="@(CopyVsixResources)" DestinationFolder="$(IntermediateOutputPath)\resources\Resources" />
90+
</Target>
91+
6492
</Project>

fcs/build.fsx

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -64,18 +64,18 @@ Target.create "BuildVersion" (fun _ ->
6464

6565
Target.create "Build" (fun _ ->
6666
runDotnet __SOURCE_DIRECTORY__ "build" "../src/buildtools/buildtools.proj -v n -c Proto"
67-
let fslexPath = __SOURCE_DIRECTORY__ + "/../artifacts/bin/fslex/Proto/netcoreapp3.0/fslex.dll"
68-
let fsyaccPath = __SOURCE_DIRECTORY__ + "/../artifacts/bin/fsyacc/Proto/netcoreapp3.0/fsyacc.dll"
69-
runDotnet __SOURCE_DIRECTORY__ "build" (sprintf "FSharp.Compiler.Service.sln -v n -c Release /p:FsLexPath=%s /p:FsYaccPath=%s" fslexPath fsyaccPath)
67+
let fslexPath = __SOURCE_DIRECTORY__ + "/../artifacts/bin/fslex/Proto/netcoreapp2.1/fslex.dll"
68+
let fsyaccPath = __SOURCE_DIRECTORY__ + "/../artifacts/bin/fsyacc/Proto/netcoreapp2.1/fsyacc.dll"
69+
runDotnet __SOURCE_DIRECTORY__ "build" (sprintf "FSharp.Compiler.Service.sln -nodereuse:false -v n -c Release /p:DisableCompilerRedirection=true /p:FsLexPath=%s /p:FsYaccPath=%s" fslexPath fsyaccPath)
7070
)
7171

7272
Target.create "Test" (fun _ ->
7373
// This project file is used for the netcoreapp2.0 tests to work out reference sets
74-
runDotnet __SOURCE_DIRECTORY__ "build" "../tests/projects/Sample_NETCoreSDK_FSharp_Library_netstandard2_0/Sample_NETCoreSDK_FSharp_Library_netstandard2_0.fsproj -v n /restore /p:DisableCompilerRedirection=true"
74+
runDotnet __SOURCE_DIRECTORY__ "build" "../tests/projects/Sample_NETCoreSDK_FSharp_Library_netstandard2_0/Sample_NETCoreSDK_FSharp_Library_netstandard2_0.fsproj -nodereuse:false -v n /restore /p:DisableCompilerRedirection=true"
7575

7676
// Now run the tests
7777
let logFilePath = Path.Combine(__SOURCE_DIRECTORY__, "..", "artifacts", "TestResults", "Release", "FSharp.Compiler.Service.Test.xml")
78-
runDotnet __SOURCE_DIRECTORY__ "test" (sprintf "FSharp.Compiler.Service.Tests/FSharp.Compiler.Service.Tests.fsproj --no-restore --no-build -v n -c Release --test-adapter-path . --logger \"nunit;LogFilePath=%s\"" logFilePath)
78+
runDotnet __SOURCE_DIRECTORY__ "test" (sprintf "FSharp.Compiler.Service.Tests/FSharp.Compiler.Service.Tests.fsproj --no-restore --no-build -nodereuse:false -v n -c Release --test-adapter-path . --logger \"nunit;LogFilePath=%s\"" logFilePath)
7979
)
8080

8181
Target.create "NuGet" (fun _ ->

src/absil/ilascii.fs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ open FSharp.Compiler.AbstractIL.IL
99

1010
// set to the proper value at CompileOps.fs (BuildFrameworkTcImports)
1111
// Only relevant when compiling FSharp.Core.dll
12-
let parseILGlobals = ref EcmaMscorlibILGlobals
12+
let mutable parseILGlobals = EcmaMscorlibILGlobals
1313

1414
/// Table of parsing and pretty printing data for instructions.
1515
let noArgInstrs =

src/absil/ilascii.fsi

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ open FSharp.Compiler.AbstractIL.IL
1414
// IL Parser state - must be initialized before parsing a module
1515
// --------------------------------------------------------------------
1616

17-
val parseILGlobals: ILGlobals ref
17+
val mutable parseILGlobals: ILGlobals
1818

1919
// --------------------------------------------------------------------
2020
// IL Lexer and pretty-printer tables

src/absil/ildiag.fs

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -5,18 +5,18 @@
55
module internal FSharp.Compiler.AbstractIL.Diagnostics
66

77

8-
let diagnosticsLog = ref (Some stdout)
8+
let mutable diagnosticsLog = Some stdout
99

10-
let setDiagnosticsChannel s = diagnosticsLog := s
10+
let setDiagnosticsChannel s = diagnosticsLog <- s
1111

12-
let dflushn () = match !diagnosticsLog with None -> () | Some d -> d.WriteLine(); d.Flush()
13-
let dflush () = match !diagnosticsLog with None -> () | Some d -> d.Flush()
12+
let dflushn () = match diagnosticsLog with None -> () | Some d -> d.WriteLine(); d.Flush()
13+
let dflush () = match diagnosticsLog with None -> () | Some d -> d.Flush()
1414
let dprintn (s:string) =
15-
match !diagnosticsLog with None -> () | Some d -> d.Write s; d.Write "\n"; dflush()
15+
match diagnosticsLog with None -> () | Some d -> d.Write s; d.Write "\n"; dflush()
1616

1717
let dprintf (fmt: Format<_,_,_,_>) =
18-
Printf.kfprintf dflush (match !diagnosticsLog with None -> System.IO.TextWriter.Null | Some d -> d) fmt
18+
Printf.kfprintf dflush (match diagnosticsLog with None -> System.IO.TextWriter.Null | Some d -> d) fmt
1919

2020
let dprintfn (fmt: Format<_,_,_,_>) =
21-
Printf.kfprintf dflushn (match !diagnosticsLog with None -> System.IO.TextWriter.Null | Some d -> d) fmt
21+
Printf.kfprintf dflushn (match diagnosticsLog with None -> System.IO.TextWriter.Null | Some d -> d) fmt
2222

src/absil/illib.fs

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -47,15 +47,15 @@ let LOH_SIZE_THRESHOLD_BYTES = 80_000
4747
// Library: ReportTime
4848
//---------------------------------------------------------------------
4949
let reportTime =
50-
let tFirst = ref None
51-
let tPrev = ref None
50+
let mutable tFirst =None
51+
let mutable tPrev = None
5252
fun showTimes descr ->
5353
if showTimes then
5454
let t = Process.GetCurrentProcess().UserProcessorTime.TotalSeconds
55-
let prev = match !tPrev with None -> 0.0 | Some t -> t
56-
let first = match !tFirst with None -> (tFirst := Some t; t) | Some t -> t
55+
let prev = match tPrev with None -> 0.0 | Some t -> t
56+
let first = match tFirst with None -> (tFirst <- Some t; t) | Some t -> t
5757
printf "ilwrite: TIME %10.3f (total) %10.3f (delta) - %s\n" (t - first) (t - prev) descr
58-
tPrev := Some t
58+
tPrev <- Some t
5959

6060
//-------------------------------------------------------------------------
6161
// Library: projections
@@ -573,10 +573,10 @@ module String =
573573
let getLines (str: string) =
574574
use reader = new StringReader(str)
575575
[|
576-
let line = ref (reader.ReadLine())
577-
while not (isNull !line) do
578-
yield !line
579-
line := reader.ReadLine()
576+
let mutable line = reader.ReadLine()
577+
while not (isNull line) do
578+
yield line
579+
line <- reader.ReadLine()
580580
if str.EndsWithOrdinal("\n") then
581581
// last trailing space not returned
582582
// http://stackoverflow.com/questions/19365404/stringreader-omits-trailing-linebreak

src/absil/ilpars.fsy

Lines changed: 22 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ let resolveCurrentMethodSpecScope obj =
3333

3434

3535
let findSystemRuntimeAssemblyRef() =
36-
match (!parseILGlobals).primaryAssemblyScopeRef with
36+
match parseILGlobals.primaryAssemblyScopeRef with
3737
| ILScopeRef.Assembly aref -> aref
3838
| _ -> pfailwith "systemRuntimeScopeRef not set to valid assembly reference in parseILGlobals"
3939

@@ -235,9 +235,9 @@ callKind:
235235
*---------------------------------------------*/
236236

237237
typ: STRING
238-
{ noMethodSpecScope (!parseILGlobals).typ_String }
238+
{ noMethodSpecScope parseILGlobals.typ_String }
239239
| OBJECT
240-
{ noMethodSpecScope (!parseILGlobals).typ_Object }
240+
{ noMethodSpecScope parseILGlobals.typ_Object }
241241
| CLASS typeNameInst
242242
{ resolveMethodSpecScopeThen $2 (fun tspec ->
243243
noMethodSpecScope (mkILBoxedType tspec)) }
@@ -256,45 +256,45 @@ typ: STRING
256256
| typ STAR
257257
{ resolveMethodSpecScopeThen $1 (fun ty -> noMethodSpecScope (ILType.Ptr ty)) }
258258
| CHAR
259-
{ noMethodSpecScope (!parseILGlobals).typ_Char }
259+
{ noMethodSpecScope parseILGlobals.typ_Char }
260260
| VOID
261261
{ noMethodSpecScope ILType.Void }
262262
| BOOL
263-
{ noMethodSpecScope (!parseILGlobals).typ_Bool }
263+
{ noMethodSpecScope parseILGlobals.typ_Bool }
264264
| INT8
265-
{ noMethodSpecScope (!parseILGlobals).typ_SByte }
265+
{ noMethodSpecScope parseILGlobals.typ_SByte }
266266
| INT16
267-
{ noMethodSpecScope (!parseILGlobals).typ_Int16 }
267+
{ noMethodSpecScope parseILGlobals.typ_Int16 }
268268
| INT32
269-
{ noMethodSpecScope (!parseILGlobals).typ_Int32 }
269+
{ noMethodSpecScope parseILGlobals.typ_Int32 }
270270
| INT64
271-
{ noMethodSpecScope (!parseILGlobals).typ_Int64 }
271+
{ noMethodSpecScope parseILGlobals.typ_Int64 }
272272
| FLOAT32
273-
{ noMethodSpecScope (!parseILGlobals).typ_Single }
273+
{ noMethodSpecScope parseILGlobals.typ_Single }
274274
| FLOAT64
275-
{ noMethodSpecScope (!parseILGlobals).typ_Double }
275+
{ noMethodSpecScope parseILGlobals.typ_Double }
276276
| UNSIGNED INT8
277-
{ noMethodSpecScope (!parseILGlobals).typ_Byte }
277+
{ noMethodSpecScope parseILGlobals.typ_Byte }
278278
| UNSIGNED INT16
279-
{ noMethodSpecScope (!parseILGlobals).typ_UInt16 }
279+
{ noMethodSpecScope parseILGlobals.typ_UInt16 }
280280
| UNSIGNED INT32
281-
{ noMethodSpecScope (!parseILGlobals).typ_UInt32 }
281+
{ noMethodSpecScope parseILGlobals.typ_UInt32 }
282282
| UNSIGNED INT64
283-
{ noMethodSpecScope (!parseILGlobals).typ_UInt64 }
283+
{ noMethodSpecScope parseILGlobals.typ_UInt64 }
284284
| UINT8
285-
{ noMethodSpecScope (!parseILGlobals).typ_Byte }
285+
{ noMethodSpecScope parseILGlobals.typ_Byte }
286286
| UINT16
287-
{ noMethodSpecScope (!parseILGlobals).typ_UInt16 }
287+
{ noMethodSpecScope parseILGlobals.typ_UInt16 }
288288
| UINT32
289-
{ noMethodSpecScope (!parseILGlobals).typ_UInt32 }
289+
{ noMethodSpecScope parseILGlobals.typ_UInt32 }
290290
| UINT64
291-
{ noMethodSpecScope (!parseILGlobals).typ_UInt64 }
291+
{ noMethodSpecScope parseILGlobals.typ_UInt64 }
292292
| NATIVE INT
293-
{ noMethodSpecScope (!parseILGlobals).typ_IntPtr }
293+
{ noMethodSpecScope parseILGlobals.typ_IntPtr }
294294
| NATIVE UNSIGNED INT
295-
{ noMethodSpecScope (!parseILGlobals).typ_UIntPtr }
295+
{ noMethodSpecScope parseILGlobals.typ_UIntPtr }
296296
| NATIVE UINT
297-
{ noMethodSpecScope (!parseILGlobals).typ_UIntPtr }
297+
{ noMethodSpecScope parseILGlobals.typ_UIntPtr }
298298

299299
| BANG int32
300300
{ noMethodSpecScope (ILType.TypeVar (uint16 ( $2))) }

src/buildtools/fslex/fslex.fsproj

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,6 @@
22

33
<PropertyGroup>
44
<OutputType>Exe</OutputType>
5-
<TargetFramework>netcoreapp3.0</TargetFramework>
6-
<TargetFramework>netcoreapp2.0</TargetFramework>
75
<TargetFramework>netcoreapp2.1</TargetFramework>
86
<DefineConstants>INTERNALIZED_FSLEXYACC_RUNTIME;$(DefineConstant)</DefineConstants>
97
<DisableImplicitFSharpCoreReference>true</DisableImplicitFSharpCoreReference>

src/buildtools/fsyacc/fsyacc.fsproj

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,6 @@
22

33
<PropertyGroup>
44
<OutputType>Exe</OutputType>
5-
<TargetFramework>netcoreapp3.0</TargetFramework>
6-
<TargetFramework>netcoreapp2.0</TargetFramework>
75
<TargetFramework>netcoreapp2.1</TargetFramework>
86
<DefineConstants>INTERNALIZED_FSLEXYACC_RUNTIME;$(DefineConstant)</DefineConstants>
97
<DisableImplicitFSharpCoreReference>true</DisableImplicitFSharpCoreReference>

0 commit comments

Comments
 (0)