Open
Description
This ticket is for implementing a basic F# source generator scheme for WebSharper inside wsfsc.exe
. The idea is simple: if the file list to be compiled includes non-F# files f_1
... f_n
, we perform the following steps before compilation:
For each filename f_i
with file extension ext_i
:
- We attempt to locate a source generator function
GEN
, from the first assemblyA
filtered from the list of assemblies passed on the command line, whereA
contains a new WebSharper assembly-level attribute, say,[<WebSharper.FSharpSourceGenerator("{ext}">]
, marking the assembly to contain a source generator for a given{ext}
file extension. - We call
GEN
onf_i
to obtain a list of generated filenamesfg_1
...fg_m
. - We replace
f_i
withfg_1
...fg_m
in the file list to be compiled.
Once all f_i
s are processed, we compute a new list of non-F# files from the updated input file list and repeat the above process (caching the ext->A mapping) until there are no more non-F# files to be compiled.
At this point, we resume normal compilation with the final source file list and all other command line arguments.