title: Gradle Replace text in jsp using filter
body: <p>I have a jsp that contains a css link that looks like</p>
  
  <pre><code>&lt;link type="text/css" href="/css/login-min.css" rel="stylesheet" /&gt;
  </code></pre>
  
  <p>In order to keep browsers from caching the css file we replace <code>login-min.css</code> with the name of the css and a timestamp or version number</p>
  
  <pre><code>login-min.css?t=432432423423...
  </code></pre>
  
  <p>In ant I would do something like</p>
  
  <pre><code>&lt;tstamp&gt;
    &lt;format property="current.time" pattern="MMddyyyyhhmmssaa" offset="-5" unit="hour" /&gt;
  &lt;/tstamp&gt;
  
  &lt;replace dir="${deploy.path}/${name}/WEB-INF/jsp" value="login-min.css?t=${current.time}"&gt;
    &lt;include name="includes/login_css_include.jsp" /&gt;
    &lt;replacetoken&gt;login-min.css&lt;/replacetoken&gt;
  &lt;/replace&gt;
  </code></pre>
  
  <p>For gradle I've updated the jsp page to look like</p>
  
  <pre><code>&lt;link type="text/css" href="/css/@loginCSS@" rel="stylesheet" /&gt;
  </code></pre>
  
  <p>and in the build.gradle am doing</p>
  
  <pre><code>import org.apache.tools.ant.filters.ReplaceTokens
  war {
    webInf {
      from ("${webAppDir}/WEB-INF/jsp") {
        include: "/includes/login_css_include.jsp"
        filter(ReplaceTokens, tokens: [loginCSS: 'login-min.css?v=1'])
      }
    }
  }
  </code></pre>
  
  <p>but this isn't working. </p>
  
  <p>This one works but it changes the source... I just want the files in the war to be modified.</p>
  
  <pre><code>import org.apache.tools.ant.filters.ReplaceTokens
  war {
    webInf {
      from ("${webAppDir}/WEB-INF/jsp/includes/login_css_include.jsp") {
        it.eachFile {
          ant.replace(file: it.file, token: "@loginCSS@", value: "login-min.css?v=1")
        }
      }
    }
  }
  </code></pre>
  
  <p>I'm brand new to gradle am I going about this totally incorrectly?  Anyone needed to do something like this before?  Using gradle 1.0-milestone-1.</p>
  
  <p>Thanks</p>