phingofficial/phing — pull request #159 by handautsav (2012-11-20 04:52:36+00:00)
Title: Phing Strict Build Mode

Phing build would support a 'Strict' mode, which indicate to consider a warning as an error, and raises a buildException to abort the build process.

@Ticket
http://www.phing.info/trac/ticket/918

@Specs
Phing build would support a 'Strict' mode, with the default value as Off (to enable backward compatibility until complete future migration). The 'strict' mode, when enabled, considers all the warnings (which are raised with "MSG_WARN" level) as an error, and raises a buildException to abort the build process.

This pull request adds the following functionalities:

1) The Project tag supports new attribute - strict (boolean), indicating the build process mode.

2) The Phing command-line utility would support two new parameters:
-strict runs build in strict mode, considering a warning as error
-no-strict runs build normally. (overrides buildfile attribute)

3) The command-line switches over-rides the 'Build File' "Project::Strict" attribute information.
A sample target which builds in 'strict' mode:

4) The documentation resources has been updated with the attribute information.

I understand, that the current Phing implementation does not considers the 'warnings' as a separate entity, but part of LogLevel. Therefore, currently, this implementation would have limited capability. But considering this as a starting point, we can utilize the future approach designing.

Please let me know if this integration requires any discussion.

Thanks,
Utsav