Fantom

 

class

compiler::CompilerInput

sys::Obj
  compiler::CompilerInput

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

baseDirSource

File? baseDir

Base directory of source tree - this directory is used to create the relative paths of the source and resource files in the pod zip.

dependsSource

Depend[] depends := Depend[,]

List of this pod's dependencies used for both the compiler checking and output in the pod's manifest.

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

indexSource

Str:Obj index := [Str:Obj][:]

Pod indexing name/value pairs. The index values can be a single Str or a Str[] if there are multiple values mapped to one key.

inputLocSource

Loc inputLoc := Loc("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

jsFilesSource

Uri[]? jsFiles

List of JavaScript files or directories containing JavaScript files to include in the JavaScript output. Uris are relative to baseDir. This field is used only in file mode.

logSource

CompilerLog log := CompilerLog.make

Log used for reporting compile status

metaSource

Str:Str meta := [Str:Str][:]

Pod meta-data name/value pairs

modeSource

CompilerInputMode? mode := null

This mode determines whether the source code is input from the file system or from an in-memory string.

nsSource

CNamespace ns := ReflectNamespace()

Namespace used to resolve dependency pods/types. Default implementation uses reflection of the compiler's VM.

outDirSource

File outDir := Env.cur().workDir() + `lib/fan/`

Output directory to write pod to, defaults to the current environment's working 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, write a pod zip file to disk, or generate JavaScript code.

podNameSource

Str? podName

Name of output pod - required in all modes.

resFilesSource

Uri[]? resFiles

List of resource files or directories containing resource files to include in the pod zip. Uris are relative to baseDir. This field is used only in file mode.

srcFilesSource

Uri[]? srcFiles

List of Fantom source files or directories containing Fantom source files to compile. Uris are relative to baseDir. This field is used only in file mode.

srcStrSource

Str? srcStr

Fantom source code to compile (str mode only)

srcStrLocSource

Loc? srcStrLoc

Location to use for SourceFile facet (str mode only)

summarySource

Str? summary

Summary description for pod

versionSource

Version? version

Version to include in ouput pod's manifest.