title: Integrate Ant builder into Eclipse: Relative paths for refresh scope working set
body: <p>This question is similar to <a href="https://stackoverflow.com/questions/7793046/integrate-ant-builder-into-eclipse-error-variable-references-empty-selection">Integrate Ant builder into Eclipse: Error &quot;Variable references empty selection&quot;</a>, but asks for something different.</p>
  
  <p>In my Eclipse JDT project, I have some ant tasks that I want to execute before compilation, so I added an ant builder to my Eclipse builder config. Now I want to configure the two options "refresh resources upon completion" and "working set of relevant resources" for this builder so that they contain a specific directory in my project.</p>
  
  <p>Both allow me to specify a "working set" with this <a href="http://mobilepearls.com/labs/ndk-builder-in-eclipse/edit-refresh-working-set.png" rel="nofollow noreferrer">dialogue</a>. The problem is that this will put paths in the Eclipse builder configuration file that are relevant to the workspace, and thus the paths will include project names.</p>
  
  <p>The problem is that the whole project is managed in a subversion repository. The Eclipse configuration is part of the repository, and other users check this out with different file-system layouts and possibly different Eclipse project names. For example, I usually have several working copies of the same project in my Eclipse workspace, each of course with a different project name.</p>
  
  <p>That's why I am looking for a way <strong>how to specify a working set in Eclipse relative to the project directory</strong> (not the workspace directory), or <strong>some other way to define the refresh scope of a builder such that it includes a single directory in my project</strong>.</p>
  
  <p>I am using Eclipse 3.7 (Indigo).</p>
  
  <p>If I configure the working set in the dialogue and look in the configuration file afterwards, the following string is the value of the <code>ATTR_REFRESH_SCOPE</code> option:</p>
  
  <pre><code>${working_set:
  &amp;lt;?xml version=&amp;quot;1.0&amp;quot; encoding=&amp;quot;UTF-8&amp;quot;?&amp;gt;&amp;#10;
  &amp;lt;resources&amp;gt;
  &amp;#10;&amp;lt;item path=&amp;quot;/MyProject&amp;quot; type=&amp;quot;4&amp;quot;/&amp;gt;&amp;#10;
  &amp;lt;/resources&amp;gt;}
  </code></pre>
  
  <p>Sanitized this looks like:</p>
  
  <pre><code>${working_set:
    &lt;?xml version="1.0" encoding="UTF-8"?&gt;
    &lt;resources&gt;&lt;item path="/MyProject/lib" type="2"/&gt;&lt;/resources&gt;
  }
  </code></pre>
  
  <p>So I want to get the "MyProject" part out of this. I tried the solution of the question mentioned above and replaced the path with <code>${build_project:/lib}</code>. This gives no error message, but it seems to have no effect (Eclipse will not refresh the mentioned directory).</p>
  
  <p>I also tried replacing the whole working set definition with <code>${build_project:/lib}</code>, but this gives an error message <code>Unable to restore resource memento</code>.</p>
  
  <p>I know that I could just tell Eclipse to refresh the whole project after the builder is run, but this is not what I want (its quite slow). Also for the "relevant resources" configuration option, this would mean that the builder needlessly runs after every change in the project.</p>