CompilerInput encapsulates all the input needed run the compiler. The compiler can be run in one of two modes - file or str. In file mode the source code and resource files are read from the file system. In str mode we compile a single source file from an in-memory string.
Slots
- dependsDirSource
-
File? dependsDir := null
The directory to look in for the dependency pod file (and potentially their recursive dependencies). If null then we use the compiler's own pod definitions via reflection (which is more efficient).
- fcodeDumpSource
-
Bool fcodeDump := false
If set to true, then disassembled fcode is dumped to
log.out
. - includeDocSource
-
Bool includeDoc := false
Include fandoc in output pod, default is false
- includeSrcSource
-
Bool includeSrc := false
Include source code in output pod, default is false
- inputLocSource
-
Location inputLoc := Location("CompilerInput")
Location to use for reporting errors associated with the input itself - typically this is mapped to the build script.
- isScriptSource
-
Bool isScript := false
Flag to indicate if we are are compiling a script. Scripts don't require explicit depends and can import any type via the using statement or with qualified type names.
- isTestSource
-
Bool isTest := false
Is this compile process being run inside a test, default is false
- logSource
-
CompilerLog log := CompilerLog.make
Log used for reporting compile status
- modeSource
-
CompilerInputMode? mode := null
This mode determines whether the source code is input from the file system or from an in-memory string.
- outDirSource
-
File outDir := Repo.working().home() + `lib/fan/`
Output directory to write pod to, defaults to the current working repo's lib directory
- outputSource
-
CompilerOutputMode? output := null
What type of output should be generated - the compiler can be used to generate a transient in-memory pod or to write out a pod zip file to disk.
- podDefSource
-
File? podDef
Location of "pod.fan" which defines the pod meta-data needed to compile the pod from source.
- podNameSource
-
Str? podName
Name of output pod - required for scripts and str mode. For pods this is defined via podDef location of "pod.fan".
- srcStrSource
-
Str? srcStr
Fan source code to compile (str mode only)
- srcStrLocationSource
-
Location? srcStrLocation
Location to use for SourceFile facet (str mode only)
-
internal Void validate()
Validate the CompilerInput is correctly configured, throw CompilerErr is not.
-
private Void validateReqField(Str field)
Check that the specified field is non-null, if not then log an error and return false.
- versionSource
-
Version? version
Version to include in ouput pod's manifest.