Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Phing Strict Build Mode #626

Merged
merged 2 commits into from
Dec 5, 2016
Merged

Conversation

utsavhanda
Copy link
Contributor

@utsavhanda utsavhanda commented Nov 23, 2016

Phing build would support a 'Strict' mode, which indicates 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 build file attribute)

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

<project name="PhingDev" basedir="./" default="help" strict="true" >

<property name="build.dir"  value="./" override="false" />

<!-- Target: HelloWorld -->
 <target name="helloworld">
   <echo msg="Hello, World" />
   <warn msg="${notdefined}" />
</target>

</project>
  1. The documentation resources have been updated with the attribute information.

I understand, that the current Phing implementation does not consider 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.

Legacy PR
#159

Thanks,
Utsav

Utsav Handa and others added 2 commits November 23, 2016 19:33
- Added the executable command-line switches for enabling/disabling the strict mode.
@mrook mrook added this to the 3.0 milestone Nov 23, 2016
@mrook
Copy link
Member

mrook commented Dec 5, 2016

References #554

@mrook mrook merged commit b13a01a into phingofficial:3.0 Dec 5, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

2 participants