title: How to get the Gradle build directory in a Java annotation processor
body: <p>I am writing a custom annotation processor in Java which needs to create a file.</p>
  <p>It seems to me the best location for that file would be in a new folder inside the Gradle's <code>$buildDir</code>.</p>
  <p>For a project without modules, the environment property &quot;user.dir&quot; seems to hold a value I could use.</p>
  <p>However, that environment property changes if the project has modules and the <code>gradlew build</code> command is executed either from inside or outside a module.</p>
  <p>What is the best approach to actually get in Java the Gradle build directory of the module in which the annotation processor is declared ?</p>
  <p>P.S.</p>
  <p>I do not want to create that file in the &quot;build/generated&quot; folder (this is what <code>processingEnv.getFiler().createSourceFile(..)</code> does).</p>