In Ant, does anyone know of a concise way to go about having a build.xml
fail if, when copying a file, token replacement for a particular token does not occur. I.e., the token was not found in the file, and thus was not replaced.
The idea behind this is that in certain circumstances it may be crucial for a tokenised file to have certain tokens replaced, and so it's worth validating that those tokens exist in the file to begin with - by default Ant would just do nothing if the token isn't there.
I've looked at the docs for filter
and filterset
but they don't seem to have an attribute for failing if the token searched for is not present.
Perhaps this could be done with a regex task to check if the token is present. Are there any neater ways people can think of?