Discussion:
[mantisbt-dev] Build System
P Richards
2014-09-21 22:20:24 UTC
Permalink
Hi All,



I'd like to draw people's attention to
https://github.com/mantisbt/mantisbt/pull/332 - as it's start of work to
implement a common build system that both travis and mantis developers can
use. As we add unit tests allowing mantis developers to easily create a
build locally and also show up code style issues should hopefully lead to
less churn in the source code (and make supporting different releases of
mantis easier).



I think the summary I put on the github PR hopefully covers most things so
far, so going to just paste it here rather than writing another wall of
text:



For a long while now, the build a developer can do,
and the build one can automate on travis-ci are too different things.

This is the start of a process to unify the build system, such that a
developer can run a local build before/without having to wait for
travis-ci or some other automation system to kick in.

The requirements for this to run at the moment is an installation of
either phing or composer.

Phing route:

Phing can be installed, if not already installed by running:

pear channel-discover pear.phing.info
pear install [--alldeps] phing/phing

going to the Mantis directory, and running phing then starts a build.

This build will download composer, download a standard version of
phpcodesniffer/phpunit, and it's own copy of phing and run a build based
on these versions. This ensures that local + travis etc versions are the
same

Composer Route:

php -r "readfile(' <https://getcomposer.org/installer');>
https://getcomposer.org/installer');" | php
composer install

A build can be run at this point by calling:

php vendor/bin/phing build

Note: at the moment, I've specified 'build' as a target here, as the
default option is to run a target called "buildsystem" at the moment,
which downloads all the dependencies

travis-ci.org build has been modified to include the process described
above so that a developers build and the build system build converge
towards being identical.

At the moment a 'build' consists of the following:

a) doing a quick lint check on PHP files for parse errors
b) Running some popular code metrics type utilities: phploc,pdepend
c) running phpcs with a custom ruleset which tries to follow mantis's rules
d) running phpunit tests
e) generating some api documentation
(atm, via phpdox, although should also generated via phpdoc2)
f) spit our a zip/tarball package of the build

Full build time is with codesniffer rules etc is around 2.5-3 minutes
locally

however, individual steps can be run:

For example:

phing phpcs will run codesniffer rules against code base.

phing phpunit will run php unit tests.

This is very much a first step - I suspect we will alter the tools,
add tools and commands etc, as we work out whats useful and what isn't.

For example, I've seen some phing build scripts that deal with creating
and merging between local branches/github PR's etc.
Paul Richards
2014-09-30 22:44:01 UTC
Permalink
Hi All,



I was just wondering whether anyone had had any problems with executing the
code in the new build system from the instructions issued previously, or
whether so far, it seems to work on people's systems?



Paul



From: P Richards [mailto:***@mantisforge.org]
Sent: 21 September 2014 23:20
To: 'developer discussions'
Subject: [mantisbt-dev] Build System



Hi All,



I'd like to draw people's attention to
https://github.com/mantisbt/mantisbt/pull/332 - as it's start of work to
implement a common build system that both travis and mantis developers can
use. As we add unit tests allowing mantis developers to easily create a
build locally and also show up code style issues should hopefully lead to
less churn in the source code (and make supporting different releases of
mantis easier).



I think the summary I put on the github PR hopefully covers most things so
far, so going to just paste it here rather than writing another wall of
text:



For a long while now, the build a developer can do,
and the build one can automate on travis-ci are too different things.

This is the start of a process to unify the build system, such that a
developer can run a local build before/without having to wait for
travis-ci or some other automation system to kick in.

The requirements for this to run at the moment is an installation of
either phing or composer.

Phing route:

Phing can be installed, if not already installed by running:

pear channel-discover pear.phing.info
pear install [--alldeps] phing/phing

going to the Mantis directory, and running phing then starts a build.

This build will download composer, download a standard version of
phpcodesniffer/phpunit, and it's own copy of phing and run a build based
on these versions. This ensures that local + travis etc versions are the
same

Composer Route:

php -r "readfile(' <https://getcomposer.org/installer');>
https://getcomposer.org/installer');" | php
composer install

A build can be run at this point by calling:

php vendor/bin/phing build

Note: at the moment, I've specified 'build' as a target here, as the
default option is to run a target called "buildsystem" at the moment,
which downloads all the dependencies

travis-ci.org build has been modified to include the process described
above so that a developers build and the build system build converge
towards being identical.

At the moment a 'build' consists of the following:

a) doing a quick lint check on PHP files for parse errors
b) Running some popular code metrics type utilities: phploc,pdepend
c) running phpcs with a custom ruleset which tries to follow mantis's rules
d) running phpunit tests
e) generating some api documentation
(atm, via phpdox, although should also generated via phpdoc2)
f) spit our a zip/tarball package of the build

Full build time is with codesniffer rules etc is around 2.5-3 minutes
locally

however, individual steps can be run:

For example:

phing phpcs will run codesniffer rules against code base.

phing phpunit will run php unit tests.

This is very much a first step - I suspect we will alter the tools,
add tools and commands etc, as we work out whats useful and what isn't.

For example, I've seen some phing build scripts that deal with creating
and merging between local branches/github PR's etc.
Damien Regad
2014-10-01 13:00:42 UTC
Permalink
Post by Paul Richards
I was just wondering whether anyone had had any problems with executing
the code in the new build system from the instructions issued previously,
or whether so far, it seems to work on people’s systems?
I've been totally swamped by your recent series of pull requests (and a few
other things) and have not had the time to even start looking at this just yet.
Roland Becker
2014-10-01 17:55:04 UTC
Permalink
Post by Damien Regad
I've been totally swamped by your recent series of pull requests (and a few
other things) and have not had the time to even start looking at this just yet.
Same for me.

My MantisBT time will be very limited at least until mid of december :-(
Continue reading on narkive:
Loading...