ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jbmdharris <>
Subject Fail if any of many files contains a string
Date Thu, 11 Jun 2009 01:35:41 GMT

Is there a way to check if a string is present in any of a set of files and
fail the build?  I've got something now, but it requires copying the
files... which I don't like doing.  Copying puts a bunch of "copying 1 file
to blah blah blah in my build output".  Here's my current code:

        <for param="currentCSSFile">
                <fileset dir="${dir.out.css}">
                    <include name="**/*.css"/>
                <copy file="@{currentCSSFile}" tofile="${tokenCheckFile}"
                            <regexp pattern="@(.*?)@"/>
                <fail message="Found missed keyword substitution (@KEYWORD@)
in output file: @{currentCSSFile}">
                        <length file="${tokenCheckFile}" when="greater"
View this message in context:
Sent from the Ant - Users mailing list archive at

To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message