mirror of
https://github.com/ethauvin/kobalt.git
synced 2025-04-27 00:38:11 -07:00
Refactor.
This commit is contained in:
parent
6c4b97fcfd
commit
fa03846a07
3 changed files with 5 additions and 10 deletions
|
@ -22,9 +22,8 @@ class JvmCompiler @Inject constructor(val dependencyManager: DependencyManager)
|
||||||
: TaskResult {
|
: TaskResult {
|
||||||
File(info.outputDir).mkdirs()
|
File(info.outputDir).mkdirs()
|
||||||
|
|
||||||
val allDependencies = arrayListOf<IClasspathDependency>()
|
val allDependencies = info.dependencies + calculateDependencies(project, context, info.dependencies)
|
||||||
allDependencies.addAll(info.dependencies)
|
|
||||||
allDependencies.addAll(calculateDependencies(project, context, info.dependencies))
|
|
||||||
validateClasspath(allDependencies.map { it.jarFile.get().absolutePath })
|
validateClasspath(allDependencies.map { it.jarFile.get().absolutePath })
|
||||||
return action.compile(info.copy(dependencies = allDependencies))
|
return action.compile(info.copy(dependencies = allDependencies))
|
||||||
}
|
}
|
||||||
|
|
|
@ -163,9 +163,8 @@ public class BuildFileCompiler @Inject constructor(@Assisted("buildFiles") val b
|
||||||
private fun parseBuildScriptJarFile(buildScriptJarFile: File, urls: List<URL>) : BuildScriptInfo {
|
private fun parseBuildScriptJarFile(buildScriptJarFile: File, urls: List<URL>) : BuildScriptInfo {
|
||||||
val projects = arrayListOf<Project>()
|
val projects = arrayListOf<Project>()
|
||||||
var stream : InputStream? = null
|
var stream : InputStream? = null
|
||||||
val allUrls = arrayListOf<URL>().plus(urls).plus(arrayOf(
|
val allUrls = (urls + arrayOf(
|
||||||
buildScriptJarFile.toURI().toURL(),
|
buildScriptJarFile.toURI().toURL()) + File(files.kobaltJar).toURI().toURL())
|
||||||
File(files.kobaltJar).toURI().toURL()))
|
|
||||||
.toTypedArray()
|
.toTypedArray()
|
||||||
val classLoader = URLClassLoader(allUrls)
|
val classLoader = URLClassLoader(allUrls)
|
||||||
|
|
||||||
|
|
|
@ -71,10 +71,7 @@ class KotlinCompiler @Inject constructor(val localRepo : LocalRepo,
|
||||||
getKotlinCompilerJar("kotlin-compiler-embeddable"))
|
getKotlinCompilerJar("kotlin-compiler-embeddable"))
|
||||||
.map { FileDependency(it) }
|
.map { FileDependency(it) }
|
||||||
|
|
||||||
val dependencies = arrayListOf<IClasspathDependency>()
|
val dependencies = compileDependencies + classpathList + otherClasspath.map { FileDependency(it)}
|
||||||
.plus(compileDependencies)
|
|
||||||
.plus(classpathList)
|
|
||||||
.plus(otherClasspath.map { FileDependency(it)})
|
|
||||||
val info = CompilerActionInfo(dependencies, source, outputDir, args)
|
val info = CompilerActionInfo(dependencies, source, outputDir, args)
|
||||||
return jvmCompiler.doCompile(project, context, compilerAction, info)
|
return jvmCompiler.doCompile(project, context, compilerAction, info)
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue