Rename variable
This commit is contained in:
+9
-9
@@ -67,30 +67,30 @@ public class KotlinToJVMBytecodeCompiler {
|
||||
}
|
||||
|
||||
@Nullable
|
||||
public static ClassFileFactory compileModule(CompilerConfiguration configuration, Module moduleBuilder, File directory) {
|
||||
if (moduleBuilder.getSourceFiles().isEmpty()) {
|
||||
throw new CompileEnvironmentException("No source files where defined in module " + moduleBuilder.getModuleName());
|
||||
public static ClassFileFactory compileModule(CompilerConfiguration configuration, Module module, File directory) {
|
||||
if (module.getSourceFiles().isEmpty()) {
|
||||
throw new CompileEnvironmentException("No source files where defined in module " + module.getModuleName());
|
||||
}
|
||||
|
||||
CompilerConfiguration compilerConfiguration = configuration.copy();
|
||||
for (String sourceFile : moduleBuilder.getSourceFiles()) {
|
||||
for (String sourceFile : module.getSourceFiles()) {
|
||||
File source = new File(sourceFile);
|
||||
if (!source.isAbsolute()) {
|
||||
source = new File(directory, sourceFile);
|
||||
}
|
||||
|
||||
if (!source.exists()) {
|
||||
throw new CompileEnvironmentException("'" + source + "' does not exist in module " + moduleBuilder.getModuleName());
|
||||
throw new CompileEnvironmentException("'" + source + "' does not exist in module " + module.getModuleName());
|
||||
}
|
||||
|
||||
compilerConfiguration.add(CommonConfigurationKeys.SOURCE_ROOTS_KEY, source.getPath());
|
||||
}
|
||||
|
||||
for (String classpathRoot : moduleBuilder.getClasspathRoots()) {
|
||||
for (String classpathRoot : module.getClasspathRoots()) {
|
||||
compilerConfiguration.add(JVMConfigurationKeys.CLASSPATH_KEY, new File(classpathRoot));
|
||||
}
|
||||
|
||||
for (String annotationsRoot : moduleBuilder.getAnnotationsRoots()) {
|
||||
for (String annotationsRoot : module.getAnnotationsRoots()) {
|
||||
compilerConfiguration.add(JVMConfigurationKeys.ANNOTATIONS_PATH_KEY, new File(annotationsRoot));
|
||||
}
|
||||
|
||||
@@ -131,8 +131,8 @@ public class KotlinToJVMBytecodeCompiler {
|
||||
@Nullable File jarPath,
|
||||
boolean jarRuntime
|
||||
) {
|
||||
for (Module moduleBuilder : modules.getModules()) {
|
||||
ClassFileFactory moduleFactory = compileModule(configuration, moduleBuilder, directory);
|
||||
for (Module module : modules.getModules()) {
|
||||
ClassFileFactory moduleFactory = compileModule(configuration, module, directory);
|
||||
if (moduleFactory == null) {
|
||||
return false;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user