Skip to end of metadata
Go to start of metadata

What is Neptune?

Neptune is a build tool based on the command design pattern. Different command objects are combined to do sophisticated task. The scope of Neptune is similar to that of Apache Ant. In fact, the current implementation of Neptune delegates to Ant to do most atomic tasks.

How is Neptune different than Ant?

  • The core of Neptune is very small. It does not demand the use of xml or any scripting language. One can always just call the core api from within Java. This makes Neptune easier to be embedded.
  • The Command interface of Neptune is a simple interface, while Ant Task is a class that you have to "extend".
  • The Command interface has a return value which can be used by other Command objects. Communication between Command objects is easier this way compared to the Ant way of writing and reading string value of system properties.
  • Exceptions can be handled programatically in Neptune build script if needed.
  • Simple Command objects can be combined to become more complex Command object. Different Command objects can communicate with each other.
  • In order to fully utilize the flexibility of Command interface, a scripting language capable of monadic combinators is typically better to use than xml. So currently the Jaskell scripting language is used to provide Neptune configuration and shell support. Note, this doesn't mean xml or other scripting languages can't be used to wrap around Neptune.
  • Jaskell as the current shell of Neptune, is a functional scripting language. This means that code reuse is easier than the ant xml configuration. Most copy-paste in Ant can be avoided.
  • The jaskell neptune shell is interactive, which makes it easier to experiment a Neptune Command or an Ant Task. It can even be used as an enhanced operating system shell to perform many tasks using Neptune or Ant.
  • Xml as a universal language, has many nice tools already built around it. So using jaskell as the configuration language also means that we cannot use the xml tools to help or visualize the configuration. That's the price to be paid if using Jaksell as the configuration language.

Command or Task?

As flexible and easy as Neptune Command is, there's one drawback you'd better be aware when writing your own Command implementation:

A class that implements Command only works in Neptune. While a class that extends Ant Task works in both Neptune and Ant.

So if compatibility with Ant is a concern, stick to Ant Task so that your Task can be used in both Neptune and Ant.

When do I write Command?

In case you want to return an object from the command execution, or if you need to accept some data from the execution engine but the data type is not defined by Ant, you can implement Command to take advantage of its flexibility.

Documents:

Labels: