title: How to make sure doLast even task is skipped
body: <p>I have following code:</p>
  
  <pre><code>jar.doLast {
      def isFailed = jar.state.failure
      def proc
      if (isFailed) {
          proc = ['notify-send', "-u", "critical", "Build ${project.name} failed"].execute()
      } else {
          proc = ['notify-send', "Build ${project.name} finish"].execute()
      }
      proc.waitForProcessOutput(System.out, System.err);
  }
  </code></pre>
  
  <p>when i first run <code>gradle --daemon jar</code>, it send notification, when i run it again, the jar.doLast doesn't run, i think it's because, gradle auto skipped jar since src is same with old src, so how to make sure jar.doLast run in 2nd case?</p>