1
0
Fork 0
mirror of https://github.com/ethauvin/kobalt.git synced 2025-04-26 08:27:12 -07:00

Refactor.

This commit is contained in:
Cedric Beust 2015-10-30 13:11:31 -07:00
parent 6c4b97fcfd
commit fa03846a07
3 changed files with 5 additions and 10 deletions

View file

@ -22,9 +22,8 @@ class JvmCompiler @Inject constructor(val dependencyManager: DependencyManager)
: TaskResult {
File(info.outputDir).mkdirs()
val allDependencies = arrayListOf<IClasspathDependency>()
allDependencies.addAll(info.dependencies)
allDependencies.addAll(calculateDependencies(project, context, info.dependencies))
val allDependencies = info.dependencies + calculateDependencies(project, context, info.dependencies)
validateClasspath(allDependencies.map { it.jarFile.get().absolutePath })
return action.compile(info.copy(dependencies = allDependencies))
}

View file

@ -163,9 +163,8 @@ public class BuildFileCompiler @Inject constructor(@Assisted("buildFiles") val b
private fun parseBuildScriptJarFile(buildScriptJarFile: File, urls: List<URL>) : BuildScriptInfo {
val projects = arrayListOf<Project>()
var stream : InputStream? = null
val allUrls = arrayListOf<URL>().plus(urls).plus(arrayOf(
buildScriptJarFile.toURI().toURL(),
File(files.kobaltJar).toURI().toURL()))
val allUrls = (urls + arrayOf(
buildScriptJarFile.toURI().toURL()) + File(files.kobaltJar).toURI().toURL())
.toTypedArray()
val classLoader = URLClassLoader(allUrls)

View file

@ -71,10 +71,7 @@ class KotlinCompiler @Inject constructor(val localRepo : LocalRepo,
getKotlinCompilerJar("kotlin-compiler-embeddable"))
.map { FileDependency(it) }
val dependencies = arrayListOf<IClasspathDependency>()
.plus(compileDependencies)
.plus(classpathList)
.plus(otherClasspath.map { FileDependency(it)})
val dependencies = compileDependencies + classpathList + otherClasspath.map { FileDependency(it)}
val info = CompilerActionInfo(dependencies, source, outputDir, args)
return jvmCompiler.doCompile(project, context, compilerAction, info)
}