Skip to content

Commit

Permalink
fsxc: print fs autogenerated file (debug)
Browse files Browse the repository at this point in the history
To be reverted temporarily, this commit just prints
the F# autogenerated sources for debugging purposes.
  • Loading branch information
knocte committed Sep 5, 2024
1 parent 7b40614 commit 0c2150c
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 4 deletions.
20 changes: 17 additions & 3 deletions fsxc/Fsxc.fs
Original file line number Diff line number Diff line change
Expand Up @@ -477,7 +477,7 @@ module Program =
let preprocessScriptContents
(origScript: FileInfo)
(contents: List<LineAction>)
: List<CompilerInput> =
: List<CompilerInput> * FileInfo =

#if LEGACY_FRAMEWORK
// from "Microsoft.Build", "16.11.0" to .../packages/Microsoft.Build.16.11.0/lib/net472/Microsoft.Build.dll
Expand Down Expand Up @@ -718,7 +718,8 @@ let fsi = { CommandLineArgs = System.Environment.GetCommandLineArgs() }
}
)
}
|> List.ofSeq
|> List.ofSeq,
autogeneratedFile

#if LEGACY_FRAMEWORK
let getSourceFiles(flags: seq<CompilerInput>) : seq<FileInfo> =
Expand Down Expand Up @@ -849,7 +850,18 @@ let fsi = { CommandLineArgs = System.Environment.GetCommandLineArgs() }
Console.WriteLine(sprintf "Building %s" script.FullName)

let binFolder = GetBinFolderForAScript script
let compilerInputs = preprocessScriptContents script contents

let compilerInputs, autoGenFile =
preprocessScriptContents script contents

Console.WriteLine(
"_________________START AUTOGEN FILE_________________"
)

for line in File.ReadAllLines(autoGenFile.FullName) do
Console.WriteLine line

Console.WriteLine("_________________END AUTOGEN FILE_________________")
#if !LEGACY_FRAMEWORK
let projectFile = generateProjectFile script contents
#endif
Expand Down Expand Up @@ -914,6 +926,8 @@ let fsi = { CommandLineArgs = System.Environment.GetCommandLineArgs() }
| _ -> "fsharpc"
#endif

Console.WriteLine(">>>>>>>>>>>>>>>COMPFLAGS: " + fscompilerflags)

let proc =
Process.Execute(
{
Expand Down
3 changes: 2 additions & 1 deletion scripts/runTests.fsx
Original file line number Diff line number Diff line change
Expand Up @@ -347,11 +347,12 @@ let dotnetFsiCmd =
Process.Execute(dotnetFsiCmd, Echo.All) |> UnwrapDefault
#endif

(*
let processTest = Path.Combine(TestDir.FullName, "testProcess.fsx") |> FileInfo
Process.Execute(CreateCommand(processTest, String.Empty), Echo.All)
|> UnwrapDefault

*)

(* this is actually only really useful for when process spits both stdout & stderr
let processConcurrencyTest = Path.Combine(TestDir.FullName, "testProcessConcurrency.fsx") |> FileInfo
Expand Down

0 comments on commit 0c2150c

Please sign in to comment.