After a long break I am back to this tutorial series on the use TemaCity for PHP projects integration.

In this part I will deal with the generation of documentation for the project.

Normally thinking about the documentation for PHP the projects everyone want to use PhpDocumentator but the project is not developed for some time and it does not support changes to the language since version 5.3 therefore for some time now I use DocBlox.

It’s a fairly new system, has low requirements for system resources and generates a pretty nice documentation.

Installation

Installation is simple but requires you to download some additional packages. The easiest way to do it with the help of PEAR:

pear channel-discover pear.zfcampus.org
pear channel-discover pear.michelf.com
pear install channel://pear.zfcampus.org/zf
pear install channel://pear.michelf.com/MarkdownExtra

Having met the requirements, you can install the package using these commands:

pear channel-discover pear.docblox-project.org
pear install docblox/docblox-beta

In addition, the xslt preprocessor module is required in the php, and graphviz package to generate the classes diagrams.

Now just add a new target to build.xml file from the previous part.

<target name="doc" depends="prepare">
    <exec executable="docblox" dir="${basedir}" failonerror="false" output="${artifactsDir}/docblox.log" >
        <arg line="run" />
	<arg line="-d ./application,./library" />
	<arg line="-t ${artifactsDir}/api" />
    </exec>
    <echo message="##teamcity[publishArtifacts '${artifactsDir}/docblox.log']" description="Import detailed log to TeamCity" />
    <zip destfile="${artifactsDir}/api.zip" whenempty="skip" basedir="${artifactsDir}/api" />
    <echo message="##teamcity[publishArtifacts '${artifactsDir}/api.zip']" description="Import documentation into TeamCity" />
</target>

And to create the target directory in action prepare:

<mkdir dir="${artifactsDir}/api" />

Thats all folks. Just add a build step, indicate a target „doc” and import documentation to the new tab.

Adding a new step in the project settings:

Settings:

To add a tab you must enter the server settings in the administration panel, and in the „Report Tabs” tab define a new type of report:

That’s it. New tab will be available in project summary.

22 maja 2011 11:49 Grzegorz Drozd Brak komentarzy Komentuj Kategorie: Narz?dzia, PHP, Praca, TeamCity

Bądź uprzejma(y).

Możesz używać następujących tagów HTML tags: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <s> <strike> <strong>

Twój adres e-mail nie będzie wyświetlony.

Twój adres e-mail nie będzie przekazany nikomu.

Wszystkie komentarze są moderowane.