So you've written this awesome program for Fantom; it generates words for Scrabble - does double word scores and everything! But how do you share it with your mate? The answer is pods!

Fantom projects package themselves up in .zip files called Pods, similar to Java .jar files. Pod files have a .pod extension and live in %FAN_HOME%\lib\fan\ or in my case, C:\Apps\fantom-1.0.65\lib\fan\

If you have a peek in that folder you will see sys.pod, compiler.pod, fwt.pod and all the other standard libraries distributed with Fantom. The APIs of these pods are documented on the Fantom site under APIs. Whenever you run a Fantom command, that does not specify a script file, such as:

C:\> fan flux

the command runs code from pods in %FAN_HOME%.

Therefore, to share your cool Fantom program:

  • package your program into a pod
  • give it your mate
  • get your mate to stick it in their %FAN_HOME%\lib\fan\ dir

Great, so how do you build a pod? Well, from your project directory, run

C:\> fan build.fan

This runs your build.fan script file which, by default, builds a pod a sticks it in your FAN_HOME directory. Example output:

compile [afAwesome]
   Compile [afAwesome]
     FindSourceFiles [75 files]
     WritePod [file:/C:/Apps/fantom-1.0.65/lib/fan/afAwesome.pod]
 BUILD SUCCESS [1174ms]!

For an in-depth discussion on the content of pods, see Inside a Fantom Pod.

For an in-depth on how to create one with build.fan see Inside a Fantom Pod Build.

Pod Repositories

You could email your mate the .pod file or stick it on a USB flash drive, but why would you when you can easily share it with the entire World!

Upload your pod to the Fantom-Factory Pod Repository and enjoy instant fame!

No Fantom? No Problem!

What if your mate doesn't have Fantom installed? Or doesn't want to install Fantom?

No worries, create a standalone .zip file that contains everything they need to run a Fantom program. Create Standalone Fantom Apps in Seconds! shows you how in 3 lines of code!



Discuss