title: Ant script no longer invoked when source files modified in Eclipse
body: <p><strong>Summary</strong><br>
  I'm developing a Java application within Eclipse Luna. I've been trying to develop an Ant script that will increment my project's version number whenever I recompile the source code. However, my script is not being invoked when the source files change.</p>
  
  <p><strong>Details</strong><br>
  As a follow-on to <a href="https://stackoverflow.com/questions/26633627/how-can-i-prevent-eclipse-from-auto-rebuilding-when-i-edit-certain-files">this problem I was having yesterday</a>, I tried to solve the issue by enabling <code>Specify working set of relevant resources</code> under <code>Properties -&gt; Builders -&gt; {Ant builder} -&gt; Edit -&gt; Build Options</code> and setting the working set to include all of my source files. Eclipse's documentation says that this will cause the Ant script to be invoked if any of those files are modified. After doing that, I removed all target calls from <code>Auto Build</code> under <code>Targets</code>.</p>
  
  <p>For all of 60 seconds, this seemed to work; my Ant script would be invoked and increment the version number whenever I made a change to a source file and hit save, and it didn't cause a feedback loop as when I had it invoked within <code>Auto Build</code>.</p>
  
  <p>I then tried unchecking <code>Allocate Console</code> under <code>Build Options</code> to see if I could get the script to run silently. This stopped it from working, so I re-enabled it. However, it still didn't work after doing that, and even closing and re-opening Eclipse hasn't solved that.</p>
  
  <p>This is pretty annoying and unintuitive behaviour. Is it a bug or am I missing something? I would like Eclipse to invoke my Ant script whenever I modify the source files, but not in a way that causes it to enter a feedback loop where modifying files leads to a recompilation which modifies my <code>build_info.properties</code> file, which leads to further recompilation, ad nauseum.</p>
  
  <p>I'd be happy to provide any additional information should it be required.</p>
  
  <p><strong>EDIT</strong><br>
  I tried creating a new test project with a copy of the build script and configuring it to run for that. It did not work in the new project either.</p>
  
  <p>My test project structure:</p>
  
  <p><img src="https://i.stack.imgur.com/MVHyH.png" alt=""></p>
  
  <p>My build configuration:</p>
  
  <p><img src="https://i.stack.imgur.com/23hlN.png" alt=""></p>
  
  <p>The working set of relevant resources for my ant script:</p>
  
  <p><img src="https://i.stack.imgur.com/J2x7n.png" alt=""></p>
  
  <p>My complete build script:</p>
  
  <pre><code>&lt;?xml version="1.0" encoding="UTF-8"?&gt;
  &lt;project name="buildscript" default="compileView"&gt;
  
      &lt;available file=".git" type="dir" property="git.present" /&gt;
  
      &lt;property name="propertyfile.name" value="ant/build_info.properties" /&gt;
      &lt;property file="${propertyfile.name}" /&gt;
      &lt;property name="build.number" value="v${build.major.number}.${build.minor.number}.${build.build.number}.r${build.revision.number}" /&gt;
  
      &lt;target name="current-number"&gt;
          &lt;echo&gt;Current build number: ${build.number}&lt;/echo&gt;
      &lt;/target&gt;
  
      &lt;!-- Set this as default --&gt;
      &lt;target name="compileView"&gt;
          &lt;antcall target="compile"&gt;
          &lt;/antcall&gt;
          &lt;antcall target="current-number"&gt;
          &lt;/antcall&gt;
      &lt;/target&gt;
  
      &lt;target name="compile" depends="updateRevision"&gt;
          &lt;echo&gt;Compiling...&lt;/echo&gt;
          &lt;antcall target="build"&gt;
          &lt;/antcall&gt;
      &lt;/target&gt;
  
      &lt;target name="dist" depends="updateRevision"&gt;
          &lt;echo&gt;Producing redistributable&lt;/echo&gt;
          &lt;antcall target="minor"&gt;
          &lt;/antcall&gt;
          &lt;antcall target="createJar"&gt;
          &lt;/antcall&gt;
      &lt;/target&gt;
  
      &lt;target name="createJar" depends="updateRevision"&gt;
          &lt;property name="projectHome" location="." /&gt;
          &lt;jar destfile="&lt;&lt;redacted&gt;&gt;.jar" filesetmanifest="mergewithoutmain"&gt;
              &lt;manifest&gt;
                  &lt;attribute name="Main-Class" value="&lt;&lt;redacted&gt;&gt;.Main" /&gt;
                  &lt;attribute name="Class-Path" value="." /&gt;
              &lt;/manifest&gt;
              &lt;fileset dir="${projectHome}/bin" /&gt;
              &lt;zipfileset excludes="META-INF/*.SF" src="${projectHome}/forms-1.3.0.jar" /&gt;
              &lt;zipfileset excludes="META-INF/*.SF" src="${projectHome}/miglayout15-swing.jar" /&gt;
              &lt;zipfileset excludes="META-INF/*.SF" src="C:/Users/&lt;&lt;redacted&gt;&gt;/Documents/eclipse/plugins/org.junit_4.11.0.v201303080030/junit.jar" /&gt;
              &lt;zipfileset excludes="META-INF/*.SF" src="C:/Users/&lt;&lt;redacted&gt;&gt;/Documents/eclipse/plugins/org.hamcrest.core_1.3.0.v201303031735.jar" /&gt;
          &lt;/jar&gt;
      &lt;/target&gt;
  
      &lt;target name="updateRevision" if="git.present"&gt;
          &lt;exec executable="git" outputproperty="git.hash" failifexecutionfails="true" errorproperty=""&gt;
              &lt;arg value="rev-parse" /&gt;
              &lt;arg value="HEAD" /&gt;
          &lt;/exec&gt;
          &lt;propertyfile file="${propertyfile.name}"&gt;
              &lt;entry key="build.revision.number" type="string" operation="=" value="${git.hash}" /&gt;
          &lt;/propertyfile&gt;
      &lt;/target&gt;
  
      &lt;target name="build" depends="updateRevision"&gt;
          &lt;propertyfile file="${propertyfile.name}"&gt;
              &lt;entry key="build.build.number" type="int" operation="+" value="1" /&gt;
          &lt;/propertyfile&gt;
      &lt;/target&gt;
  
      &lt;target name="minor" depends="updateRevision"&gt;
          &lt;propertyfile file="${propertyfile.name}"&gt;
              &lt;entry key="build.minor.number" type="int" operation="+" value="1" /&gt;
              &lt;entry key="build.build.number" type="int" value="0" /&gt;
          &lt;/propertyfile&gt;
      &lt;/target&gt;
  
      &lt;target name="major" depends="updateRevision"&gt;
          &lt;propertyfile file="${propertyfile.name}"&gt;
              &lt;entry key="build.major.number" type="int" operation="+" value="1" /&gt;
              &lt;entry key="build.minor.number" type="int" value="0" /&gt;
              &lt;entry key="build.revision.number" type="int" value="0" /&gt;
          &lt;/propertyfile&gt;
      &lt;/target&gt;
  
  &lt;/project&gt;
  </code></pre>
  
  <p>The script runs fine if I invoke it manually:</p>
  
  <pre><code>Buildfile: W:\&lt;&lt;redacted&gt;&gt;\workspace\TestProject\build.xml
  
  compileView:
  
  updateRevision:
  
  compile:
          [echo] Compiling...
  
  updateRevision:
  
  build:
  [propertyfile] Updating property file: W:\&lt;&lt;redacted&gt;&gt;\workspace\TestProject\ant\build_info.properties
  
  current-number:
          [echo] Current build number: v0.0.2.r0
  BUILD SUCCESSFUL
  Total time: 143 milliseconds
  </code></pre>