From 3664a3b2fcce480a624df96093748e69180fffd0 Mon Sep 17 00:00:00 2001 From: Andrey Breslav Date: Fri, 2 Mar 2012 16:14:10 +0400 Subject: [PATCH] Temporary solution for the case where the user has two different JDKs: one in java.home, and the other configured in the project. In this case, we used to take the java.home one first and ignore project settings, because the classpath was shared between the module script compilation and the module compilation. --- .../jetbrains/jet/compiler/CompileEnvironment.java | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/compiler/cli/src/org/jetbrains/jet/compiler/CompileEnvironment.java b/compiler/cli/src/org/jetbrains/jet/compiler/CompileEnvironment.java index 833bbf8a885..187e6649fbc 100644 --- a/compiler/cli/src/org/jetbrains/jet/compiler/CompileEnvironment.java +++ b/compiler/cli/src/org/jetbrains/jet/compiler/CompileEnvironment.java @@ -167,20 +167,21 @@ public class CompileEnvironment { return null; } - public boolean compileModuleScript(String moduleFile, @Nullable String jarPath, @Nullable String outputDir, boolean jarRuntime) { - List modules = loadModuleScript(moduleFile); + public boolean compileModuleScript(String moduleScriptFile, @Nullable String jarPath, @Nullable String outputDir, boolean jarRuntime) { + List modules = loadModuleScript(moduleScriptFile); if (modules == null) { - throw new CompileEnvironmentException("Module script " + moduleFile + " compilation failed"); + throw new CompileEnvironmentException("Module script " + moduleScriptFile + " compilation failed"); } if (modules.isEmpty()) { - throw new CompileEnvironmentException("No modules where defined by " + moduleFile); + throw new CompileEnvironmentException("No modules where defined by " + moduleScriptFile); } - final String directory = new File(moduleFile).getParent(); + final String directory = new File(moduleScriptFile).getParent(); for (Module moduleBuilder : modules) { - ClassFileFactory moduleFactory = compileModule(moduleBuilder, directory); + CompileEnvironment compileEnvironment = new CompileEnvironment(myFileNameTransformer, myMessageRenderer); + ClassFileFactory moduleFactory = compileEnvironment.compileModule(moduleBuilder, directory); if (moduleFactory == null) { return false; }