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