I need to write an ant task to determine if a certain file is readonly, and if it is, fail. I would like to avoid using a custom selector to do this do to the nature of our build system. Anyone have any ideas how to go about doing this? I’m using ant 1.8 + ant-contrib.
Thanks!
Will something like this do the trick?
This uses the
conditiontask and theisfileselectedcondition (not a direct link – you’ll have to search down the page) combined with thewritableselector (and reversed with anotcondition).Update:
An possibly better alternative would be:
This has the check and the fail as one distinct action rather than two, so you may find it clearer, and it doesn’t require using a property name, so your namespace is cleaner.