From 74e65a1ef5f7a29e41aff536faccf87e337219ce Mon Sep 17 00:00:00 2001 From: Cedric Beust Date: Sat, 6 Feb 2016 01:05:07 +0400 Subject: [PATCH] Fix the empty dependency bugs. This code used to work pre-RC but the RC seems to scope closure fields differently so that fields were being assigned to themselves. --- .../beust/kobalt/maven/dependency/MavenDependency.kt | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/modules/kobalt-plugin-api/src/main/kotlin/com/beust/kobalt/maven/dependency/MavenDependency.kt b/modules/kobalt-plugin-api/src/main/kotlin/com/beust/kobalt/maven/dependency/MavenDependency.kt index c034213e..75e23bfd 100644 --- a/modules/kobalt-plugin-api/src/main/kotlin/com/beust/kobalt/maven/dependency/MavenDependency.kt +++ b/modules/kobalt-plugin-api/src/main/kotlin/com/beust/kobalt/maven/dependency/MavenDependency.kt @@ -63,11 +63,11 @@ public class MavenDependency @Inject constructor(mavenId: MavenId, override val id = mavenId.toId - override fun toMavenDependencies(): Dependency { - return Dependency().apply { - setGroupId(groupId) - setArtifactId(artifactId) - setVersion(version) + override fun toMavenDependencies() = let { md -> + Dependency().apply { + groupId = md.groupId + artifactId = md.artifactId + version = md.version } }