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

Comments.

This commit is contained in:
Cedric Beust 2015-12-06 08:09:44 -08:00
parent 9c62a4e90d
commit e93f4ba85f

View file

@ -27,11 +27,14 @@ class RetrolambdaPlugin @Inject constructor(val dependencyManager: DependencyMan
companion object { companion object {
const val PLUGIN_NAME = "Retrolambda" const val PLUGIN_NAME = "Retrolambda"
// Note the use of the versionless id here (no version number specified, ends with ":") so that
// we will always be using the latest version of the Retrolambda jar
const val ID = "net.orfjackal.retrolambda:retrolambda:" const val ID = "net.orfjackal.retrolambda:retrolambda:"
val JAR = MavenDependency.create(ID) val JAR = MavenDependency.create(ID)
} }
// IClasspathContributor // IClasspathContributor
// Only add the Retrolambda jar file if the user specified a `retrolambda{}` directive in their build file
override fun entriesFor(project: Project?) = override fun entriesFor(project: Project?) =
if (project != null && configurationFor(project) != null) listOf(JAR) if (project != null && configurationFor(project) != null) listOf(JAR)
else emptyList() else emptyList()
@ -40,7 +43,8 @@ class RetrolambdaPlugin @Inject constructor(val dependencyManager: DependencyMan
alwaysRunAfter = arrayOf(JvmCompilerPlugin.TASK_COMPILE)) alwaysRunAfter = arrayOf(JvmCompilerPlugin.TASK_COMPILE))
fun taskRetrolambda(project: Project): TaskResult { fun taskRetrolambda(project: Project): TaskResult {
val config = configurationFor(project) val config = configurationFor(project)
val result = if (config != null) { val result =
if (config != null) {
val classpath = dependencyManager.transitiveClosure(project.compileDependencies).map { val classpath = dependencyManager.transitiveClosure(project.compileDependencies).map {
it.jarFile.get() it.jarFile.get()
}.joinToString(File.separator) }.joinToString(File.separator)