From fd2d59c3340b16c6f6f63e81f2f71feb6f9e4219 Mon Sep 17 00:00:00 2001 From: Oleg Zhurakousky Date: Mon, 3 Dec 2018 14:01:29 +0100 Subject: [PATCH] Updated Kotlin docs --- .../main/asciidoc/spring-cloud-function.adoc | 5 +- spring-cloud-function-kotlin/pom.xml | 126 ++++++++++-------- 2 files changed, 71 insertions(+), 60 deletions(-) diff --git a/docs/src/main/asciidoc/spring-cloud-function.adoc b/docs/src/main/asciidoc/spring-cloud-function.adoc index 7ff00a7b9..103d919af 100644 --- a/docs/src/main/asciidoc/spring-cloud-function.adoc +++ b/docs/src/main/asciidoc/spring-cloud-function.adoc @@ -93,6 +93,9 @@ The above represents Kotlin lambdas configured as Spring beans. The signature of While mechanics of Kotlin-to-Java mapping are outside of the scope of this documentation, it is important to understand that the same rules for signature transformation outlined in "Java 8 function support" section are applied here as well. +To enable Kotlin support all you need is to add `spring-cloud-function-kotlin` module to your classpath which contains the appropriate +autoconfiguration and supporting classes. + == Standalone Web Applications The `spring-cloud-function-web` module has autoconfiguration that @@ -110,7 +113,7 @@ plain text and JSON. |=== | Method | Path | Request | Response | Status -| GET | /{supplier} | - | Items from the named supplier | 200 OK +| GET | /{supplier} | - | Items from the named supplier | 200 OK | POST | /{consumer} | JSON object or text | Mirrors input and pushes request body into consumer | 202 Accepted | POST | /{consumer} | JSON array or text with new lines | Mirrors input and pushes body into consumer one by one | 202 Accepted | POST | /{function} | JSON object or text | The result of applying the named function | 200 OK diff --git a/spring-cloud-function-kotlin/pom.xml b/spring-cloud-function-kotlin/pom.xml index 33ce70101..1cff2a4e4 100644 --- a/spring-cloud-function-kotlin/pom.xml +++ b/spring-cloud-function-kotlin/pom.xml @@ -1,5 +1,6 @@ - 4.0.0 @@ -19,6 +20,10 @@ org.springframework.cloud spring-cloud-function-context + + org.jetbrains.kotlin + kotlin-stdlib-jdk8 + org.springframework.boot spring-boot-starter-test @@ -29,69 +34,72 @@ spring-boot-configuration-processor true - - org.jetbrains.kotlin - kotlin-stdlib-jdk8 - true - - kotlin-maven-plugin - org.jetbrains.kotlin - 1.2.71 - - - compile - compile - - - ${project.basedir}/src/main/kotlin - ${project.basedir}/src/main/java - - - - - test-compile - test-compile - - - ${project.basedir}/src/test/kotlin - ${project.basedir}/src/test/java - - - - - - - org.apache.maven.plugins - maven-compiler-plugin - 3.5.1 - - - - default-compile - none - - - - default-testCompile - none - - - java-compile - compile - compile - - - java-test-compile - test-compile - testCompile - - - + kotlin-maven-plugin + org.jetbrains.kotlin + 1.2.71 + + + compile + + compile + + + + ${project.basedir}/src/main/kotlin + ${project.basedir}/src/main/java + + + + + test-compile + + test-compile + + + + ${project.basedir}/src/test/kotlin + ${project.basedir}/src/test/java + + + + + + + org.apache.maven.plugins + maven-compiler-plugin + 3.5.1 + + + + default-compile + none + + + + default-testCompile + none + + + java-compile + compile + + compile + + + + java-test-compile + test-compile + + testCompile + + + +