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

Better look up of the compiler jar file.

This commit is contained in:
Cedric Beust 2016-06-07 22:32:12 -08:00
parent a83e1f4a7d
commit 82b5c636d0
3 changed files with 32 additions and 5 deletions

View file

@ -0,0 +1,21 @@
package com.beust.kobalt.internal
import com.beust.kobalt.maven.DependencyManager
import com.google.inject.Inject
import java.io.File
/**
* The jar files that Kotlin needs to run.
*/
class KotlinJarFiles @Inject constructor(val dependencyManager: DependencyManager,
val settings: KobaltSettings){
private fun getKotlinCompilerJar(name: String): File {
val id = "org.jetbrains.kotlin:kotlin-$name:${settings.kobaltCompilerVersion}"
val dep = dependencyManager.create(id)
return dep.jarFile.get().absoluteFile
}
val stdlib: File get() = getKotlinCompilerJar("stdlib")
val runtime: File get() = getKotlinCompilerJar("runtime")
val compiler: File get() = getKotlinCompilerJar("compiler-embeddable")
}