Update JDK tools jar lookup logic to use BuildUtils.

Change-Id: I18bbf607b18b41a69bcd33c08a83c35dbc510ca5
diff --git a/build.gradle b/build.gradle
index 79d856e..50c36d4 100644
--- a/build.gradle
+++ b/build.gradle
@@ -1,5 +1,7 @@
 apply plugin: 'java'
 
+import com.android.internal.BuildUtils
+
 sourceSets {
     main {
         java {
@@ -10,20 +12,9 @@
         }
     }
 }
-// TODO put this function in a plugin
-String findToolsJar() {
-    new ByteArrayOutputStream().withStream { os ->
-        project.exec {
-            executable "$rootDir/build/core/find-jdk-tools-jar.sh"
-
-            standardOutput = os
-        }
-        return os.toString().trim()
-    }
-}
 
 dependencies {
-    compile files(findToolsJar())
+    compile files(BuildUtils.findToolsJar(project))
     compile project(path: ':antlr', configuration: 'antlrRuntime')
     compile project(':jsilver')
     compile project(':tagsoup')