No more Ant required to build MODx Revolution (or xPDO)

MODx has adopted a native PHP build system

I've been wanting to make the jump to Phing with both xPDO and MODx for a while and finally got around to it. It wasn't all that difficult, though there were some painful differences in the way Ant and Phing interpret include and exclude patterns in FileSet Types. Regardless, the pain is over, and the develop branches of both the revolution and xpdo repositories have the changes if you want to play around.

If you've never used Phing before, I encourage you to install it using PEAR. But you can also install it standalone if you have moral reservations with using PEAR. Once you get that installed and you have pulled the latest changes from the develop branch of revolution, you will be able to minify and concat the js and css files in Revolution, generate the core transport, generate the phpdocs, build distribution packages (traditional, advanced, and sdk) with date stamps as suffixes (for nightly builds, coming soon) from any ref in the repo, and more. Look for automated unit testing and other features coming soon.

Until then, here are some sample commands to build some packages. Note that all of the examples below assume you are in the _build directory of your git clone.

  • To build your local working copy:
    user@host:/path/to/revo/_build$ phing
  • To build a nightly set of distrib packages from the develop branch with a timestamp suffix:
    user@host:/path/to/revo/_build$ phing -Dbuild.distrib=true -Dbuild.src.tree=develop
  • To build a set of distrib packages from your current HEAD with a timestamp suffix:
    user@host:/path/to/revo/_build$ phing -Dbuild.distrib=true -Dbuild.src.tree=HEAD
  • To build a set of distrib packages from a release tag without a timestamp suffix:
    user@host:/path/to/revo/_build$ phing -Dbuild.distrib=true -Dbuild.src.tree=v2.0.4-pl -Dbuild.timestamp=false