zerkms
zerkms

Reputation: 255035

Check if property has been set in phing

How to check if property ${foo} has been set?

Bonus question: how to escape $ sign in <echo> so I could output ${foo} string (not the foo variable substitution)?

PS: tried to google and read documentation, but couldn't find the answers. It's likely I'm missing something

Upvotes: 8

Views: 4767

Answers (2)

ciscoheat
ciscoheat

Reputation: 3947

If you just need to fail the build if a property is defined or not, check out the fail task:

http://www.phing.info/docs/guide/stable/FailTask.html

Upvotes: 0

alex
alex

Reputation: 490481

You need to place an isset element inside the if element.

<if>
    <isset property="foo" />

The manual is available here.

Upvotes: 16

Related Questions