Revert "Use absolute path when compiling with new gradle setup"

This reverts commit e0f606e917cdd9be7cbffee2c3a9f2c2be5c4421.

Reason for revert: Failing with our old build.

Change-Id: Ibf2752ba1986957becdbdab70c8ec57bb331dc2a
diff --git a/.gitignore b/.gitignore
index 510d12c..13e30c3 100644
--- a/.gitignore
+++ b/.gitignore
@@ -18,12 +18,10 @@
 build/
 buildSrc/out/
 src/*/out
-d8_r8/*/out
 gradle-app.setting
 gradle/*
 gradlew
 gradlew.bat
-d8_r8/gradle*
 local.properties
 r8.ipr
 r8.iws
diff --git a/src/test/java/com/android/tools/r8/KotlinCompilerTool.java b/src/test/java/com/android/tools/r8/KotlinCompilerTool.java
index 7c5ceff..259f1a0 100644
--- a/src/test/java/com/android/tools/r8/KotlinCompilerTool.java
+++ b/src/test/java/com/android/tools/r8/KotlinCompilerTool.java
@@ -17,7 +17,6 @@
 import com.android.tools.r8.utils.ArrayUtils;
 import com.android.tools.r8.utils.FileUtils;
 import com.android.tools.r8.utils.structural.Ordered;
-import java.io.File;
 import java.io.IOException;
 import java.nio.file.Files;
 import java.nio.file.Path;
@@ -368,7 +367,6 @@
     }
     cmdline.addAll(additionalArguments);
     ProcessBuilder builder = new ProcessBuilder(cmdline);
-    builder.directory(new File(ToolHelper.getProjectRoot()));
     return ToolHelper.runProcess(builder);
   }
 }
diff --git a/src/test/java/com/android/tools/r8/ToolHelper.java b/src/test/java/com/android/tools/r8/ToolHelper.java
index 592892a..51ed733 100644
--- a/src/test/java/com/android/tools/r8/ToolHelper.java
+++ b/src/test/java/com/android/tools/r8/ToolHelper.java
@@ -97,9 +97,9 @@
   }
 
   public static String getProjectRoot() {
-    String userDirProperty = System.getProperty("user.dir");
-    if (userDirProperty.endsWith("d8_r8/test")) {
-      return Paths.get(userDirProperty).getParent().getParent().toString() + "/";
+    String property = System.getProperty("user.dir");
+    if (property.endsWith("d8_r8/test")) {
+      return "../../";
     }
     return "";
   }
@@ -2273,7 +2273,7 @@
       throws IOException {
     boolean printCwd = builder.directory() != null;
     if (printCwd) {
-      out.println("(cd " + builder.directory() + "; ");
+      out.println("(cd " + builder.directory().toString() + "; ");
     }
     String command = String.join(" ", builder.command());
     out.println(command);