From d14e38c7d60c3fefc30b34c95232fb0e0bcf0786 Mon Sep 17 00:00:00 2001 From: Maxim Shafirov Date: Mon, 30 Jan 2012 21:07:12 +0400 Subject: [PATCH] Detect alt headers in locally built kompiler --- .../src/org/jetbrains/jet/plugin/compiler/PathUtil.java | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/compiler/util/src/org/jetbrains/jet/plugin/compiler/PathUtil.java b/compiler/util/src/org/jetbrains/jet/plugin/compiler/PathUtil.java index b749aa871d3..cdf588d09a4 100644 --- a/compiler/util/src/org/jetbrains/jet/plugin/compiler/PathUtil.java +++ b/compiler/util/src/org/jetbrains/jet/plugin/compiler/PathUtil.java @@ -30,6 +30,14 @@ public class PathUtil { File answer = lib.getParentFile(); return answer.exists() ? answer : null; } + + File current = new File("").getAbsoluteFile(); // CWD + + do { + File atDevHome = new File(current, "dist/kotlinc"); + if (atDevHome.exists()) return atDevHome; + current = current.getParentFile(); + } while (current != null); return null; }