title: How can I use gradle to build my project both with and without our profiling aspects?
body: <p>We've developed some profiling aspects that we would like to include in a testing build, but not in our production build.  I'm looking for a best-practices way of structuring the build.gradle file and the source directories.</p>
  
  <p>My initial thought was to create a compileJavaAJ task, and a jarAJ task which depends on compileJavaAJ.  compileJavaAJ would look awfully similar to the compileJava defined in the aspectJ plugin, <a href="http://github.com/breskeby/gradleplugins/raw/0.9-upgrade/aspectjPlugin/aspectJ.gradle" rel="nofollow">http://github.com/breskeby/gradleplugins/raw/0.9-upgrade/aspectjPlugin/aspectJ.gradle</a>.  The problem with just applying this plugin is that it completely replaces compileJava (i.e. the one using javac).  I need two build targets - one that uses javac, the other that uses ajc.  I welcome suggestions if there's a better approach though.</p>
  
  <p>Next, I need to decide where to put the aspectJ code.  I don't want to put it in src/main/java, because the java compiler will choke on it.  So, I'm thinking of defining a new SourceSet, src/main/aspectJ, which only compileJavaAJ knows about.  A SourceSet is supposed to model java code though, so I'm not quite sure if this is the correct approach.</p>
  
  <p>Any input is greatly appreciated.  Thanks!</p>