CompilerDependencies

Holds reference to runtime.jar and jdk-headers.jar. Paths to these
jars are no longer hardcoded.

Many tests now compile runtime before execution. Because of this:
* Single test invocation is significantly slower now for some tests
* This can be fixed by making tests independent from runtime (this
must be done anyway)

Some tests still depend on runtime.jar built by "ant dist", this
is to be fixed.
This commit is contained in:
Stepan Koltsov
2012-04-09 03:04:50 +04:00
parent aae7ba734d
commit 10dd366216
48 changed files with 422 additions and 128 deletions
@@ -77,7 +77,7 @@ public class PathUtil {
File compilerPath = getDefaultCompilerPath();
if (compilerPath == null) return null;
File answer = new File(compilerPath, "lib/alt");
File answer = new File(compilerPath, "lib/alt/kotlin-jdk-headers.jar");
return answer.exists() ? answer : null;
}
@@ -94,10 +94,18 @@ public class PathUtil {
if (alts != null) {
for (File root : alts.listFiles()) {
VirtualFile jarRoot = VirtualFileManager.getInstance().findFileByUrl("jar://" + root.getPath() + "!/");
VirtualFile jarRoot = jarFileToVirtualFile(root);
roots.add(jarRoot);
}
}
return roots;
}
@NotNull
public static VirtualFile jarFileToVirtualFile(@NotNull File file) {
if (!file.exists() || !file.isFile()) {
throw new IllegalStateException("file must exist and be regular to be converted to virtual file: " + file);
}
return VirtualFileManager.getInstance().findFileByUrl("jar://" + file.getPath() + "!/");
}
}