Skip to content

Latest commit

 

History

History
115 lines (78 loc) · 2.73 KB

BUILD.md

File metadata and controls

115 lines (78 loc) · 2.73 KB

It's modified version of the build system from YiiBoilerplate.

Preparations

Run the Composer in the root of codebase to bring all the required tools.

$ php composer.phar install

It will install the following stuff:

  • Phing
  • PHPUnit
  • PHPLOC
  • PHP CodeSniffer
  • PHP Mess Detector
  • PHP Copy-Paste Detector
  • Pinocchio
  • Apigen
  • PDepend
  • PHP CodeBrowser

Building distributive

We can build an end-user package out of the development codebase by issuing:

$ ./vendor/bin/phing dist

Target named dist is default, so the following will do, too:

$ ./vendor/bin/phing

End-user bundle will be placed in the dist/ directory and named after the version specified in ./build/build.properties file, in the project.version keyval pair.

Contents of end-user bundle:

  1. Contents of src/ directory.
  2. README.md
  3. INSTALL.md
  4. LICENSE
  5. CHANGELOG.md

Arguably users are not interested in the API documentation so it is not bundled.

Checking the project state

You can run an extensive suite of checking tools over the codebase by issuing the following:

$ ./vendor/bin/phing check

It will run the following tools over the codebase:

  • PHPUnit
  • PHPLOC
  • PHP CodeSniffer
  • PHP Mess Detector
  • PHP Copy-Paste Detector
  • PDepend

These tools will place their reports into the reports/ directory. PHP CodeBrowser will create browsable set of HTML files with highlighted sources, each problem reported mentioned in these HTML files. Entry point will be in reports/codebrowser/index.html file.

PHPUnit is set up to generate several different code coverage reports. One of them is the browsable set of HTML files, which will be put into reports/coverage/, entry point is index.html in there.

Note that you need the XDebug extension for PHPUnit to generate code coverage report. If there will be no code coverage report, PDepend will fail, too.

Generating the documentation

There is no user-level documentation (yet). Several examples of usage of some widgets are on http://yii-booster.clevertech.biz.

API documentation via Apigen is being generated by issuing the following:

$ ./vendor/bin/phing apigen

It will be placed into doc/api/ directory.

We also use Pinocchio to generate annotated sources for widget classes, but it's probably useless. You can generate annotated sources by calling the following:

$ ./vendor/bin/phing annotated

They will be placed into doc/annotated/ directory.

Calling the following command:

$ ./vendor/bin/phing doc

Generates both kinds of documentation.

Cleanup

Here is the command to remove directories generated by build system:

$ ./vendor/bin/phing clean

It removes dist/, doc/ and reports/ directories.