Development Guide
Setting up a build-job
To start, set up a new job:
10 Apr 2014 MB: I wish I had a clue how to tell Jenkins to not present me a german interface.
Setting up the checkouts
Here is how the two checkouts are configured:
The local module directory is noteworthy, the system under test - the ILIAS trunk in the above example - is checked out into the src directory of the ilias_ci checkout.
The checkout strategy is already at your discretion, however "svn update" brings good results since we don't put the sources upside down.
The builds
The build.xml file coming with the ilias_ci checkout contains a variety of targets. To make something happen, you need to add a build step to the job. The file provided is an Apache Ant buildfile, so you add a call to ant.
You see a configuration part like this:
The target is an important decision. The following targets are defined in the buildfile:
- clean & prepare ( Preparation steps)
- lint (PHPLint)
- phploc (Lines of Code)
- phpunit (Unit Test Execution)
- phpmd (PHP Mess Detector)
- phpcs (PHP Code Sniffer aka CheckStyle)
- phpcpd (PHP Copy Paste Detector)
- pdepend (PHP Depend)
- phpcb (PHP Code Browser)
- win-phploc
- win-phpunit
- win-phpmd
- win-phpcs
- win-phpcpd
- win-pdepend
- win-phpcb
(It is recommended to always start with clean and prepare, even though dependencies should make them the first targets executed.)
13 Apr 2014 MB: If you inspect the file, you will also see targets phpdox, inefficientsql and legacyconstructors. These are still considered experimental and will be added to the documentation once things work nicely.
Bundle-Builds
To make this a bit more convenient, a series of build targets exists, solely consisting of dependencies. These address common scenarios.
Here are the targets definitions, which should be self-explanatory:
1 | <target name="build-full" depends="prepare, lint, phploc, pdepend, phpmd, phpcpd, legacyconstructors, inefficientsql, phpunit, phpcs, phpcb" /> |
The "quick" series of bundles does only a limited inspection, the intent is to catch definite defects as soon as possible. Such a job runs only for a few minutes and can give a direct feedback. |