From 48feda51ad354f4ec8faf35a24e70af19c8f58c6 Mon Sep 17 00:00:00 2001 From: Cedric Beust Date: Tue, 9 Feb 2016 23:56:57 +0400 Subject: [PATCH] Helper functions. --- .../src/main/kotlin/com/beust/kobalt/api/Project.kt | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/modules/kobalt-plugin-api/src/main/kotlin/com/beust/kobalt/api/Project.kt b/modules/kobalt-plugin-api/src/main/kotlin/com/beust/kobalt/api/Project.kt index 31b0b2cb..4cf4e272 100644 --- a/modules/kobalt-plugin-api/src/main/kotlin/com/beust/kobalt/api/Project.kt +++ b/modules/kobalt-plugin-api/src/main/kotlin/com/beust/kobalt/api/Project.kt @@ -2,9 +2,11 @@ package com.beust.kobalt.api import com.beust.kobalt.TestConfig import com.beust.kobalt.api.annotation.Directive +import com.beust.kobalt.internal.JvmCompilerPlugin import com.beust.kobalt.maven.dependency.MavenDependency import com.beust.kobalt.misc.KFiles import com.beust.kobalt.misc.log +import com.beust.kobalt.project import java.io.File import java.util.* @@ -67,13 +69,12 @@ open class Project( val projectProperties = ProjectProperties() - override fun equals(other: Any?): Boolean { - return name == (other as Project).name - } + override fun equals(other: Any?) = name == (other as Project).name + override fun hashCode() = name.hashCode() - override fun hashCode(): Int { - return name.hashCode() - } + /** Can be used by plug-ins */ + val dependentProjects : List + get() = projectProperties.get(JvmCompilerPlugin.DEPENDENT_PROJECTS) as List companion object { val DEFAULT_SOURCE_DIRECTORIES = setOf("src/main/java", "src/main/kotlin", "src/main/resources")