title: Gradle: Can I compile code that depends on its own output?
body: <p>This is a strange question, but it's not theoretical...</p>
  
  <ol>
  <li><p>I'd like to make a Gradle project that uses a <code>buildSrc</code> with a java project inside. That java project defines some classes used in the build process.</p></li>
  <li><p>The nasty trick is, the Gradle project produces a bunch of outputs, including  <strong>modified</strong> classes that belong to the Java project of the <code>buildSrc</code> itself.</p></li>
  </ol>
  
  <p>Is there any way to express this with Gradle?</p>
  
  <p>The only solution I have in mind right now is: run the whole build script twice in a row. Is there any way to avoid that? For example, by generating the modified code for <code>buildSrc</code>, re-compiling the <code>buildSrc</code> and then generating the additional outputs of the main Gradle project?</p>