Notice how the Build class extends BuildPod. It is this BuildPod that does all the heavy lifting for us, all we do is configure it. This is usually done in the ctor.

podName & summary

The podName and summary fields should be self explanatory. Note that podName can be letters only. The lack of punctuation makes namespacing a little limiting. Alien-Factory has gone with the convention of camel casing the project name and giving it an af prefix. for example, Bed Sheet becomes afBedSheet See the Global Pod Naming discussion for more detail.

version

version is optional (surprisingly!) and if omitted, defaults to the current Fantom version (currently 1.0.66). The Version object may have up to 4 segments; major, minor, build, patch, which are important when working out transitive dependencies.

meta

The above values, and other information as detailed in Pods, end up in meta.props by default. We can add more meta data to our pod (all of which is accessible via Pod.meta()) by specifying it in the meta map.

Some pod meta keys such as org.name and org.uri have been standardised (see Pods for details) while others are project dependant.

index

All the values in index end up in index.props. Index properties aren't used that much so don't worry if your pod does not define any.

depends

depends is a Str list of all the pods (and acceptable versions) that your project, um, depends on! Remember that each Str needs the pod name AND a version to be valid. See Depend for details on the syntax.

srcDirs

srcDirs is a list of fantom uri literals meaning you need to surround them in back-ticks, and not double quotes or apostrophes.

Each directory should end with a / (See File.make() for the reason why.)

Nested directories are NOT included. Meaning if you have source code in both fan/ and fan/internal/ BOTH directories need to be listed.

With regards to the pod, all compiled sources end up in the focde/ directory.

If using the F4 IDE by Xored note that srcDirs is managed for you. All source folder changes in the IDE automatically update the srcDirs value.

resDirs

resDirs specify extra resource folders to include in the pod. Note that the first entry is doc/, which is how pod.metadata file ends up in the pod.

By convention, other resources are placed inside a top level res/ directory.

All syntax rules that apply to srcDirs also apply to resDirs.

docApi

Should docApi be set to true then api documentation is compiled from the source code and placed in the pod's doc/ directory.

docSrc

Should docSrc be set to true then the fantom source files from ALL the source directories are lumped together into the one pod src/.

Extra Code

Because build.fan is a script, you can run other code in the ctor should you wish! As you can see, the BedSheetbuild.fan strips out any test/ src and res directories.

Test code is bundled into pods by default, and in the case of Alien-Factory libraries, this amounts to quite a lot! So to reduce the size of the compiled pod, and to prevent meaningless classes appearing in IDE auto completes, they are removed before a release. These lines are normally commented out during development.