From ee1c21434614466a3d40387ec110e58e41568b55 Mon Sep 17 00:00:00 2001 From: Cedric Beust Date: Thu, 19 May 2016 22:22:07 -0800 Subject: [PATCH] Default group. --- .../main/kotlin/com/beust/kobalt/api/TaskContributor.kt | 5 +++-- .../kotlin/com/beust/kobalt/api/annotation/Annotations.kt | 8 ++++++-- 2 files changed, 9 insertions(+), 4 deletions(-) diff --git a/modules/kobalt-plugin-api/src/main/kotlin/com/beust/kobalt/api/TaskContributor.kt b/modules/kobalt-plugin-api/src/main/kotlin/com/beust/kobalt/api/TaskContributor.kt index 2cae53fa..7fa33775 100644 --- a/modules/kobalt-plugin-api/src/main/kotlin/com/beust/kobalt/api/TaskContributor.kt +++ b/modules/kobalt-plugin-api/src/main/kotlin/com/beust/kobalt/api/TaskContributor.kt @@ -3,6 +3,7 @@ package com.beust.kobalt.api import com.beust.kobalt.IncrementalTaskInfo import com.beust.kobalt.TaskResult import com.beust.kobalt.Variant +import com.beust.kobalt.api.annotation.AnnotationDefault import com.beust.kobalt.internal.IncrementalManager import com.google.inject.Inject @@ -23,7 +24,7 @@ class TaskContributor @Inject constructor(val incrementalManagerFactory: Increme * depends on variants of that task. */ fun addVariantTasks(plugin: IPlugin, project: Project, context: KobaltContext, taskName: String, - group: String, + group: String = AnnotationDefault.GROUP, dependsOn: List = emptyList(), reverseDependsOn : List = emptyList(), runBefore : List = emptyList(), @@ -44,7 +45,7 @@ class TaskContributor @Inject constructor(val incrementalManagerFactory: Increme } fun addIncrementalVariantTasks(plugin: IPlugin, project: Project, context: KobaltContext, taskName: String, - group: String, + group: String = AnnotationDefault.GROUP, dependsOn: List = emptyList(), reverseDependsOn : List = emptyList(), runBefore : List = emptyList(), diff --git a/modules/kobalt-plugin-api/src/main/kotlin/com/beust/kobalt/api/annotation/Annotations.kt b/modules/kobalt-plugin-api/src/main/kotlin/com/beust/kobalt/api/annotation/Annotations.kt index baa87322..f4269d47 100644 --- a/modules/kobalt-plugin-api/src/main/kotlin/com/beust/kobalt/api/annotation/Annotations.kt +++ b/modules/kobalt-plugin-api/src/main/kotlin/com/beust/kobalt/api/annotation/Annotations.kt @@ -6,6 +6,10 @@ package com.beust.kobalt.api.annotation */ annotation class Directive +object AnnotationDefault { + const val GROUP = "other" +} + @Retention(AnnotationRetention.RUNTIME) annotation class Task( /* This task's name */ @@ -15,7 +19,7 @@ annotation class Task( val description: String = "", /** Used to show the task in the correct group in the IDE */ - val group: String = "other", + val group: String = AnnotationDefault.GROUP, /** Dependency: tasks this task depends on */ val dependsOn: Array = arrayOf(), @@ -42,7 +46,7 @@ annotation class IncrementalTask( val description: String = "", /** Used to show the task in the correct group in the IDE */ - val group: String = "other", + val group: String = AnnotationDefault.GROUP, /** Dependency: tasks this task depends on */ val dependsOn: Array = arrayOf(),