Skip to content
Permalink

Comparing changes

This is a direct comparison between two commits made in this repository or its related repositories. View the default comparison for this range or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: grails/grails-async
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: 12deb53c18edea6dc6ac8e2862254b2a65baed52
Choose a base ref
..
head repository: grails/grails-async
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: 66aaa2facc12fc139c9d35aa5cb838dc0419e361
Choose a head ref
Showing with 618 additions and 418 deletions.
  1. +36 −25 .github/workflows/gradle.yml
  2. +172 −0 .github/workflows/groovy-joint-workflow.yml
  3. +38 −47 .github/workflows/release.yml
  4. +14 −105 build.gradle
  5. +10 −6 buildSrc/build.gradle
  6. +2 −4 buildSrc/settings.gradle
  7. +92 −0 docs/build.gradle
  8. 0 { → docs}/src/main/docs/guide/asyncGorm.adoc
  9. 0 { → docs}/src/main/docs/guide/asyncRequests.adoc
  10. 0 { → docs}/src/main/docs/guide/asyncServletApi.adoc
  11. 0 { → docs}/src/main/docs/guide/events.adoc
  12. 0 { → docs}/src/main/docs/guide/events/annotations.adoc
  13. 0 { → docs}/src/main/docs/guide/events/configure.adoc
  14. 0 { → docs}/src/main/docs/guide/events/consuming.adoc
  15. 0 { → docs}/src/main/docs/guide/events/gormEvents.adoc
  16. 0 { → docs}/src/main/docs/guide/events/notifying.adoc
  17. 0 { → docs}/src/main/docs/guide/events/springEvents.adoc
  18. 0 { → docs}/src/main/docs/guide/introduction.adoc
  19. 0 { → docs}/src/main/docs/guide/promises.adoc
  20. 0 { → docs}/src/main/docs/guide/rxjava.adoc
  21. 0 { → docs}/src/main/docs/guide/rxjava/rxGorm.adoc
  22. 0 { → docs}/src/main/docs/guide/rxjava/serverSentEvents.adoc
  23. 0 { → docs}/src/main/docs/guide/toc.yml
  24. 0 { → docs}/src/main/docs/resources/styles/layout.html
  25. +8 −2 examples/pubsub-demo/grails-app/services/pubsub/demo/TotalService.groovy
  26. +1 −1 examples/pubsub-demo/src/integration-test/groovy/pubsub/demo/PubSubSpec.groovy
  27. +19 −0 examples/pubsub-demo/src/integration-test/resources/logback-test.xml
  28. +2 −5 gradle.properties
  29. +13 −0 gradle/buildsrc.libs.versions.toml
  30. +21 −28 gradle/libs.versions.toml
  31. +39 −46 gradle/publishing.gradle
  32. +12 −4 grails-async-core/build.gradle
  33. +2 −2 grails-async-core/src/test/groovy/grails/async/FutureTaskPromiseFactorySpec.groovy
  34. +3 −3 grails-async-core/src/test/groovy/grails/async/PromiseSpec.groovy
  35. +9 −11 grails-async-gpars/build.gradle
  36. +5 −8 grails-async-rxjava/build.gradle
  37. +6 −7 grails-async-rxjava2/build.gradle
  38. +1 −7 grails-events-compat/build.gradle
  39. +5 −6 grails-events-core/build.gradle
  40. +7 −12 grails-events-gpars/build.gradle
  41. +10 −13 grails-events-rxjava/build.gradle
  42. +6 −9 grails-events-rxjava2/build.gradle
  43. +6 −9 grails-events-spring/build.gradle
  44. +17 −13 grails-events-transform/build.gradle
  45. +27 −16 grails-plugin-async/build.gradle
  46. +12 −8 grails-plugin-events/build.gradle
  47. +1 −1 grails-plugin-events/src/main/groovy/org/grails/plugins/events/EventBusGrailsPlugin.groovy
  48. +22 −20 settings.gradle
61 changes: 36 additions & 25 deletions .github/workflows/gradle.yml
Original file line number Diff line number Diff line change
@@ -6,68 +6,79 @@ on:
pull_request:
branches:
- '[5-9]+.[0-9]+.x'

jobs:
build:
name: build

build_project:
name: Build Project
runs-on: ubuntu-latest

strategy:
fail-fast: true
matrix:
java: ['11', '14']
java: [11, 17]

steps:

- uses: actions/checkout@v4
- name: Set up JDK
uses: actions/setup-java@v3
- uses: gradle/wrapper-validation-action@v2
- uses: actions/setup-java@v4
with:
distribution: 'adopt'
distribution: temurin
java-version: ${{ matrix.java }}
- name: Run Build
id: build
uses: gradle/gradle-build-action@v2
- name: Run Gradle build
uses: gradle/actions/setup-gradle@v3
env:
GRADLE_ENTERPRISE_ACCESS_KEY: ${{ secrets.GRADLE_ENTERPRISE_ACCESS_KEY }}
GRADLE_ENTERPRISE_BUILD_CACHE_NODE_USER: ${{ secrets.GRADLE_ENTERPRISE_BUILD_CACHE_NODE_USER }}
GRADLE_ENTERPRISE_BUILD_CACHE_NODE_KEY: ${{ secrets.GRADLE_ENTERPRISE_BUILD_CACHE_NODE_KEY }}
with:
arguments: build
publish:

publish_documentation:
name: Publish Snapshot release
if: github.event_name == 'push'
needs: build
runs-on: ubuntu-latest
if: github.event_name == 'push'
needs: build_project

steps:

- uses: actions/checkout@v4
- name: Set up JDK
uses: actions/setup-java@v3
with:
distribution: 'adopt'
java-version: '11'
- uses: gradle/wrapper-validation-action@v2
- uses: actions/setup-java@v4
with: { distribution: temurin, java-version: 11 }

- name: Publish to Artifactory (repo.grails.org)
uses: gradle/gradle-build-action@v2
uses: gradle/actions/setup-gradle@v3
env:
GRADLE_ENTERPRISE_ACCESS_KEY: ${{ secrets.GRADLE_ENTERPRISE_ACCESS_KEY }}
GRADLE_ENTERPRISE_BUILD_CACHE_NODE_USER: ${{ secrets.GRADLE_ENTERPRISE_BUILD_CACHE_NODE_USER }}
GRADLE_ENTERPRISE_BUILD_CACHE_NODE_KEY: ${{ secrets.GRADLE_ENTERPRISE_BUILD_CACHE_NODE_KEY }}
ARTIFACTORY_USERNAME: ${{ secrets.ARTIFACTORY_USERNAME }}
ARTIFACTORY_PASSWORD: ${{ secrets.ARTIFACTORY_PASSWORD }}
ORG_GRADLE_PROJECT_artifactoryPublishUsername: ${{ secrets.ARTIFACTORY_USERNAME }}
ORG_GRADLE_PROJECT_artifactoryPublishPassword: ${{ secrets.ARTIFACTORY_PASSWORD }}
with:
arguments: -Dorg.gradle.internal.publish.checksums.insecure=true publish
arguments: |
-Dorg.gradle.internal.publish.checksums.insecure=true
publish
- name: Generate Documentation
if: success()
uses: gradle/gradle-build-action@v2
with:
arguments: docs
uses: gradle/actions/setup-gradle@v3
env:
GRADLE_ENTERPRISE_ACCESS_KEY: ${{ secrets.GRADLE_ENTERPRISE_ACCESS_KEY }}
GRADLE_ENTERPRISE_BUILD_CACHE_NODE_USER: ${{ secrets.GRADLE_ENTERPRISE_BUILD_CACHE_NODE_USER }}
GRADLE_ENTERPRISE_BUILD_CACHE_NODE_KEY: ${{ secrets.GRADLE_ENTERPRISE_BUILD_CACHE_NODE_KEY }}
with:
arguments: docs

- name: Publish to Github Pages
if: success()
uses: micronaut-projects/github-pages-deploy-action@grails
env:
TARGET_REPOSITORY: ${{ github.repository }}
GH_TOKEN: ${{ secrets.GH_TOKEN }}
BRANCH: gh-pages
FOLDER: build/docs
FOLDER: docs/build/docs
DOC_FOLDER: gh-pages
COMMIT_EMAIL: behlp@unityfoundation.io
COMMIT_NAME: Puneet Behl
172 changes: 172 additions & 0 deletions .github/workflows/groovy-joint-workflow.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,172 @@
name: "Groovy Joint Validation Build"
on:
push:
branches:
- '[5-9]+.[0-9]+.x'
pull_request:
branches:
- '[5-9]+.[0-9]+.x'
workflow_dispatch:
permissions:
contents: read
jobs:
build_groovy:
runs-on: ubuntu-latest
outputs:
groovySnapshotVersion: ${{ steps.groovy_snapshot_version.outputs.value }}
steps:

- name: Set up JDK
uses: actions/setup-java@v4
with:
distribution: temurin
java-version: 11

- name: Cache local Maven repository & Groovy
uses: actions/cache@13aacd865c20de90d75de3b17ebe84f7a17d57d2 # v4
with:
path: |
~/groovy
~/.m2/repository
key: cache-local-groovy-maven-${{ github.sha }}

- name: Checkout project to fetch some versions it uses
uses: actions/checkout@v4
with:
sparse-checkout-cone-mode: false
sparse-checkout: |
settings.gradle
gradle/libs.versions.toml
- name: Get version of Gradle Enterprise plugin
id: gradle_enterprise_version
run: |
GE_PLUGIN_VERSION=$(grep -m 1 'id\s*\(\"com.gradle.enterprise\"\|'"'com.gradle.enterprise'"'\)\s*version' settings.gradle | sed -E "s/.*version[[:space:]]*['\"]?([0-9]+\.[0-9]+\.[0-9]+)['\"]?.*/\1/" | tr -d [:space:])
GE_USER_DATA_PLUGIN_VERSION=$(grep -m 1 'id\s*\(\"com.gradle.common-custom-user-data-gradle-plugin\"\|'"'com.gradle.common-custom-user-data-gradle-plugin'"'\)\s*version' settings.gradle | sed -E "s/.*version[[:space:]]*['\"]?([0-9]+\.[0-9]+\.[0-9]+)['\"]?.*/\1/" | tr -d [:space:])
echo "Project uses Gradle Enterprise Plugin version: $GE_PLUGIN_VERSION"
echo "Project uses Gradle Common Custom User Data Plugin version: $GE_USER_DATA_PLUGIN_VERSION"
echo "ge_plugin_version=$GE_PLUGIN_VERSION" >> $GITHUB_OUTPUT
echo "ge_user_data_plugin_version=$GE_USER_DATA_PLUGIN_VERSION" >> $GITHUB_OUTPUT
rm settings.gradle
- name: Select Groovy Branch to checkout
id: groovy_branch
run: |
PROJECT_GROOVY_VERSION=$(grep -m 1 groovy gradle/libs.versions.toml | cut -d\= -f2 | tr -d "[:space:]'\"")
MAJOR_VERSION=$(echo $PROJECT_GROOVY_VERSION | cut -d'.' -f1)
MINOR_VERSION=$(echo $PROJECT_GROOVY_VERSION | cut -d'.' -f2)
BRANCH="GROOVY_${MAJOR_VERSION}_${MINOR_VERSION}_X"
echo "Project uses Groovy $PROJECT_GROOVY_VERSION"
echo "value=$BRANCH" >> $GITHUB_OUTPUT
rm -rf gradle
- name: Checkout Groovy Snapshot
run: |
BRANCH=${{ steps.groovy_branch.outputs.value }}
echo "Checking out Groovy branch $BRANCH"
cd .. && git clone --depth 1 https://github.com/apache/groovy.git -b $BRANCH --single-branch
- name: Set Groovy Snapshot version for project build
id: groovy_snapshot_version
run: |
cd ../groovy
GROOVY_SNAPSHOT_VERSION=$(cat gradle.properties | grep groovyVersion | cut -d\= -f2 | tr -d "[:space:]")
echo "value=$GROOVY_SNAPSHOT_VERSION" >> $GITHUB_OUTPUT
- name: Prepare Gradle Enterprise Set-up Configuration
id: ge_conf
run: |
echo "VALUE<<EOF" >> $GITHUB_OUTPUT
echo "plugins { " >> $GITHUB_OUTPUT
echo " id 'com.gradle.enterprise' version '${{ steps.gradle_enterprise_version.outputs.ge_plugin_version }}'" >> $GITHUB_OUTPUT
echo " id 'com.gradle.common-custom-user-data-gradle-plugin' version '${{ steps.gradle_enterprise_version.outputs.ge_user_data_plugin_version }}'" >> $GITHUB_OUTPUT
echo "}" >> $GITHUB_OUTPUT
echo "" >> $GITHUB_OUTPUT
echo "gradleEnterprise {" >> $GITHUB_OUTPUT
echo " server = 'https://ge.grails.org'" >> $GITHUB_OUTPUT
echo " buildScan {" >> $GITHUB_OUTPUT
echo " publishAlways()" >> $GITHUB_OUTPUT
echo " publishIfAuthenticated()" >> $GITHUB_OUTPUT
echo " uploadInBackground = false" >> $GITHUB_OUTPUT
echo " capture {" >> $GITHUB_OUTPUT
echo " taskInputFiles = true" >> $GITHUB_OUTPUT
echo " }" >> $GITHUB_OUTPUT
echo " }" >> $GITHUB_OUTPUT
echo "}" >> $GITHUB_OUTPUT
echo "" >> $GITHUB_OUTPUT
echo "buildCache {" >> $GITHUB_OUTPUT
echo " local { enabled = false }" >> $GITHUB_OUTPUT
echo " remote(HttpBuildCache) {" >> $GITHUB_OUTPUT
echo " push = true" >> $GITHUB_OUTPUT
echo " enabled = true" >> $GITHUB_OUTPUT
echo " url = 'https://ge.grails.org/cache/'" >> $GITHUB_OUTPUT
echo " credentials {" >> $GITHUB_OUTPUT
echo " username = System.getenv('GRADLE_ENTERPRISE_BUILD_CACHE_NODE_USER')" >> $GITHUB_OUTPUT
echo " password = System.getenv('GRADLE_ENTERPRISE_BUILD_CACHE_NODE_KEY')" >> $GITHUB_OUTPUT
echo " }" >> $GITHUB_OUTPUT
echo " }" >> $GITHUB_OUTPUT
echo "}" >> $GITHUB_OUTPUT
echo "" >> $GITHUB_OUTPUT
echo "EOF" >> $GITHUB_OUTPUT
- name: Gradle Enterprise Set-up
run: |
cd ../groovy
# Delete exiting plugins and build-scan from settings.gradle file
sed -i '21,31d' settings.gradle
# Add Gradle Enterprise set-up related configuration after line no 20 in settings.gradle
echo "${{ steps.ge_conf.outputs.value }}" | sed -i -e "20r /dev/stdin" settings.gradle
- name: Build and install Groovy (no docs)
uses: gradle/gradle-build-action@v2
env:
GRADLE_SCANS_ACCEPT: yes
GRADLE_ENTERPRISE_ACCESS_KEY: ${{ secrets.GRADLE_ENTERPRISE_ACCESS_KEY }}
GRADLE_ENTERPRISE_BUILD_CACHE_NODE_USER: ${{ secrets.GRADLE_ENTERPRISE_BUILD_CACHE_NODE_USER }}
GRADLE_ENTERPRISE_BUILD_CACHE_NODE_KEY: ${{ secrets.GRADLE_ENTERPRISE_BUILD_CACHE_NODE_KEY }}
with:
build-root-directory: ../groovy
arguments: |
install
-x groovydoc
-x javadoc
-x javadocAll
-x groovydocAll
-x asciidoc
-x docGDK
build_project:
needs: [build_groovy]
runs-on: ubuntu-latest
steps:

- uses: actions/checkout@v4

- name: Set up JDK
uses: actions/setup-java@v4
with:
distribution: temurin
java-version: 11

- name: Cache local Maven repository & Groovy
uses: actions/cache@13aacd865c20de90d75de3b17ebe84f7a17d57d2 # v4
with:
path: |
~/groovy
~/.m2/repository
key: cache-local-groovy-maven-${{ github.sha }}

- name: Build Project
id: build_grails_project
uses: gradle/gradle-build-action@v2
env:
GROOVY_VERSION: ${{ needs.build_groovy.outputs.groovySnapshotVersion }}
CI_GROOVY_VERSION: ${{ needs.build_groovy.outputs.groovySnapshotVersion }}
ORG_GRADLE_PROJECT_groovyVersion: ${{ needs.build_groovy.outputs.groovySnapshotVersion }}
GRADLE_ENTERPRISE_ACCESS_KEY: ${{ secrets.GRADLE_ENTERPRISE_ACCESS_KEY }}
GRADLE_ENTERPRISE_BUILD_CACHE_NODE_USER: ${{ secrets.GRADLE_ENTERPRISE_BUILD_CACHE_NODE_USER }}
GRADLE_ENTERPRISE_BUILD_CACHE_NODE_KEY: ${{ secrets.GRADLE_ENTERPRISE_BUILD_CACHE_NODE_KEY }}
with:
arguments: |
build
-x groovydoc
85 changes: 38 additions & 47 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -2,86 +2,77 @@ name: Release
on:
release:
types: [published]

jobs:
release:
runs-on: ubuntu-latest
strategy:
matrix:
java: ['11']

env:
GIT_USER_NAME: puneetbehl
GIT_USER_EMAIL: behlp@objectcomputing.com

steps:
- name: Checkout repository
uses: actions/checkout@v4
with:
token: ${{ secrets.GH_TOKEN }}
- uses: gradle/wrapper-validation-action@v1
- name: Set up JDK
uses: actions/setup-java@v3
with:
distribution: 'adopt'
java-version: ${{ matrix.java }}
- name: Extract Target Branch
id: extract_branch
run: |
echo "Determining Target Branch"
TARGET_BRANCH=`cat $GITHUB_EVENT_PATH | jq '.release.target_commitish' | sed -e 's/^"\(.*\)"$/\1/g'`
echo $TARGET_BRANCH
echo "value=${TARGET_BRANCH}" >> $GITHUB_OUTPUT
- uses: actions/checkout@v4
- uses: gradle/wrapper-validation-action@v2
- uses: actions/setup-java@v4
with: { distribution: temurin, java-version: 11 }

- name: Set the current release version
id: release_version
run: echo "release_version=${GITHUB_REF:11}" >> $GITHUB_OUTPUT

- name: Run pre-release
uses: micronaut-projects/github-actions/pre-release@master
with:
token: ${{ secrets.GITHUB_TOKEN }}

- name: Generate secring file
env:
SECRING_FILE: ${{ secrets.SECRING_FILE }}
run: echo $SECRING_FILE | base64 -d > ${{ github.workspace }}/secring.gpg
- name: Publish to Sonatype OSSRH
id: publish
uses: gradle/gradle-build-action@v2

- name: Publish to Sonatype
id: publish_to_sonatype
uses: gradle/actions/setup-gradle@v3
env:
SONATYPE_USERNAME: ${{ secrets.SONATYPE_USERNAME }}
SONATYPE_PASSWORD: ${{ secrets.SONATYPE_PASSWORD }}
SONATYPE_STAGING_PROFILE_ID: ${{ secrets.SONATYPE_STAGING_PROFILE_ID }}
GRADLE_ENTERPRISE_ACCESS_KEY: ${{ secrets.GRADLE_ENTERPRISE_ACCESS_KEY }}
GRADLE_ENTERPRISE_BUILD_CACHE_NODE_USER: ${{ secrets.GRADLE_ENTERPRISE_BUILD_CACHE_NODE_USER }}
GRADLE_ENTERPRISE_BUILD_CACHE_NODE_KEY: ${{ secrets.GRADLE_ENTERPRISE_BUILD_CACHE_NODE_KEY }}
ORG_GRADLE_PROJECT_sonatypeUsername: ${{ secrets.SONATYPE_USERNAME }}
ORG_GRADLE_PROJECT_sonatypePassword: ${{ secrets.SONATYPE_PASSWORD }}
ORG_GRADLE_PROJECT_sonatypeStagingProfileId: ${{ secrets.SONATYPE_STAGING_PROFILE_ID }}
SIGNING_KEY: ${{ secrets.SIGNING_KEY }}
SIGNING_PASSPHRASE: ${{ secrets.SIGNING_PASSPHRASE }}
SECRING_FILE: ${{ secrets.SECRING_FILE }}
with:
arguments: -Psigning.secretKeyRingFile=${{ github.workspace }}/secring.gpg publishToSonatype closeAndReleaseSonatypeStagingRepository
- name: Run Assemble
if: steps.publish.outcome == 'success'
id: assemble
uses: gradle/gradle-build-action@v2
with:
arguments: assemble
arguments: |
-Psigning.secretKeyRingFile=${{ github.workspace }}/secring.gpg
publishToSonatype
closeAndReleaseSonatypeStagingRepository
- name: Generate Documentation
if: success()
uses: gradle/gradle-build-action@v2
with:
arguments: docs
uses: gradle/actions/setup-gradle@v3
env:
GRADLE_ENTERPRISE_ACCESS_KEY: ${{ secrets.GRADLE_ENTERPRISE_ACCESS_KEY }}
GRADLE_ENTERPRISE_BUILD_CACHE_NODE_USER: ${{ secrets.GRADLE_ENTERPRISE_BUILD_CACHE_NODE_USER }}
GRADLE_ENTERPRISE_BUILD_CACHE_NODE_KEY: ${{ secrets.GRADLE_ENTERPRISE_BUILD_CACHE_NODE_KEY }}
- name: Publish to Github Pages
with:
arguments: docs

- name: Publish Documentation to Github Pages
if: success()
uses: micronaut-projects/github-pages-deploy-action@grails
env:
GRADLE_ENTERPRISE_ACCESS_KEY: ${{ secrets.GRADLE_ENTERPRISE_ACCESS_KEY }}
GRADLE_ENTERPRISE_BUILD_CACHE_NODE_USER: ${{ secrets.GRADLE_ENTERPRISE_BUILD_CACHE_NODE_USER }}
GRADLE_ENTERPRISE_BUILD_CACHE_NODE_KEY: ${{ secrets.GRADLE_ENTERPRISE_BUILD_CACHE_NODE_KEY }}
TARGET_REPOSITORY: ${{ github.repository }}
GH_TOKEN: ${{ secrets.GH_TOKEN }}
BRANCH: gh-pages
FOLDER: build/docs
FOLDER: docs/build/docs
VERSION: ${{ steps.release_version.outputs.release_version }}
DOC_FOLDER: gh-pages
COMMIT_EMAIL: behlp@unityfoundation.io
COMMIT_NAME: Puneet Behl

- name: Run post-release
if: steps.publish.outcome == 'success'
uses: micronaut-projects/github-actions/post-release@master
with:
token: ${{ secrets.GITHUB_TOKEN }}
env:
SNAPSHOT_SUFFIX: -SNAPSHOT
if: steps.publish_to_sonatype.outcome == 'success'
uses: micronaut-projects/github-actions/post-release@master
119 changes: 14 additions & 105 deletions build.gradle
Original file line number Diff line number Diff line change
@@ -1,133 +1,42 @@
import io.github.gradlenexus.publishplugin.InitializeNexusStagingRepository

plugins {
id 'groovy'
id 'io.github.gradle-nexus.publish-plugin'
id 'org.asciidoctor.jvm.convert' version '4.0.0-alpha.1'
}

version = projectVersion

repositories {
mavenCentral()
maven { url 'https://repo.grails.org/grails/core' }
}

ext['isSnapshot'] = projectVersion.endsWith('-SNAPSHOT')
ext['isReleaseVersion'] = !isSnapshot
ext.set('grailsVersion', libs.versions.grails.get())
ext.set('isSnapshot', projectVersion.endsWith('-SNAPSHOT'))
ext.set('isReleaseVersion', !isSnapshot)

if(isReleaseVersion) {
nexusPublishing {
String nexusUser = System.getenv('SONATYPE_USERNAME') ?: project.findProperty('sonatypeOssUsername') ?: ''
String nexusPass = System.getenv('SONATYPE_PASSWORD') ?: project.findProperty('sonatypeOssPassword') ?: ''
String nexusStagingProfileId = System.getenv('SONATYPE_STAGING_PROFILE_ID') ?: project.findProperty('sonatypeOssStagingProfileId') ?: ''
String nexusUser = project.findProperty('sonatypeOssUsername')
String nexusPass = project.findProperty('sonatypeOssPassword')
String nexusStagingProfileId = project.findProperty('sonatypeOssStagingProfileId')
repositories {
sonatype {
nexusUrl = uri 'https://s01.oss.sonatype.org/service/local/'
nexusUrl = uri('https://s01.oss.sonatype.org/service/local/')
username = nexusUser
password = nexusPass
stagingProfileId = nexusStagingProfileId
}
}
transitionCheckOptions {
maxRetries = 50
delayBetween = java.time.Duration.ofSeconds(3)
}
}
}

configurations {
documentation.extendsFrom compileClasspath
}

dependencies {
documentation libs.groovy.core
documentation libs.groovy.templates
documentation libs.groovy.ant
documentation libs.groovy.dateutil
documentation libs.groovy.cli.picocli
}

tasks.withType(Groovydoc).configureEach {
group = 'documentation'
docTitle = "${project.title} - ${project.version}"
destinationDir = project.file('build/docs/api')
def files = []
project.rootProject.subprojects
.findAll { !it.name != 'docs' && !it.name.startsWith('examples') }
.each { subproject ->
if(subproject.file('src/main/groovy').exists()) {
files += subproject.files('src/main/groovy')
}
}
if(project.file('src/main/groovy').exists()) {
files += project.files('src/main/groovy')
}
source = files
classpath = configurations.documentation
}

tasks.register('publishGuide', grails.doc.gradle.PublishGuide) {
group = 'documentation'
description = 'Generate Guide'
dependsOn = ['groovydoc']
mustRunAfter = ['jar']

targetDir = project.file("${buildDir}/docs")
sourceRepo = "https://github.com/${githubSlug}/edit/${githubBranch}/src/main/docs"
sourceDir = new File(projectDir, 'src/main/docs')
propertiesFiles = [new File(rootProject.projectDir, 'gradle.properties')]
asciidoc = true
resourcesDir = project.layout.projectDirectory.dir('src/main/docs/resources').asFile
properties = [
'safe' : 'UNSAFE',
'version' : project.version,
'subtitle' : project.projectDesc,
'api' : '../api',
'sourceDir': rootProject.projectDir.absolutePath,
'sourcedir': rootProject.projectDir.absolutePath,
'javaee' : 'https://docs.oracle.com/javaee/7/api/',
'javase' : 'https://docs.oracle.com/en/java/javase/11/docs/api/',
'groovyapi': "https://docs.groovy-lang.org/${libs.versions.groovy.asProvider().get()}/html/gapi/",
'grailsapi': "https://docs.grails.org/${libs.versions.grails.asProvider().get()}/api/",
'gormapi' : "https://gorm.grails.org/${libs.versions.gorm.get()}/api/",
'springapi': "https://docs.spring.io/spring/docs/${libs.versions.spring.get()}/javadoc-api/"
]
doLast {
ant.move(file: "${project.buildDir}/docs/guide/single.html",
tofile: "${project.buildDir}/docs/guide/index.html", overwrite: true)
new File(project.buildDir, 'docs/index.html').text = '''
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html lang="en">
<head>
<meta http-equiv="refresh" content="0; url=guide/index.html" />
</head>
</body>
</html>
'''
}
}

tasks.register('docs') {
group = 'documentation'
dependsOn = ['groovydoc', 'publishGuide']
}

tasks.named('build') {
finalizedBy('docs')
}

subprojects {
version = rootProject.version
repositories {
mavenCentral()
maven { url 'https://repo.grails.org/grails/core' }
if (libs.versions.groovy.asProvider().get().endsWith('-SNAPSHOT')) {
maven { url = 'https://repo.grails.org/grails/core' }
if (libs.versions.groovy.get().endsWith('-SNAPSHOT')) {
maven {
name 'JFrog Groovy snapshot repo'
url 'https://groovy.jfrog.io/artifactory/libs-snapshot-local/'
name = 'JFrog Groovy snapshot repo'
url = 'https://groovy.jfrog.io/artifactory/libs-snapshot-local/'
}
}

}

tasks.withType(Test).configureEach {
@@ -139,6 +48,6 @@ subprojects {
}

//do not generate extra load on Nexus with new staging repository if signing fails
tasks.withType(io.github.gradlenexus.publishplugin.InitializeNexusStagingRepository).configureEach {
tasks.withType(InitializeNexusStagingRepository).configureEach {
shouldRunAfter tasks.withType(Sign)
}
16 changes: 10 additions & 6 deletions buildSrc/build.gradle
Original file line number Diff line number Diff line change
@@ -4,14 +4,18 @@ plugins {
}

repositories {
gradlePluginPortal()
mavenCentral()
maven { url 'https://repo.grails.org/grails/core' }
maven { url = 'https://repo.grails.org/grails/core' }
}

dependencies {
implementation libs.nexus.publish.gradle.plugin
implementation libs.grails.gradle.plugin
implementation libs.grails.views.gradle.plugin
implementation libs.groovydoc.gradle.plugin
implementation libs.grails.docs

// Needs to be implementation as classes are referenced in build scripts
implementation buildsrcLibs.grails.docs
implementation buildsrcLibs.nexus.publish.gradle.plugin

runtimeOnly buildsrcLibs.grails.gradle.plugin
runtimeOnly buildsrcLibs.grails.views.gradle.plugin
runtimeOnly buildsrcLibs.groovydoc.gradle.plugin
}
6 changes: 2 additions & 4 deletions buildSrc/settings.gradle
Original file line number Diff line number Diff line change
@@ -1,9 +1,7 @@
rootProject.name = 'grails-async'

dependencyResolutionManagement {
versionCatalogs {
libs {
from(files('../gradle/libs.versions.toml'))
buildsrcLibs {
from(files('../gradle/buildsrc.libs.versions.toml'))
}
}
}
92 changes: 92 additions & 0 deletions docs/build.gradle
Original file line number Diff line number Diff line change
@@ -0,0 +1,92 @@
import grails.doc.gradle.PublishGuide

plugins {
id 'base'
}

configurations.register('groovydocRuntimeOnly')

dependencies {
groovydocRuntimeOnly localGroovy()
}

tasks.withType(Groovydoc).configureEach {
group = 'documentation'
access = GroovydocAccess.PROTECTED
processScripts = false
includeMainForScripts = false
includeAuthor = true
classpath = configurations.groovydocRuntimeOnly
groovyClasspath = configurations.groovydocRuntimeOnly
}

tasks.register('apiDocs', Groovydoc) {

docTitle = "Grails Async $version"

def projectNames = [
'grails-async-core', 'grails-async-gpars', 'grails-async-rxjava', 'grails-async-rxjava2',
'grails-events-compat', 'grails-events-core', 'grails-events-gpars', 'grails-events-rxjava',
'grails-events-rxjava2', 'grails-events-spring', 'grails-events-transform',
'grails-plugin-async', 'grails-plugin-events'
]

def projects = rootProject.allprojects.findAll { it.name in projectNames }
source projects.collect { it.layout.projectDirectory.dir('src/main/groovy') }
destinationDir = layout.buildDirectory.dir('docs/api').get().asFile
}

tasks.register('generateGuide', PublishGuide) {

group = 'documentation'
dependsOn = ['apiDocs']

targetDir = project.layout.buildDirectory.dir('docs').get().asFile
sourceRepo = "https://github.com/${githubSlug}/edit/${githubBranch}/src/main/docs"
sourceDir = project.layout.projectDirectory.dir('src/main/docs').asFile
propertiesFiles = [
rootProject.layout.projectDirectory.file('gradle.properties').asFile
]
asciidoc = true
resourcesDir = project.layout.projectDirectory.dir('src/main/docs/resources').asFile
it.properties = [
'safe' : 'UNSAFE',
'version' : project.version,
'api' : '../api',
'sourcedir': rootProject.layout.projectDirectory.asFile,
'javaee' : 'https://docs.oracle.com/javaee/7/api/',
'javase' : 'https://docs.oracle.com/en/java/javase/11/docs/api/',
'groovyapi': "https://docs.groovy-lang.org/${libs.versions.groovy.get()}/html/gapi/",
'grailsapi': "https://docs.grails.org/${libs.versions.grails.get()}/api/",
'gormapi' : "https://gorm.grails.org/${libs.versions.gorm.get()}/api/",
'springapi': "https://docs.spring.io/spring/docs/${libs.versions.spring.get()}/javadoc-api/"
]
doLast {
def dir = project.layout.buildDirectory.dir('docs').get().asFile
ant.invokeMethod('move', [
file: "${dir}/guide/single.html",
tofile: "${dir}/guide/index.html",
overwrite: true
])
new File(dir, 'index.html').text = """
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html lang="en">
<head>
<title>Grails Async $version</title>
<meta http-equiv="refresh" content="0; url=guide/index.html" />
</head>
<body>
</body>
</html>
""".stripIndent()
}
}

tasks.register('docs') {
group = 'documentation'
dependsOn 'apiDocs', 'generateGuide'
}

tasks.named('build') {
finalizedBy 'docs'
}
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
@@ -4,15 +4,21 @@ import grails.events.Event
import grails.events.annotation.Subscriber
import groovy.transform.CompileStatic

import java.util.concurrent.atomic.AtomicInteger

@CompileStatic
class TotalService {

int accumulatedTotal = 0
AtomicInteger accumulatedTotalInstance = new AtomicInteger(0)

int getAccumulatedTotal() {
accumulatedTotalInstance.get()
}

@Subscriber
@SuppressWarnings('unused')
void onSum(int total) {
accumulatedTotal += total
accumulatedTotalInstance.addAndGet(total)
}

@Subscriber
Original file line number Diff line number Diff line change
@@ -24,7 +24,7 @@ class PubSubSpec extends Specification {
sumService.sum(1, 2)

then: 'the subscriber should receive the events'
new PollingConditions(timeout: 5).eventually {
new PollingConditions().eventually {
totalService.accumulatedTotal == 6
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
<?xml version="1.0" encoding="UTF-8"?>
<configuration>

<conversionRule conversionWord="clr" converterClass="org.springframework.boot.logging.logback.ColorConverter" />
<conversionRule conversionWord="wex" converterClass="org.springframework.boot.logging.logback.WhitespaceThrowableProxyConverter" />

<appender name="STDOUT" class="ch.qos.logback.core.ConsoleAppender">
<withJansi>true</withJansi>
<encoder>
<charset>UTF-8</charset>
<pattern>%clr(%d{yyyy-MM-dd HH:mm:ss.SSS}){faint} %clr(%5p) %clr(---){faint} %clr([%15.15t]){faint} %clr(%-40.40logger{39}){cyan} %clr(:){faint} %m%n%wex</pattern>
</encoder>
</appender>

<root level="error">
<appender-ref ref="STDOUT" />
</root>

</configuration>
7 changes: 2 additions & 5 deletions gradle.properties
Original file line number Diff line number Diff line change
@@ -1,10 +1,5 @@
projectVersion=5.0.3-SNAPSHOT

# These versions have to be defined here for usage in settings.gradle
# (versions in settings.gradle cannot be set from the version catalog)
grailsVersion=6.1.1
viewsVersion=3.1.1

# This prevents the Grails Gradle Plugin from unnecessarily excluding slf4j-simple in the generated POMs
# https://github.com/grails/grails-gradle-plugin/issues/222
slf4jPreventExclusion=true
@@ -23,3 +18,5 @@ rxjavadocs=https://reactivex.io/RxJava/1.x/javadoc
rxjava2docs=https://reactivex.io/RxJava/2.x/javadoc

org.gradle.caching=true
org.gradle.daemon=true
org.gradle.parallel=true
13 changes: 13 additions & 0 deletions gradle/buildsrc.libs.versions.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
[versions]
grails = '6.1.1'
grails-gradle-plugin = '6.1.1'
grails-views = '3.1.2'
groovy-doc = '1.0.1'
nexus-publish-gradle-plugin = '1.3.0'

[libraries]
grails-gradle-plugin = { module = 'org.grails:grails-gradle-plugin', version.ref = 'grails-gradle-plugin' }
grails-views-gradle-plugin = { module = 'org.grails.plugins:views-gradle', version.ref = 'grails-views' }
nexus-publish-gradle-plugin = { module = 'io.github.gradle-nexus:publish-plugin', version.ref = 'nexus-publish-gradle-plugin' }
groovydoc-gradle-plugin = { module = 'io.github.groovylang.groovydoc:groovydoc-gradle-plugin', version.ref = 'groovy-doc' }
grails-docs = { module = 'org.grails:grails-docs', version.ref = 'grails' }
49 changes: 21 additions & 28 deletions gradle/libs.versions.toml
Original file line number Diff line number Diff line change
@@ -1,49 +1,42 @@
[versions]
bytebuddy = '1.14.11'
gpars = '1.2.1'
grails = '6.1.1'
grails-gradle-plugin = '6.1.0'
grails-views = '3.1.0'
grails = '6.1.2'
groovy = '3.0.19'
groovy-doc = '1.0.1'
gorm = '8.0.4'
jansi = '2.4.1'
javaparser = '3.25.7'
javax-annotation = '1.3.2'
jline2 = '2.14.6'
nexus-publish-gradle-plugin = '1.3.0'
picocli = '4.7.5'
objenesis = '3.3'
rxjava = '1.3.8'
rxjava2 = '2.2.21'
sitemesh = '2.4.4'
slf4j = '1.7.36'
spock = '2.1-groovy-3.0'
spring = '5.3.31'

[libraries]
grails-docs = { module = "org.grails:grails-docs", version.ref = "grails" }
bytebuddy = { module = 'net.bytebuddy:byte-buddy', version.ref = 'bytebuddy' }
grails-bootstrap = { module = 'org.grails:grails-bootstrap', version.ref = 'grails' }
grails-core = { module = 'org.grails:grails-core', version.ref = 'grails' }
grails-controllers = { module = 'org.grails:grails-plugin-controllers', version.ref = 'grails' }
grails-datastore-core = { module = 'org.grails:grails-datastore-core', version.ref = 'gorm' }
grails-datastore-gorm = { module = 'org.grails:grails-datastore-gorm', version.ref = 'gorm' }
grails-datastore-gorm-test = { module = 'org.grails:grails-datastore-gorm-test', version.ref = 'gorm' }
grails-web-common = { module = 'org.grails:grails-web-common', version.ref = 'grails' }
grails-web-mvc = { module = 'org.grails:grails-web-mvc', version.ref = 'grails' }
grails-web-sitemesh = { module = 'org.grails:grails-web-sitemesh', version.ref = 'grails' }
gpars = { module = 'org.codehaus.gpars:gpars', version.ref = 'gpars' }
gorm = { module = 'org.grails:grails-datastore-gorm', version.ref = 'gorm' }
gorm-test = { module = 'org.grails:grails-datastore-gorm-test', version.ref = 'gorm' }
groovy-core = { module = 'org.codehaus.groovy:groovy', version.ref = 'groovy' }
groovy-templates = { module = 'org.codehaus.groovy:groovy-templates', version.ref = 'groovy' }
groovy-ant = { module = 'org.codehaus.groovy:groovy-ant', version.ref = 'groovy' }
groovy-dateutil = { module = 'org.codehaus.groovy:groovy-dateutil', version.ref = 'groovy' }
groovy-cli-picocli = { module = 'org.codehaus.groovy:groovy-cli-picocli', version.ref = 'groovy' }
jansi = { module = 'org.fusesource.jansi:jansi', version.ref = 'jansi' }
javaparser-core = { module = 'com.github.javaparser:javaparser-core', version.ref = 'javaparser' }
javax-annotation-api = { module = 'javax.annotation:javax.annotation-api', version.ref = 'javax-annotation' }
jline2 = { module = 'jline:jline', version.ref = 'jline2' }
picocli = { module = 'info.picocli:picocli', version.ref = 'picocli' }
objenesis = { module = 'org.objenesis:objenesis', version.ref = 'objenesis' }
rxjava = { module = 'io.reactivex:rxjava', version.ref = 'rxjava' }
rxjava2 = { module = 'io.reactivex.rxjava2:rxjava', version.ref = 'rxjava2' }
sitemesh = { module = 'opensymphony:sitemesh', version.ref = 'sitemesh' }
slf4j-api = { module = 'org.slf4j:slf4j-api', version.ref = 'slf4j' }
slf4j-nop = { module = 'org.slf4j:slf4j-nop', version.ref = 'slf4j' }
servlet-api = { module = 'javax.servlet:javax.servlet-api', version = '4.0.1' }
spock-core = { module = 'org.spockframework:spock-core', version.ref = 'spock' }
spring-aop = { module = 'org.springframework:spring-aop', version.ref = 'spring' }
spring-beans = { module = 'org.springframework:spring-beans', version.ref = 'spring' }
spring-core = { module = 'org.springframework:spring-core', version.ref = 'spring' }
spring-context = { module = 'org.springframework:spring-context', version.ref = 'spring' }
spring-expression = { module = 'org.springframework:spring-expression', version.ref = 'spring' }
spring-tx = { module = 'org.springframework:spring-tx', version.ref = 'spring' }

#plugins
grails-gradle-plugin = { module = 'org.grails:grails-gradle-plugin', version.ref = 'grails-gradle-plugin' }
grails-views-gradle-plugin = { module = 'org.grails.plugins:views-gradle', version.ref = 'grails-views' }
nexus-publish-gradle-plugin = { module = 'io.github.gradle-nexus:publish-plugin', version.ref = 'nexus-publish-gradle-plugin' }
groovydoc-gradle-plugin = { module = 'io.github.groovylang.groovydoc:groovydoc-gradle-plugin', version.ref = 'groovy-doc' }
spring-web = { module = 'org.springframework:spring-web', version.ref = 'spring' }
85 changes: 39 additions & 46 deletions gradle/publishing.gradle
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
ext['signing.keyId'] = project.findProperty("signing.keyId") ?: System.getenv('SIGNING_KEY')
ext['signing.secretKeyRingFile'] = project.findProperty("signing.secretKeyRingFile") ?: "${System.properties['user.home']}${File.separator}.gnupg${File.separator}secring.gpg"
ext['signing.password'] = project.findProperty("signing.password") ?: System.getenv('SIGNING_PASSPHRASE')
ext.setProperty('signing.keyId', project.findProperty('signing.keyId') ?: System.getenv('SIGNING_KEY'))
ext.setProperty('signing.password', project.findProperty('signing.password') ?: System.getenv('SIGNING_PASSPHRASE'))

def isExample = project.projectDir.parentFile.name == 'examples'
def isGrailsPlugin = project.group == 'org.grails.plugins'
def isCoreModule = project.name.endsWith('-core')

@@ -13,8 +11,8 @@ def pomInfo = {

delegate.licenses {
delegate.license {
delegate.name 'The Apache Software License, Version 2.0'
delegate.url 'http://www.apache.org/licenses/LICENSE-2.0.txt'
delegate.name 'Apache-2.0'
delegate.url 'https://www.apache.org/licenses/LICENSE-2.0.txt'
delegate.distribution 'repo'
}
}
@@ -37,58 +35,53 @@ def pomInfo = {
}
}

if (!isExample) { // don't publish examples
def javaComponent = components.named('java')
project.extensions.configure(PublishingExtension) {

publishing {
it.publications.register('maven', MavenPublication) {

if (isSnapshot) {
repositories {
maven {
credentials {
username = System.getenv('ARTIFACTORY_USERNAME') ?: project.findProperty('artifactoryPublishUsername') ?: ''
password = System.getenv('ARTIFACTORY_PASSWORD') ?: project.findProperty('artifactoryPublishPassword') ?: ''
}
url = isGrailsPlugin ?
uri('https://repo.grails.org/grails/plugins3-snapshots-local') :
uri('https://repo.grails.org/grails/libs-snapshots-local')
if (isGrailsPlugin) artifactId = project.name - 'grails-plugin-'
if (isCoreModule) artifactId = project.name - '-core'

}
}
}

publications {
from javaComponent.get()

maven(MavenPublication) {
versionMapping {
usage('java-api') { fromResolutionOf('runtimeClasspath') }
usage('java-runtime') { fromResolutionResult() }
}

if (isGrailsPlugin) artifactId = project.name - 'grails-plugin-'
if (isCoreModule) artifactId = project.name - '-core'
pom.withXml {
def pomNode = asNode()
pomNode.children().last() + pomInfo

from components.java
// dependency management shouldn't be included
try { pomNode.dependencyManagement.replaceNode({}) } catch (Throwable ignore) {}
}
}

versionMapping {
usage('java-api') { fromResolutionOf('runtimeClasspath') }
usage('java-runtime') { fromResolutionResult() }
if (isSnapshot) {
repositories {
maven {
credentials {
username = project.findProperty('artifactoryPublishUsername') ?: ''
password = project.findProperty('artifactoryPublishPassword') ?: ''
}
url = isGrailsPlugin ?
uri('https://repo.grails.org/grails/plugins3-snapshots-local') :
uri('https://repo.grails.org/grails/libs-snapshots-local')

pom.withXml {
def xml = asNode()
xml.children().last() + pomInfo
// dependency management shouldn't be included
def n = xml.get('dependencyManagement')
if (n) xml.remove(n)
}
}
}
}
}

afterEvaluate {
signing {
required { isReleaseVersion }
sign publishing.publications.maven
}
}

tasks.withType(Sign).configureEach {
onlyIf { isReleaseVersion }
afterEvaluate {
def mavenPublication = project.extensions.findByType(PublishingExtension).publications.named('maven')
project.extensions.configure(SigningExtension) {
it.required = { isReleaseVersion }
it.sign mavenPublication.get()
}
}
tasks.withType(Sign).configureEach {
onlyIf { isReleaseVersion }
}
16 changes: 12 additions & 4 deletions grails-async-core/build.gradle
Original file line number Diff line number Diff line change
@@ -8,12 +8,20 @@ plugins {
group = 'org.grails'

dependencies {

implementation libs.groovy.core
implementation libs.javax.annotation.api
implementation libs.slf4j.api

compileOnly libs.javax.annotation.api

testImplementation libs.spock.core
}

apply from: file("$rootProject.projectDir/gradle/java-config.gradle")
apply from: file("$rootProject.projectDir/gradle/publishing.gradle")
testRuntimeOnly libs.bytebuddy
testRuntimeOnly libs.objenesis

testRuntimeOnly libs.slf4j.nop // Get rid of warning about missing slf4j implementation during test task

}

apply from: rootProject.layout.projectDirectory.file('gradle/java-config.gradle')
apply from: rootProject.layout.projectDirectory.file('gradle/publishing.gradle')
Original file line number Diff line number Diff line change
@@ -93,8 +93,8 @@ class FutureTaskPromiseFactorySpec extends Specification {
then: 'the onComplete handler is invoked and the onError handler is ignored'
thrown(ExecutionException)
new PollingConditions().eventually {
assert result == null
assert error != null
!result
error
}
}

Original file line number Diff line number Diff line change
@@ -136,9 +136,9 @@ class PromiseSpec extends Specification {

then: 'the onComplete handler is invoked and the onError handler is ignored'
new PollingConditions().eventually {
assert result == null
assert error != null
assert error.message == 'java.lang.RuntimeException: bad'
!result
error
error.message.contains('bad')
}
}

20 changes: 9 additions & 11 deletions grails-async-gpars/build.gradle
Original file line number Diff line number Diff line change
@@ -1,33 +1,31 @@
plugins {

id 'groovy'
id 'java-library'

id 'maven-publish'
id 'signing'

}

group = 'org.grails'

dependencies {

implementation project(':grails-async-core')
api project(':grails-async-core')
api libs.gpars, {
exclude group: 'org.multiverse', module: 'multiverse-core' // Multiverse Software Transactional Memory (STM) Engine not used
exclude group: 'org.codehaus.groovy', module: 'groovy-all' // Gpars 1.2.1 pulls in groovy-all:2.1.9
}

implementation libs.groovy.core

implementation libs.gpars, {
exclude group: 'org.multiverse', module: 'multiverse-core'
exclude group: 'org.codehaus.groovy', module: 'groovy-all'
}
implementation libs.slf4j.api

testImplementation libs.spock.core

testRuntimeOnly libs.slf4j.nop // Get rid of warning about missing slf4j implementation during test task

}

apply from: file("$rootProject.projectDir/gradle/java-config.gradle")
apply from: file("$rootProject.projectDir/gradle/publishing.gradle")
apply from: rootProject.layout.projectDirectory.file('gradle/java-config.gradle')
apply from: rootProject.layout.projectDirectory.file('gradle/publishing.gradle')



13 changes: 5 additions & 8 deletions grails-async-rxjava/build.gradle
Original file line number Diff line number Diff line change
@@ -1,29 +1,26 @@
plugins {

id 'groovy'
id 'java-library'

id 'maven-publish'
id 'signing'

}

group = 'org.grails'

dependencies {

implementation project(':grails-async-core')
api project(':grails-async-core')
api libs.rxjava

implementation libs.groovy.core

implementation libs.rxjava
implementation libs.slf4j.api

testImplementation libs.spock.core

testRuntimeOnly libs.slf4j.nop // Get rid of warning about missing slf4j implementation during test task
}

apply from: file("$rootProject.projectDir/gradle/java-config.gradle")
apply from: file("$rootProject.projectDir/gradle/publishing.gradle")
apply from: rootProject.layout.projectDirectory.file('gradle/java-config.gradle')
apply from: rootProject.layout.projectDirectory.file('gradle/publishing.gradle')


13 changes: 6 additions & 7 deletions grails-async-rxjava2/build.gradle
Original file line number Diff line number Diff line change
@@ -1,26 +1,25 @@
plugins {

id 'groovy'
id 'java-library'
id 'maven-publish'
id 'signing'

}

group = 'org.grails'

dependencies {

implementation project(':grails-async-core')
api project(':grails-async-core')
api libs.rxjava2

implementation libs.groovy.core

implementation libs.rxjava2
implementation libs.slf4j.api

testImplementation libs.spock.core

testRuntimeOnly libs.slf4j.nop // Get rid of warning about missing slf4j implementation during test task

}

apply from: file("$rootProject.projectDir/gradle/java-config.gradle")
apply from: file("$rootProject.projectDir/gradle/publishing.gradle")
apply from: rootProject.layout.projectDirectory.file('gradle/java-config.gradle')
apply from: rootProject.layout.projectDirectory.file('gradle/publishing.gradle')
8 changes: 1 addition & 7 deletions grails-events-compat/build.gradle
Original file line number Diff line number Diff line change
@@ -1,24 +1,18 @@
plugins {

id 'groovy'
id 'java-library'

id 'maven-publish'
id 'signing'

}

group = 'org.grails'

dependencies {

implementation project(':grails-events-core')
implementation project(':grails-events-transform')
api project(':grails-events-core')

implementation libs.groovy.core

implementation libs.slf4j.api
implementation libs.spring.tx

}

11 changes: 5 additions & 6 deletions grails-events-core/build.gradle
Original file line number Diff line number Diff line change
@@ -1,25 +1,24 @@
plugins {

id 'groovy'
id 'java-library'

id 'maven-publish'
id 'signing'

}

group = 'org.grails'

dependencies {

implementation libs.groovy.core
api libs.spring.context
api libs.spring.tx

implementation libs.groovy.core
implementation libs.slf4j.api
implementation libs.spring.context
implementation libs.spring.tx

testImplementation libs.spock.core

testRuntimeOnly libs.slf4j.nop // Get rid of warning about missing slf4j implementation during test task

}

apply from: file("$rootProject.projectDir/gradle/java-config.gradle")
19 changes: 7 additions & 12 deletions grails-events-gpars/build.gradle
Original file line number Diff line number Diff line change
@@ -1,31 +1,26 @@
plugins {

id 'groovy'
id 'java-library'

id 'maven-publish'
id 'signing'

}

group = 'org.grails'

dependencies {

implementation project(':grails-events-core')
api project(':grails-events-core')
api libs.gpars, {
exclude group: 'org.multiverse', module: 'multiverse-core' // Multiverse Software Transactional Memory (STM) Engine not used
exclude group: 'org.codehaus.groovy', module: 'groovy-all' // Gpars 1.2.1 pulls in Groovy 2.1.9
}

implementation libs.groovy.core

implementation libs.gpars, {
exclude group: 'org.multiverse', module: 'multiverse-core'
exclude group: 'org.codehaus.groovy', module: 'groovy-all'
}
implementation libs.slf4j.api
implementation libs.spring.tx

testImplementation libs.spock.core

}

apply from: file("$rootProject.projectDir/gradle/java-config.gradle")
apply from: file("$rootProject.projectDir/gradle/publishing.gradle")
apply from: rootProject.layout.projectDirectory.file('gradle/java-config.gradle')
apply from: rootProject.layout.projectDirectory.file('gradle/publishing.gradle')
23 changes: 10 additions & 13 deletions grails-events-rxjava/build.gradle
Original file line number Diff line number Diff line change
@@ -1,32 +1,29 @@
plugins {

id 'groovy'
id 'java-library'

id 'maven-publish'
id 'signing'

}

group = 'org.grails'

dependencies {

implementation project(':grails-events-core')
testImplementation project(':grails-events-transform')
api project(':grails-events-core')
api libs.rxjava

implementation libs.groovy.core

implementation libs.rxjava
implementation libs.slf4j.api
implementation libs.spring.tx

testImplementation libs.gorm.test, {
exclude group:'org.grails', module: 'grails-datastore-gorm-validation'
}
testImplementation project(':grails-events-transform')
testImplementation libs.grails.datastore.core
testImplementation libs.grails.datastore.gorm.test
testImplementation libs.spock.core
testImplementation libs.spring.context

testRuntimeOnly libs.slf4j.nop // Get rid of warning about missing slf4j implementation during test task

}

apply from: file("$rootProject.projectDir/gradle/java-config.gradle")
apply from: file("$rootProject.projectDir/gradle/publishing.gradle")
apply from: rootProject.layout.projectDirectory.file('gradle/java-config.gradle')
apply from: rootProject.layout.projectDirectory.file('gradle/publishing.gradle')
15 changes: 6 additions & 9 deletions grails-events-rxjava2/build.gradle
Original file line number Diff line number Diff line change
@@ -1,28 +1,25 @@
plugins {

id 'groovy'
id 'java-library'

id 'maven-publish'
id 'signing'

}

group = 'org.grails'

dependencies {

implementation project(':grails-events-core')
api project(':grails-events-core')
api libs.rxjava2

implementation libs.groovy.core

implementation libs.rxjava2
implementation libs.slf4j.api
implementation libs.spring.tx

testImplementation libs.spock.core

testRuntimeOnly libs.slf4j.nop // Get rid of warning about missing slf4j implementation during test task

}

apply from: file("$rootProject.projectDir/gradle/java-config.gradle")
apply from: file("$rootProject.projectDir/gradle/publishing.gradle")
apply from: rootProject.layout.projectDirectory.file('gradle/java-config.gradle')
apply from: rootProject.layout.projectDirectory.file('gradle/publishing.gradle')
15 changes: 6 additions & 9 deletions grails-events-spring/build.gradle
Original file line number Diff line number Diff line change
@@ -1,28 +1,25 @@
plugins {

id 'groovy'
id 'java-library'

id 'maven-publish'
id 'signing'

}

group = 'org.grails'

dependencies {

implementation project(':grails-events-core')
api project(':grails-events-core')
api libs.spring.context

implementation libs.groovy.core

implementation libs.slf4j.api
implementation libs.spring.context
implementation libs.spring.tx

testImplementation libs.spock.core

testRuntimeOnly libs.slf4j.nop // Get rid of warning about missing slf4j implementation during test task

}

apply from: file("$rootProject.projectDir/gradle/java-config.gradle")
apply from: file("$rootProject.projectDir/gradle/publishing.gradle")
apply from: rootProject.layout.projectDirectory.file('gradle/java-config.gradle')
apply from: rootProject.layout.projectDirectory.file('gradle/publishing.gradle')
30 changes: 17 additions & 13 deletions grails-events-transform/build.gradle
Original file line number Diff line number Diff line change
@@ -1,32 +1,36 @@
plugins {

id 'groovy'
id 'java-library'

id 'maven-publish'
id 'signing'

}

group = 'org.grails'

dependencies {

implementation project(':grails-events-core')
api project(':grails-events-core')
api libs.grails.datastore.core
api libs.spring.context

implementation libs.gorm, {
implementation libs.grails.datastore.gorm, {
// TODO: Explain why this exclusion is done
exclude group: 'org.grails', module: 'grails-datastore-gorm-validation'
}

testImplementation libs.spock.core
testImplementation libs.gorm.test, {
implementation libs.groovy.core
implementation libs.slf4j.api
implementation libs.spring.beans
implementation libs.spring.core
implementation libs.spring.tx

testImplementation libs.grails.datastore.gorm.test, {
// TODO: Explain why this exclusion is done (I don't know)
exclude group: 'org.grails', module: 'grails-datastore-gorm-validation'
}
testImplementation libs.spock.core

testRuntimeOnly libs.spring.aop
testRuntimeOnly libs.spring.expression

testRuntimeOnly libs.slf4j.nop // Get rid of warning about missing slf4j implementation during test task
}

apply from: file("$rootProject.projectDir/gradle/java-config.gradle")
apply from: file("$rootProject.projectDir/gradle/publishing.gradle")
apply from: rootProject.layout.projectDirectory.file('gradle/java-config.gradle')
apply from: rootProject.layout.projectDirectory.file('gradle/publishing.gradle')
43 changes: 27 additions & 16 deletions grails-plugin-async/build.gradle
Original file line number Diff line number Diff line change
@@ -1,14 +1,10 @@
plugins {

id 'groovy'
id 'java-library'

id 'org.grails.grails-web'
id 'org.grails.grails-plugin'

id 'maven-publish'
id 'signing'

}

dependencies {
@@ -17,24 +13,39 @@ dependencies {

// This project does not really depend on the events plugin
// but rather on the events-core and events-compat modules.
// This is a workaround because without this, plugins created with
// pre-Grails 3.3 will not get the events plugin automatically
// on the classpath and will get an error.
// (The async plugin is automatically added to the classpath by
// This is a workaround because without this, many plugins
// will not get the events plugin automatically on the classpath
// and will get an error.
// The async plugin is automatically added to the classpath by
// grails-core/grails-dependencies and now also the events plugin
// should be pulled in)
// should be pulled in. This will be removed in Grails 7.
// https://github.com/grails/grails-core/issues/13324
api project(':grails-plugin-events')
//api project(':grails-events-compat')
//api project(':grails-events-core')

implementation 'org.grails:grails-core'
implementation 'org.grails:grails-plugin-controllers'
api project(':grails-events-compat')
api project(':grails-events-core')
api libs.grails.core
api libs.grails.web.common
api libs.grails.web.sitemesh
api libs.groovy.core
api libs.spring.beans
api libs.spring.context
api libs.spring.tx

implementation libs.grails.controllers
implementation libs.grails.web.mvc
implementation libs.sitemesh
implementation libs.spring.core
implementation libs.spring.web

compileOnly libs.servlet.api // Provided

testImplementation libs.spock.core

testRuntimeOnly libs.slf4j.nop // Get rid of warning about missing slf4j implementation during test task

}

apply from: file("$rootProject.projectDir/gradle/grails-plugin-config.gradle")
apply from: file("$rootProject.projectDir/gradle/java-config.gradle")
apply from: file("$rootProject.projectDir/gradle/publishing.gradle")
apply from: rootProject.layout.projectDirectory.file('gradle/grails-plugin-config.gradle')
apply from: rootProject.layout.projectDirectory.file('gradle/java-config.gradle')
apply from: rootProject.layout.projectDirectory.file('gradle/publishing.gradle')
20 changes: 12 additions & 8 deletions grails-plugin-events/build.gradle
Original file line number Diff line number Diff line change
@@ -1,26 +1,30 @@
plugins {

id 'groovy'
id 'java-library'

id 'org.grails.grails-plugin'

id 'maven-publish'
id 'signing'

}

dependencies {

api project(':grails-events-core')
api project(':grails-events-compat')

// This dependency contains Groovy Ast transformations
// that needs to be on the compile classpath of dependent projects.
// https://github.com/gradle/gradle/issues/21539
api project(':grails-events-transform')

implementation 'org.grails:grails-core'
implementation libs.grails.bootstrap
implementation libs.grails.core

testImplementation libs.spock.core

testRuntimeOnly libs.slf4j.nop // Get rid of warning about missing slf4j implementation during test task

}

apply from: file("$rootProject.projectDir/gradle/grails-plugin-config.gradle")
apply from: file("$rootProject.projectDir/gradle/java-config.gradle")
apply from: file("$rootProject.projectDir/gradle/publishing.gradle")
apply from: rootProject.layout.projectDirectory.file('gradle/grails-plugin-config.gradle')
apply from: rootProject.layout.projectDirectory.file('gradle/java-config.gradle')
apply from: rootProject.layout.projectDirectory.file('gradle/publishing.gradle')
Original file line number Diff line number Diff line change
@@ -49,7 +49,7 @@ class EventBusGrailsPlugin extends Plugin {
eventBus(EventBus, ref('grailsEventBus'))


// make it possible to disable reactor events
// make it possible to enable reactor events
if(config.getProperty(TRANSLATE_SPRING_EVENTS, Boolean.class, false)) {
springEventTranslator(SpringEventTranslator, ref('grailsEventBus'))
}
42 changes: 22 additions & 20 deletions settings.gradle
Original file line number Diff line number Diff line change
@@ -1,26 +1,14 @@
pluginManagement {
repositories {
maven { url 'https://repo.grails.org/grails/core' }
gradlePluginPortal()
}
plugins {
id 'org.grails.grails-web' version "$grailsVersion"
id 'org.grails.plugins.views-json' version "$viewsVersion"
}
}

plugins {
id "com.gradle.enterprise" version "3.16.1"
id "com.gradle.enterprise" version '3.16.1'
id 'com.gradle.common-custom-user-data-gradle-plugin' version '1.12.1'
}

gradleEnterprise {
server = 'https://ge.grails.org'
buildScan {
// publishAlwaysIf(System.getenv('CI') == 'true' )
publishAlways()
publishAlwaysIf(System.getenv('CI') == 'true')
publishIfAuthenticated()
uploadInBackground = System.getenv("CI") == null
uploadInBackground = System.getenv('CI') == null
capture {
taskInputFiles = true
}
@@ -37,11 +25,24 @@ buildCache {
username = System.getenv('GRADLE_ENTERPRISE_BUILD_CACHE_NODE_USER')
password = System.getenv('GRADLE_ENTERPRISE_BUILD_CACHE_NODE_KEY')
}
}}

}
}

rootProject.name = 'grails-async'

dependencyResolutionManagement {
versionCatalogs {
libs {
def groovyVersion = System.getenv('GROOVY_VERSION')
if (groovyVersion) {
logger.warn "Using custom version $groovyVersion of Groovy due to GROOVY_VERSION being set."
version('groovy', groovyVersion)
}
}
}
}

include 'docs'
include 'grails-async-core'
include 'grails-async-gpars'
include 'grails-async-rxjava'
@@ -56,6 +57,7 @@ include 'grails-events-rxjava2'
include 'grails-plugin-async'
include 'grails-plugin-events'

// examples
include 'examples-pubsub-demo'
project(':examples-pubsub-demo').projectDir = new File(settingsDir, 'examples/pubsub-demo')
file('examples').eachDir { dir ->
include "examples-$dir.name"
project(":examples-$dir.name").projectDir = dir
}