From 1ac48967171ed258bf2e9669ab4f0619b99b8e64 Mon Sep 17 00:00:00 2001 From: Cedric Beust Date: Tue, 23 Feb 2016 06:15:13 -0800 Subject: [PATCH] Constants. --- .../kotlin/com/beust/kobalt/api/ITemplateContributor.kt | 4 ++++ .../kotlin/com/beust/kobalt/app/KobaltPluginTemplate.kt | 8 ++++++-- 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/modules/kobalt-plugin-api/src/main/kotlin/com/beust/kobalt/api/ITemplateContributor.kt b/modules/kobalt-plugin-api/src/main/kotlin/com/beust/kobalt/api/ITemplateContributor.kt index 38938ee3..5d469df4 100644 --- a/modules/kobalt-plugin-api/src/main/kotlin/com/beust/kobalt/api/ITemplateContributor.kt +++ b/modules/kobalt-plugin-api/src/main/kotlin/com/beust/kobalt/api/ITemplateContributor.kt @@ -7,6 +7,10 @@ import com.beust.kobalt.Args * a new project). */ interface ITemplateContributor { + companion object { + val DIRECTORY_NAME = "templates" + } + val templates: List } diff --git a/src/main/kotlin/com/beust/kobalt/app/KobaltPluginTemplate.kt b/src/main/kotlin/com/beust/kobalt/app/KobaltPluginTemplate.kt index 1d171dc0..fbf58d59 100644 --- a/src/main/kotlin/com/beust/kobalt/app/KobaltPluginTemplate.kt +++ b/src/main/kotlin/com/beust/kobalt/app/KobaltPluginTemplate.kt @@ -8,10 +8,14 @@ import com.beust.kobalt.plugin.KobaltPlugin * Template that generates a Kobalt plug-in project. */ class KobaltPluginTemplate : ITemplateContributor { - val pluginTemplate = object: JarTemplate("templates/kobaltPlugin/kobaltPlugin.jar") { + companion object { + val NAME = "kobaltPlugin" + } + + val pluginTemplate = object: JarTemplate(ITemplateContributor.DIRECTORY_NAME + "/" + NAME) { override val templateDescription = "Generate a sample Kobalt plug-in project" - override val templateName = "kobaltPlugin" + override val templateName = NAME override val pluginName = KobaltPlugin.PLUGIN_NAME }