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.
- baseDir
-
File? baseDirBase directory of source tree - this directory is used to create the relative paths of the source and resource files in the pod zip.
- coerceParameterizedCollectionTypes
-
Bool coerceParameterizedCollectionTypesGenerate a type cast coercion between collections with different parameterized types. For example normal Fantom we can use
Str[]whereObj[]it expected with no cast. But when transpiling Java, these must be explicitly cast. The compiler actually generates a proper parameterized type cast such asObj[], but in Java this isn't valid so we always just cast to the generic typeList. - depends
-
Depend[] depends := Depend[,]List of this pod's dependencies used for both the compiler checking and output in the pod's manifest.
- docTests
-
Bool docTests := falseIf set to true, then generate apidocs for test subclasses
- fcodeDump
-
Bool fcodeDump := falseIf set to true, then disassembled fcode is dumped to
log.out. - forceJs
-
Bool forceJs := falseFlag indicating if we should treat all types as having the @Js facet
- includeDoc
-
Bool includeDoc := falseInclude fandoc in output pod, default is false
- includeSrc
-
Bool includeSrc := falseInclude source code in output pod, default is false
- index
-
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.
- inputLoc
-
Loc inputLoc := Loc.<ctor>("CompilerInput")Location to use for reporting errors associated with the input itself - typically this is mapped to the build script.
- isScript
-
Bool isScript := falseFlag 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.
- isTest
-
Bool isTest := falseIs this compile process being run inside a test, default is false
- jsFiles
-
Uri[]? jsFilesList 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. - jsPropsFiles
-
Uri[]? jsPropsFilesList of files or directores containing
.propsfiles that should be compiled to JavaScript. If this field is null then it defaults toresFiles. Uris are relative tobaseDir. This field is used only in file mode. - jsReflectClosures
-
Bool jsReflectClosures := falseFlag to force Fantom closures to be compiled with type reflection information when emitting JavaScript.
- log
-
CompilerLog log := CompilerLog.makeLog used for reporting compile status
- meta
-
Pod meta-data name/value pairs
- mode
-
CompilerInputMode? mode := nullThis mode determines whether the source code is input from the file system or from an in-memory string.
- ns
-
CNamespace ns := ReflectNamespace.<ctor>()Namespace used to resolve dependency pods/types. Default implementation uses reflection of the compiler's VM.
- outDir
-
File outDir := Env.cur().workDir() + `lib/fan/`Output directory to write pod to, defaults to the current environment's working lib directory
- output
-
CompilerOutputMode? output := nullWhat 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.
- podName
-
Str? podNameName of output pod - required in all modes.
- resFiles
-
Uri[]? resFilesList 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. If a file has a "jar" extension then its contents are unzipped into the target pod. - srcFiles
-
Uri[]? srcFilesList 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. - srcStr
-
Str? srcStrFantom source code to compile (str mode only)
- srcStrLoc
-
Loc? srcStrLocLocation to use for SourceFile facet (str mode only)
- summary
-
Str? summarySummary description for pod
- version
-
Version? versionVersion to include in ouput pod's manifest.
- wrapperPerParameterizedCollectionType
-
Bool wrapperPerParameterizedCollectionTypeGenerate a unique wrapper type per parameterized List/Map. By default we generate one acme::Wrap$List class per pod for all List types. But when transpiling Java we need a different version per parameterized List/Map.