API documentation in Jenkins with DocBlox

People using PHP that want API documentation usually automatically think of phpDocumentor, which used to be the de facto standard for generating API documentation from your PHP projects. However, the project has been dormant for a long time now and definitely does not support new PHP features such as namespaces, so it was really time to look for an alternative. In this blogpost, I'll show you how I set up my Jenkins CI to use DocBlox, one of the new API documentation generators currently available.

First of all, of course, I needed to install Jenkins. This article is not about installing Jenkins, so I won't go into the details of that, but you can safely assume that I simply installed Jenkins on my Ubuntu VPS using apt-get. So this means that I now have a Jenkins user on my system, whose home directory is in /var/lib/jenkins (which is also the root of the Jenkins working directory). Next, I used the template of Jenkins-php.org to have a base template for my Jenkins projects. This saved me a lot of time in figuring out how to set up the build configuration for my project.

The only downside is that Jenkins-PHP assumes you want to use phpDocumentor for API documentation generation. I wanted to replace that with DocBlox, the API documentation generator built by my good friend Mike van Riel. One of the main advantages for me personally is the support for namespaces in DocBlox, that makes me want to use DocBlox over phpDocumentor. The projects that I am currently starting to use DocBlox for are not big projects, otherwise another reason would have been performance. DocBlox has been known to use far less memory and generate the documentation much faster than phpDocumentor. Anyway, I'm not here to sell DocBlox to you, I'm here to tell you what I did to set up DocBlox in the build process for Jenkins :)

So, to set up DocBlox is actually very easy. You just have to alter the build.xml template file that Jenkins-PHP has to replace phpDocumentor with DocBlox. Jenkins-PHP uses the following configuration for API documentation:

<target name="phpdoc"
        description="Generate API documentation using PHPDocumentor">
 <exec executable="phpdoc">
  <arg line="-d ${source} -t ${basedir}/build/api" />
 </exec>
</target>

Instead of that configuration, I now use:

<target name="docblox">
  <exec executable="docblox">
    <arg line="project:run
               -d ${source}
               -t ${basedir}/build/api" />
  </exec>
</target>

You will have to make sure to remove the phpDocumentor antcall in the parallelTasks target, and call the docblox antcall instead:

<antcall target="docblox"/>

If you've done all this, then Jenkins should make sure that DocBlox documentation is generated. If you want to see the full build.xml that I'm currently using for my phpOpenNOS project, then check here.


Add comment

Comments

gravatar ralston cereal where to buy: special k® cereals that now offer fiber include special k® red berries, special k® fruit & yogurt, special k® cinnamon pecan, special k® vanilla almond observe your child's behavior for the next three hours. but it will find you a therapist. "i think you have made that up" be prepared for a disaster
May 16, 2013
gravatar viscometers brookfield: in the late 1990s and early 2000s smb erp solutions began to evolve. 1 - scheme of adiabatic calorimeter cfd modeling of the low-temperature oxidation of coal 135 physical experiment - method of adiabatic oxidation for definition of heat release dynamics in course tokars ji, miller er, alter mj, arduino mj.
May 23, 2013

Php5_zce_logo

Tags

1337 2008 2010 2011 4developers access modifiers accessibility AdaLovelaceDay09 advent agavi agile alfred amsterdam amsterdamphp apache api apple article articles atk atkMetaNode audioscrobbler autoloading automation azure backwards compatibility barcelona barcodes bash bbc bbq beatstad belgium best practices bittorrent blogging blogs boards of canada book books bughuntday bundle caching cake cal evans calendar career cat cerf certificate cfp cilex clear cms cologne common sense communities community components composer conference conferences contest continuous integration contribute contribution crisis css curl custom d-day data migration datetime DbFinderPlugin decorator decorators deployment deps devdays development directoryindex directoryiterator docblox doctrine doctrine2 documentation download dpc dpc09 dpc10 dpc11 DPC2008 dreamhost drupal dv7 eclipse ed editors efficiency enterprise errors event events expertise ezcomponents facebook filter-branch filteriterator finland flickr fork framework frameworks free ticket freelance freeze frontend fun game games geoip germany getting real git github globiterator gnome-do google google calendar googletalk graceful degradation hack hackers hidden gem hiphop howto hp HR html http i386 ibuildings icann ide ideasofmarch idm imovie inclusivity indy ingewikkeld integration international php conference internet interview ipad IPC ipc ipc08 ipc10 ipc11se iterators iterm2 javascript jenkins jenkins-php job job openings jobeet john peel joomla joomladays kiva kubuntu launcher launchy left on the web libcurl libraries library lighttpd lime linktuesday linux live london loudblog m2ts mac magazines malware mambo manchester marjolein mediterra meeting meme meta methodology micro-financing microframework microsoft migration movie music mysql namespace namespaces netbeans netherlands newsfire nllgg northeastphp nos odmarco open source opinion ORM osx paradiso paris partnership pavilion pear pecl performance personal pfc10 pfc11 pfcongres pfcongrez pfz pfz.nl photo php PHP php5.3 phpabstract phpazure phpBB phpbb phpbelgium phpbenelux phpbnl10 phpday phpdoc phpdocumentor phpgg phpitalia phpnw phpnw08 phpnw11 phpnw12 phpstorm phptek phptek09 phpuk2009 phpUnderControl phpunit php|architect php|tek podcast politics portability postcrossing presentation presentations private projects protected prototype PSR-0 public python qa qr codes re2c recruiting refactoring review rewrite ruby on rails san francisco schedule scifi script security sensio seven things sexism sfdaycgn sflive2011 shell scripting silex simplexml slides smfony software sogeti solar sound speakers spl ssh standard standards star trek static steer strings stylesheets subversion symfony symfony live symfony2 Symfony2 symfonycamp symfonyday symfonylive symfonyUnderControlPlugin talk talks tech techademy technology techportal tek09 telecommuting terratec terrorism testfest testing textmate textpattern the right tool timeout tips tld todo tomas tools training twig uncon unet usability usergroup validation vhost video vim vinyl virus warp webinar weblogging webservices wiki windows winphp women wordpress work workshop world world of warcraft wpi writing wunderlist xml xpath xsd yara year youtube zc11 ZCE zemanta zend zend framework zend server zend studio zendcon Zend_Form zite
© 2004 - 2013 Stefan Koopmanschap + Powered by Symfony, photos powered by Flickr, links powered by Delicious, Shanghai smilies by Iconbuffet. Feeds: rss / atom. Left on the Web v4.4.0.1