From bb6f9e115f78a84a9c397ecee4523d440408c638 Mon Sep 17 00:00:00 2001 From: Cedric Beust Date: Sun, 15 Nov 2015 12:36:48 -0800 Subject: [PATCH] Documentation for the properties. --- .../kobalt/api/annotation/Annotations.kt | 33 +++++++++++++------ .../kobalt/internal/JvmCompilerPlugin.kt | 2 +- .../plugin/packaging/PackagingPlugin.kt | 7 ++-- 3 files changed, 28 insertions(+), 14 deletions(-) diff --git a/src/main/kotlin/com/beust/kobalt/api/annotation/Annotations.kt b/src/main/kotlin/com/beust/kobalt/api/annotation/Annotations.kt index dfc853f8..5b064b0d 100644 --- a/src/main/kotlin/com/beust/kobalt/api/annotation/Annotations.kt +++ b/src/main/kotlin/com/beust/kobalt/api/annotation/Annotations.kt @@ -7,28 +7,41 @@ package com.beust.kobalt.api.annotation annotation class Directive @Retention(AnnotationRetention.RUNTIME) -annotation class Task(val name: String, - val description: String, +annotation class Task( + val name: String, + val description: String, - /** Tasks that this task depends on */ - val runBefore: Array = arrayOf(), + /** Tasks that this task depends on */ + val runBefore: Array = arrayOf(), - /** Tasks that this task will run after if they get run */ - val runAfter: Array = arrayOf(), + /** Tasks that this task will run after if they get run */ + val runAfter: Array = arrayOf(), - /** Tasks that this task will always run after */ - val alwaysRunAfter: Array = arrayOf() + /** Tasks that this task will always run after */ + val alwaysRunAfter: Array = arrayOf() ) /** * Plugins that export properties should annotate those with this annotation so they can be documented. */ @Retention(AnnotationRetention.RUNTIME) -annotation class ExportedPluginProperty +annotation class ExportedPluginProperty( + /** Documentation for this property */ + val doc: String = "", + + /** The type of this property */ + val type: String = "" +) /** * Plugins that export properties on the Project instance should annotate those with this annotation so * they can be documented. */ @Retention(AnnotationRetention.RUNTIME) -annotation class ExportedProjectProperty +annotation class ExportedProjectProperty( + /** Documentation for this property */ + val doc: String = "", + + /** The type of this property */ + val type: String = "" +) diff --git a/src/main/kotlin/com/beust/kobalt/internal/JvmCompilerPlugin.kt b/src/main/kotlin/com/beust/kobalt/internal/JvmCompilerPlugin.kt index 06bba05b..c4398b4d 100644 --- a/src/main/kotlin/com/beust/kobalt/internal/JvmCompilerPlugin.kt +++ b/src/main/kotlin/com/beust/kobalt/internal/JvmCompilerPlugin.kt @@ -26,7 +26,7 @@ abstract class JvmCompilerPlugin @Inject constructor( open val jvmCompiler: JvmCompiler) : BasePlugin() { companion object { - @ExportedProjectProperty + @ExportedProjectProperty(doc = "The location of the build directory", type = "String") const val BUILD_DIR = "buildDir" const val TASK_CLEAN = "clean" diff --git a/src/main/kotlin/com/beust/kobalt/plugin/packaging/PackagingPlugin.kt b/src/main/kotlin/com/beust/kobalt/plugin/packaging/PackagingPlugin.kt index 1e79bf76..f0aa0d17 100644 --- a/src/main/kotlin/com/beust/kobalt/plugin/packaging/PackagingPlugin.kt +++ b/src/main/kotlin/com/beust/kobalt/plugin/packaging/PackagingPlugin.kt @@ -39,13 +39,14 @@ class PackagingPlugin @Inject constructor(val dependencyManager : DependencyMana companion object { const val PLUGIN_NAME = "packaging" - @ExportedProjectProperty + @ExportedProjectProperty(doc = "Where the libraries are saved", type = "String") const val LIBS_DIR = "libsDir" - @ExportedProjectProperty + @ExportedProjectProperty(doc = "The name of the jar file", type = "String") const val JAR_NAME = "jarName" - @ExportedProjectProperty + @ExportedProjectProperty(doc = "The list of packages produced for this project", + type = "List") const val PACKAGES = "packages" const val TASK_ASSEMBLE: String = "assemble"