Properly handle OUT_DIR that can be relative to $TOP.

The build server calls gradle using $TOP as the cwd, not
framework/support. It also passes OUT_DIR as a relative path
to $TOP instead of an absolute path.

This made the Gradle script imcorrectly compute the true location
of out to be under frameworks/support.

In turn this leads to build server having output files stored
outside of their out/ folder causing impact on builds.

Bug: 18024010

Change-Id: Ie856d172bc74acb6cf827cfc2536be01f8b04d97
diff --git a/build.gradle b/build.gradle
index 401a3f5..79896f5 100644
--- a/build.gradle
+++ b/build.gradle
@@ -22,8 +22,8 @@
  * The build server will copy the contents of DIST_DIR to somewhere and make it available.
  */
 if (System.env.DIST_DIR != null && System.env.OUT_DIR != null) {
-    buildDir = file(System.env.OUT_DIR + '/gradle/frameworks/support/build')
-    project.ext.distDir = file(System.env.DIST_DIR)
+    buildDir = new File(System.env.OUT_DIR + '/gradle/frameworks/support/build').getCanonicalFile()
+    project.ext.distDir = new File(System.env.DIST_DIR).getCanonicalFile()
 } else {
     buildDir = file('../../out/host/gradle/frameworks/support/build')
     project.ext.distDir = file('../../out/dist')