From d59320295994ffc622e1245869d021883cb6ea6d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=B8ren=20Berg=20Glasius?= Date: Thu, 2 Dec 2021 17:02:41 +0100 Subject: [PATCH] Documentation adjusted, GH Action fine-tuned. Hoping for the best --- .github/workflows/release.yml | 9 +-- gradle.properties | 4 +- src/docs/asciidoc/api/.ignore | 0 src/docs/asciidoc/examples.adoc | 104 ++++++++++++++++++++++++ src/docs/asciidoc/index.adoc | 10 ++- src/docs/asciidoc/installation.adoc | 11 +++ src/docs/asciidoc/introduction.adoc | 118 ---------------------------- 7 files changed, 130 insertions(+), 126 deletions(-) create mode 100644 src/docs/asciidoc/api/.ignore create mode 100644 src/docs/asciidoc/examples.adoc create mode 100644 src/docs/asciidoc/installation.adoc diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 4de30daa..ecf95c6a 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -38,8 +38,6 @@ jobs: echo "${SECRING_FILE}" | base64 -d > "${GITHUB_WORKSPACE}/secring.gpg" echo "Publishing Artifacts for $RELEASE_VERSION" (set -x; ./gradlew -Pversion="${RELEASE_VERSION}" -Psigning.secretKeyRingFile="${GITHUB_WORKSPACE}/secring.gpg" publishToSonatype closeAndReleaseSonatypeStagingRepository --no-daemon) - echo "Publishing Documentation" - ./gradlew asciidoctor -Pversion="${RELEASE_VERSION}" - name: Bump patch version by one uses: actions-ecosystem/action-bump-semver@v1 id: bump_semver @@ -48,7 +46,7 @@ jobs: level: patch - name: Set version in gradle.properties env: - NEXT_VERSION: ${{ steps.bump_semver.next_version }} + NEXT_VERSION: ${{ steps.bump_semver.new_version }} run: | echo "Preparing next snapshot" ./gradlew snapshotVersion -Pversion="${NEXT_VERSION}" @@ -62,7 +60,8 @@ jobs: - name: Build documentation env: RELEASE_VERSION: ${{ steps.get_version.outputs.version-without-v }} - run: ./gradlew asciidoctor -Pversion="${RELEASE_VERSION}" + run: | + ./gradlew asciidoctor -Pversion="${RELEASE_VERSION}" - name: Export Gradle Properties uses: micronaut-projects/github-actions/export-gradle-properties@master - name: Publish to Github Pages @@ -73,7 +72,7 @@ jobs: TARGET_REPOSITORY: ${{ github.repository }} GH_TOKEN: ${{ secrets.GH_TOKEN }} BRANCH: gh-pages - FOLDER: build/docs + FOLDER: build/asciidoc DOC_FOLDER: latest COMMIT_EMAIL: ${{ secrets.GIT_USER_EMAIL }} COMMIT_NAME: ${{ secrets.GIT_USER_NAME }} diff --git a/gradle.properties b/gradle.properties index 1ffb838e..2c31e4f9 100644 --- a/gradle.properties +++ b/gradle.properties @@ -1,3 +1,3 @@ -#Thu, 02 Dec 2021 15:11:36 +0000 -version=-SNAPSHOT +#Thu, 02 Dec 2021 16:56:19 +0100 +version=3.0.5-SNAPSHOT grailsVersion=4.0.11 diff --git a/src/docs/asciidoc/api/.ignore b/src/docs/asciidoc/api/.ignore new file mode 100644 index 00000000..e69de29b diff --git a/src/docs/asciidoc/examples.adoc b/src/docs/asciidoc/examples.adoc new file mode 100644 index 00000000..cf2fc090 --- /dev/null +++ b/src/docs/asciidoc/examples.adoc @@ -0,0 +1,104 @@ +The following are some simple examples to give you a feel for the plugin. + +=== Service Queue Listeners + +[source,groovy] +---- +class ListeningService { + + static exposes = ['jms'] + + def onMessage(message) { + assert message == 1 + } +} +---- + +[source,groovy] +---- +class SomeController { + + def jmsService + + def someAction = { + jmsService.send(service: 'listening', 1) + } +} +---- + +=== Service Method Queue Listeners + +[source,groovy] +---- +import grails.plugin.jms.Queue + +class ListeningService { + + static exposes = ['jms'] + + @Queue + def receive(message) { + assert message == 1 + } +} +---- + +[source,groovy] +---- +class SomeController { + + def jmsService + + def someAction = { + jmsService.send(service: 'listening', method: 'receive', 1) + } +} +---- + +=== Topic Listeners + +[source,groovy] +---- +import grails.plugin.jms.Subscriber + +class ListeningService { + + static exposes = ['jms'] + + @Subscriber + def newMessages(message) { + assert message == 1 + } +} +---- + +[source,groovy] +---- +class SomeController { + + def jmsService + + def someAction = { + jmsService.send(topic: 'newMessages', 1) + } +} +---- + +=== Post Processing Messages + +[source,groovy] +---- +import javax.jms.Message + +class SomeController { + + def jmsService + + def someAction = { + jmsService.send(service: 'initial', 1) { Message msg -> + msg.JMSReplyTo = createDestination(service: 'reply') + msg + } + } +} +---- diff --git a/src/docs/asciidoc/index.adoc b/src/docs/asciidoc/index.adoc index d3a63ffb..33394ef8 100644 --- a/src/docs/asciidoc/index.adoc +++ b/src/docs/asciidoc/index.adoc @@ -1,5 +1,5 @@ = JMS Plugin -:version: 3.0.1-SNAPSHOT +:version: x.y.z :source-highlighter: coderay :imagesdir: ./images @@ -8,6 +8,14 @@ include::introduction.adoc[] +[[installation]] +== Installation +include::installation.adoc[] + +[[examples]] +== Examples +include::examples.adoc[] + [[springJms]] == Spring JMS diff --git a/src/docs/asciidoc/installation.adoc b/src/docs/asciidoc/installation.adoc new file mode 100644 index 00000000..849c0dfc --- /dev/null +++ b/src/docs/asciidoc/installation.adoc @@ -0,0 +1,11 @@ + +The plugin is available on Maven Central and should be a dependency like this: + +[source,groovy,subs="attributes"] +---- +dependencies { + implementation 'io.github.gpc:jms:{version}' +} +---- + +In older versions of Gradle, replace `implementation` with `compile` diff --git a/src/docs/asciidoc/introduction.adoc b/src/docs/asciidoc/introduction.adoc index e0f62d1b..982dfa11 100644 --- a/src/docs/asciidoc/introduction.adoc +++ b/src/docs/asciidoc/introduction.adoc @@ -1,122 +1,4 @@ This plugin makes it easy to both send and receive JMS messages inside a Grails application. -== Include in project -The plugin is available on Maven Central and should be a dependency like this: -[source,groovy,subs="attributes"] ----- -dependencies { - compile 'io.github.gpc:jms:{version}' -} ----- - -In newer Gradle versions, replace `compile` with `implementation` - -== Examples - -The following are some simple examples to give you a feel for the plugin. - - -=== Service Queue Listeners - -[source,groovy] ----- -class ListeningService { - - static exposes = ['jms'] - - def onMessage(message) { - assert message == 1 - } -} ----- - -[source,groovy] ----- -class SomeController { - - def jmsService - - def someAction = { - jmsService.send(service: 'listening', 1) - } -} ----- - -=== Service Method Queue Listeners - -[source,groovy] ----- -import grails.plugin.jms.Queue - -class ListeningService { - - static exposes = ['jms'] - - @Queue - def receive(message) { - assert message == 1 - } -} ----- - -[source,groovy] ----- -class SomeController { - - def jmsService - - def someAction = { - jmsService.send(service: 'listening', method: 'receive', 1) - } -} ----- - -=== Topic Listeners - -[source,groovy] ----- -import grails.plugin.jms.Subscriber - -class ListeningService { - - static exposes = ['jms'] - - @Subscriber - def newMessages(message) { - assert message == 1 - } -} ----- - -[source,groovy] ----- -class SomeController { - - def jmsService - - def someAction = { - jmsService.send(topic: 'newMessages', 1) - } -} ----- - -=== Post Processing Messages - -[source,groovy] ----- -import javax.jms.Message - -class SomeController { - - def jmsService - - def someAction = { - jmsService.send(service: 'initial', 1) { Message msg -> - msg.JMSReplyTo = createDestination(service: 'reply') - msg - } - } -} -----