title: Access sdk.dir value in build.gradle after project evaluation
body: <p>I have a custom task in my build.gradle file that does bytecode transformations on class files before getting dex'd that looks like this:</p>
  
  <pre><code>task droidcook(type: JavaExec) {
      main 'org.tsg.android.asm.Main'
  }
  
  afterEvaluate { project -&gt;
      android.applicationVariants.each { variant -&gt;
          variant.javaCompile.doLast {
              project.tasks.droidcook.configure {
                  classpath variant.javaCompile.classpath
                  classpath "build/classes/" + variant.dirName
                  classpath sdk.dir + "/platforms/android-19/android.jar"
                  classpath "compile-libs/droidcook.jar"
                  args "build/classes/" + variant.dirName
                  args "com.example"
                  // args "-debug"
                  // args "-asmifier"
              }
              project.tasks.droidcook.execute()
          }
      }
  }
  </code></pre>
  
  <p>The issue with the above is the <code>classpath sdk.dir + ...</code> line where <code>sdk.dir</code> isn't evaluated appropriately. To get this working, I currently have to hard code the path to the <code>android.jar</code>.</p>
  
  <p>Bonus points if you can answer with an appropriate value to replace <code>android-19</code> with for accessing a platform specific <code>android.jar</code> based on project configuration. :D</p>