@@ -31,7 +31,7 @@ let dotnetExePath =
3131 if File.Exists( pathToCli) then
3232 pathToCli
3333 else
34- DotNetCli.InstallDotNetSDK " 2.2.105 "
34+ DotNetCli.InstallDotNetSDK " 2.2.108 "
3535
3636let runDotnet workingDir args =
3737 let result =
@@ -90,6 +90,10 @@ Target "BuildVersion" (fun _ ->
9090 Shell.Exec( " appveyor" , sprintf " UpdateBuild -Version \" %s \" " buildVersion) |> ignore
9191)
9292
93+ Target " BuildTools" ( fun _ ->
94+ runDotnet __ SOURCE_ DIRECTORY__ " build ../src/buildtools/buildtools.proj -v n -c Proto"
95+ )
96+
9397Target " Build" ( fun _ ->
9498 runDotnet __ SOURCE_ DIRECTORY__ " build ../src/buildtools/buildtools.proj -v n -c Proto"
9599 let fslexPath = __ SOURCE_ DIRECTORY__ + " /../artifacts/bin/fslex/Proto/netcoreapp2.1/fslex.dll"
@@ -110,6 +114,30 @@ Target "NuGet" (fun _ ->
110114 runDotnet __ SOURCE_ DIRECTORY__ " pack FSharp.Compiler.Service.sln -v n -c Release"
111115)
112116
117+ Target " CodeGen.Fable" ( fun _ ->
118+ let outDir = __ SOURCE_ DIRECTORY__ + " /fcs-fable/codegen/"
119+
120+ // build FCS codegen
121+ let fslexPath = __ SOURCE_ DIRECTORY__ + " /../artifacts/bin/fslex/Proto/netcoreapp2.1/fslex.dll"
122+ let fsyaccPath = __ SOURCE_ DIRECTORY__ + " /../artifacts/bin/fsyacc/Proto/netcoreapp2.1/fsyacc.dll"
123+ runDotnet outDir ( sprintf " build -v n /p:FsLexPath=%s /p:FsYaccPath=%s " fslexPath fsyaccPath)
124+
125+ // run FCS fssrgen (without .resx output, inlining it instead)
126+ runDotnet outDir " run -- ../../../src/fsharp/FSComp.txt FSComp.fs"
127+ runDotnet outDir " run -- ../../../src/fsharp/fsi/FSIstrings.txt FSIstrings.fs"
128+
129+ // Fable-specific (comment the #line directive as it is not supported)
130+ [ " lex.fs" ; " pplex.fs" ; " illex.fs" ; " ilpars.fs" ; " pars.fs" ; " pppars.fs" ]
131+ |> Seq.map ( fun fileName -> outDir + fileName)
132+ |> RegexReplaceInFilesWithEncoding @" (?<!/)# (?=\d)" " //# " Text.Encoding.UTF8
133+
134+ // // prevent stack overflows on large files (make lexer rules inline)
135+ // let pattern = @"(?<=and )(?!inline )([a-zA-Z]+ )+ *lexbuf "
136+ // ["lex.fs"; "pplex.fs"; "illex.fs"]
137+ // |> Seq.map (fun fileName -> outDir + fileName)
138+ // |> RegexReplaceInFilesWithEncoding pattern @"inline $0" Text.Encoding.UTF8
139+ )
140+
113141Target " GenerateDocsEn" ( fun _ ->
114142 executeFSIWithArgs " docsrc/tools" " generate.fsx" [] [] |> ignore
115143)
@@ -137,6 +165,10 @@ Target "Release" DoNothing
137165Target " GenerateDocs" DoNothing
138166Target " TestAndNuGet" DoNothing
139167
168+ " Clean"
169+ ==> " BuildTools"
170+ ==> " CodeGen.Fable"
171+
140172" Start"
141173 =?> ( " BuildVersion" , isAppVeyorBuild)
142174 ==> " Restore"
0 commit comments