From 16ea203a7900daea2160d7314152b6f954bbf472 Mon Sep 17 00:00:00 2001 From: Citymonstret Date: Mon, 6 Jun 2022 21:32:14 +0200 Subject: [PATCH] docs: add annotation processing instructions --- docs/README.adoc | 68 ++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 68 insertions(+) diff --git a/docs/README.adoc b/docs/README.adoc index 1e1509e6..e7fffb91 100644 --- a/docs/README.adoc +++ b/docs/README.adoc @@ -37,6 +37,7 @@ https://javadoc.io/doc/cloud.commandframework[JavaDocs] and use them as the prim Cloud is available through https://search.maven.org/search?q=cloud.commandframework[Maven Central]. +*Maven* [source,xml,subs="attributes,verbatim"] ---- @@ -46,6 +47,18 @@ Cloud is available through https://search.maven.org/search?q=cloud.commandframew ---- +*Gradle (Groovy)* +[source,groovy,subs="attributes,verbatim"] +---- +implementation 'cloud.commandframework:cloud-core:{cloud-version}' +---- + +*Gradle (Kotlin)* +[source,kotlin,subs="attributes,verbatim"] +---- +implementation("cloud.commandframework:cloud-core:{cloud-version}") +---- + If you want to use snapshot builds, then they are available the Sonatype snapshots repository: [source,xml] @@ -699,6 +712,58 @@ Annotations allow for an alternative way of declaring commands in cloud. Instead using builders, commands consist of annotated instance methods. Command arguments will be bound to the method parameters, instead of being retrieved through the command context. +NOTE: Since version 1.7.0, `cloud-annotations` will now also perform +annotation processing, verifying that `@CommandMethod` annotated methods +have valid signatures, etc. + +=== Install + +In order to use the annotation parser & annotation processor, you need to +add `cloud-annotations` as a dependency: + +*Maven* +[source,xml,subs="attributes,verbatim"] +---- + + cloud.commandframework + cloud-annotations + {cloud-version} + + + + + + org.apache.maven.plugins + maven-compiler-plugin + + + + cloud.commandframework + cloud-annotations + {cloud-version} + + + + + + +---- + +*Gradle (Groovy)* +[source,groovy,subs="attributes,verbatim"] +---- +implementation 'cloud.commandframework:cloud-annotations:{cloud-version}' +annotationProcessor 'cloud.commandframework:cloud-annotations:{cloud-version}' +---- + +*Gradle (Kotlin)* +[source,kotlin,subs="attributes,verbatim"] +---- +implementation("cloud.commandframework:cloud-annotations:{cloud-version}") +annotationProcessor("cloud.commandframework:cloud-annotations:{cloud-version}") +---- + + === Annotation Parser In order to work with annotated command methods you need to construct an annotation parser. @@ -953,6 +1018,9 @@ annotationParser.registerPreprocessorMapper( ); ---- +=== @CommandContainer +TODO + == Kotlin DSL TODO