diff --git a/.github/release-drafter.yml b/.github/release-drafter.yml index f5ba56fd..38a91ce8 100644 --- a/.github/release-drafter.yml +++ b/.github/release-drafter.yml @@ -1,24 +1,117 @@ name-template: $RESOLVED_VERSION tag-template: v$RESOLVED_VERSION +pull-request: + title-templates: + fix: '🐛 $TITLE (#$NUMBER)' + feat: '🚀 $TITLE (#$NUMBER)' + default: '$TITLE (#$NUMBER)' +autolabeler: + - label: 'bug' + branch: + - '/fix\/.+/' + title: + - '/fix/i' + - label: 'improvement' + branch: + - '/improv\/.+/' + title: + - '/improv/i' + - label: 'feature' + branch: + - '/feature\/.+/' + title: + - '/feat/i' + - label: 'documentation' + branch: + - '/docs\/.+/' + title: + - '/docs/i' + - label: 'maintenance' + branch: + - '/(chore|refactor|style|test|ci|perf|build)\/.+/' + title: + - '/(chore|refactor|style|test|ci|perf|build)/i' + - label: 'chore' + branch: + - '/chore\/.+/' + title: + - '/chore/i' + - label: 'refactor' + branch: + - '/refactor\/.+/' + title: + - '/refactor/i' + - label: 'style' + branch: + - '/style\/.+/' + title: + - '/style/i' + - label: 'test' + branch: + - '/test\/.+/' + title: + - '/test/i' + - label: 'ci' + branch: + - '/ci\/.+/' + title: + - '/ci/i' + - label: 'perf' + branch: + - '/perf\/.+/' + title: + - '/perf/i' + - label: 'build' + branch: + - '/build\/.+/' + title: + - '/build/i' + - label: 'deps' + branch: + - '/deps\/.+/' + title: + - '/deps/i' + - label: 'revert' + branch: + - '/revert\/.+/' + title: + - '/revert/i' categories: - - title: ✨ Features + - title: '🚀 Features' labels: + - 'feature' - "type: enhancement" - "type: new feature" - "type: major" - - title: 🐛 Bug Fixes/Improvements + - "type: minor" + - title: '💡 Improvements' labels: + - 'improvement' - "type: improvement" + + - title: '🐛 Bug Fixes' + labels: + - 'fix' + - 'bug' - "type: bug" - - "type: minor" - - title: 🛠 Dependency upgrades + - title: '📚 Documentation' labels: - - "type: dependency upgrade" - - "dependencies" - - title: ⚙️ Build/CI + - 'docs' + - title: '🔧 Maintenance' labels: + - 'maintenance' + - 'chore' + - 'refactor' + - 'style' + - 'test' + - 'ci' + - 'perf' + - 'build' - "type: ci" - "type: build" + - title: '⏪ Reverts' + labels: + - 'revert' change-template: '- $TITLE @$AUTHOR (#$NUMBER)' version-resolver: major: diff --git a/.github/workflows/gradle.yml b/.github/workflows/gradle.yml index bfc3ac9b..76f37ed7 100644 --- a/.github/workflows/gradle.yml +++ b/.github/workflows/gradle.yml @@ -6,87 +6,55 @@ on: pull_request: branches: - '[5-9]+.[0-9]+.x' -env: - GIT_USER_NAME: puneetbehl - GIT_USER_EMAIL: behlp@unityfoundation.io - jobs: - build_project: name: Build Project runs-on: ubuntu-latest - strategy: fail-fast: true - matrix: - java: [17] - steps: - - uses: actions/checkout@v4 - uses: gradle/wrapper-validation-action@v2 - uses: actions/setup-java@v4 with: distribution: temurin - java-version: ${{ matrix.java }} - - - name: Run Tests - if: github.event_name == 'pull_request' + java-version: 17 + - 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: check - - - name: Run Build - if: github.event_name == 'push' - 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_snapshot: + publish_documentation: name: Publish Snapshot release runs-on: ubuntu-latest if: github.event_name == 'push' needs: build_project - steps: - - uses: actions/checkout@v4 - uses: gradle/wrapper-validation-action@v2 - uses: actions/setup-java@v4 - with: { java-version: 17, distribution: temurin } - - - name: Publish Snapshot artifacts to Artifactory (repo.grails.org) + with: + distribution: temurin + java-version: 17 + - name: Publish to Artifactory (repo.grails.org) 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 }} ORG_GRADLE_PROJECT_artifactoryPublishUsername: ${{ secrets.ARTIFACTORY_USERNAME }} ORG_GRADLE_PROJECT_artifactoryPublishPassword: ${{ secrets.ARTIFACTORY_PASSWORD }} with: arguments: | -Dorg.gradle.internal.publish.checksums.insecure=true publish - - - name: Generate Snapshot Documentation + - name: Generate Documentation if: success() 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 Snapshot Documentation to Github Pages + - name: Publish to Github Pages if: success() uses: micronaut-projects/github-pages-deploy-action@grails env: @@ -94,4 +62,6 @@ jobs: COMMIT_EMAIL: ${{ env.GIT_USER_EMAIL }} COMMIT_NAME: ${{ env.GIT_USER_NAME }} FOLDER: docs/build/docs - GH_TOKEN: ${{ secrets.GH_TOKEN }} \ No newline at end of file + DOC_FOLDER: gh-pages + COMMIT_EMAIL: 'grails-build@users.noreply.github.com' + COMMIT_NAME: 'grails-build' diff --git a/.github/workflows/groovy-joint-workflow.yml b/.github/workflows/groovy-joint-workflow.yml index 2960435e..9e72bd75 100644 --- a/.github/workflows/groovy-joint-workflow.yml +++ b/.github/workflows/groovy-joint-workflow.yml @@ -9,85 +9,58 @@ on: workflow_dispatch: permissions: contents: read +env: + CI_GROOVY_VERSION: jobs: build_groovy: + strategy: + fail-fast: true runs-on: ubuntu-latest outputs: - groovySnapshotVersion: ${{ steps.groovy_snapshot_version.outputs.value }} + groovyVersion: ${{ steps.groovy-version.outputs.value }} steps: - name: Set up JDK uses: actions/setup-java@v4 with: distribution: temurin - java-version: 11 + java-version: 17 - name: Cache local Maven repository & Groovy - uses: actions/cache@13aacd865c20de90d75de3b17ebe84f7a17d57d2 # v4 + uses: actions/cache@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 + - name: Checkout Groovy 4_0_X (Grails 7 and later) + run: cd .. && git clone --depth 1 https://github.com/apache/groovy.git -b GROOVY_4_0_X --single-branch + - name: Set CI_GROOVY_VERSION for Grails + id: groovy-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 + echo "CI_GROOVY_VERSION=$(cat gradle.properties | grep groovyVersion | cut -d\= -f2 | tr -d '[:space:]')" >> $GITHUB_ENV + echo "value=$(cat gradle.properties | grep groovyVersion | cut -d\= -f2 | tr -d '[:space:]')" >> $GITHUB_OUTPUT + - name: Prepare Develocity Setup 1 + id: develocity_conf_1 run: | echo "VALUE<> $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 " id 'com.gradle.enterprise' version '3.15.1'" >> $GITHUB_OUTPUT + echo " id 'com.gradle.common-custom-user-data-gradle-plugin' version '1.11.3'" >> $GITHUB_OUTPUT echo "}" >> $GITHUB_OUTPUT echo "" >> $GITHUB_OUTPUT + echo "EOF" >> $GITHUB_OUTPUT + - name: Prepare Develocity Setup 2 + id: develocity_conf_2 + run: | + echo "VALUE<> $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 " uploadInBackground = System.getenv('CI') == null" >> $GITHUB_OUTPUT echo " capture {" >> $GITHUB_OUTPUT echo " taskInputFiles = true" >> $GITHUB_OUTPUT echo " }" >> $GITHUB_OUTPUT @@ -95,9 +68,9 @@ jobs: echo "}" >> $GITHUB_OUTPUT echo "" >> $GITHUB_OUTPUT echo "buildCache {" >> $GITHUB_OUTPUT - echo " local { enabled = false }" >> $GITHUB_OUTPUT + echo " local { enabled = System.getenv('CI') != 'true' }" >> $GITHUB_OUTPUT echo " remote(HttpBuildCache) {" >> $GITHUB_OUTPUT - echo " push = true" >> $GITHUB_OUTPUT + echo " push = System.getenv('CI') == 'true'" >> $GITHUB_OUTPUT echo " enabled = true" >> $GITHUB_OUTPUT echo " url = 'https://ge.grails.org/cache/'" >> $GITHUB_OUTPUT echo " credentials {" >> $GITHUB_OUTPUT @@ -108,17 +81,19 @@ jobs: echo "}" >> $GITHUB_OUTPUT echo "" >> $GITHUB_OUTPUT echo "EOF" >> $GITHUB_OUTPUT - - - name: Gradle Enterprise Set-up + - name: Develocity 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/actions/setup-gradle@v3 + # Delete existing plugins from settings.gradle file + sed -i '32,37d' settings.gradle + # Add Gradle Enterprise set-up related configuration after line no 31 in settings.gradle + echo "${{ steps.develocity_conf_1.outputs.value }}" | sed -i -e "31r /dev/stdin" settings.gradle + # Delete existing buildCache configuration from gradle/build-scans.gradle file + sed -i '23,46d' gradle/build-scans.gradle + # Add Gradle Enterprise set-up related configuration after line no 22 in gradle/build-scans.gradle + echo "${{ steps.develocity_conf_2.outputs.value }}" | sed -i -e "22r /dev/stdin" gradle/build-scans.gradle + - name: Build and install groovy (no docs) + uses: gradle/gradle-build-action@v3 env: GRADLE_SCANS_ACCEPT: yes GRADLE_ENTERPRISE_ACCESS_KEY: ${{ secrets.GRADLE_ENTERPRISE_ACCESS_KEY }} @@ -127,7 +102,7 @@ jobs: with: build-root-directory: ../groovy arguments: | - install + publishToMavenLocal -x groovydoc -x javadoc -x javadocAll @@ -137,6 +112,8 @@ jobs: build_project: needs: [build_groovy] + strategy: + fail-fast: true runs-on: ubuntu-latest steps: @@ -149,20 +126,19 @@ jobs: java-version: 17 - name: Cache local Maven repository & Groovy - uses: actions/cache@13aacd865c20de90d75de3b17ebe84f7a17d57d2 # v4 + uses: actions/cache@v4 with: path: | ~/groovy ~/.m2/repository key: cache-local-groovy-maven-${{ github.sha }} - - - name: Build Project - id: build_grails_project - uses: gradle/actions/setup-gradle@v3 + - name: Set CI_GROOVY_VERSION for Grails + run: | + echo "CI_GROOVY_VERSION=${{needs.build_groovy.outputs.groovyVersion}}" >> $GITHUB_ENV + - name: Build GORM + id: build_gorm + uses: gradle/gradle-build-action@v3 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 }} diff --git a/.github/workflows/release-notes.yml b/.github/workflows/release-notes.yml index 2807f6a5..87b925df 100644 --- a/.github/workflows/release-notes.yml +++ b/.github/workflows/release-notes.yml @@ -6,6 +6,10 @@ on: branches: - master - '[5-9]+.[0-9]+.x' + pull_request: + types: [opened, reopened, synchronize, labeled] + pull_request_target: + types: [opened, reopened, synchronize, labeled] workflow_dispatch: jobs: release_notes: diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index fdc3ec9e..1a77a292 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -2,21 +2,19 @@ name: Release on: release: types: [published] - jobs: release: runs-on: ubuntu-latest - env: - GIT_USER_NAME: puneetbehl - GIT_USER_EMAIL: behlp@unityfoundation.io - + GIT_USER_NAME: 'grails-build' + GIT_USER_EMAIL: 'grails-build@users.noreply.github.com' steps: - uses: actions/checkout@v4 - uses: gradle/wrapper-validation-action@v2 - uses: actions/setup-java@v4 - with: { distribution: temurin, java-version: 17 } - + with: + distribution: temurin + java-version: 17 - name: Get the current release version id: release_version run: | @@ -36,8 +34,6 @@ jobs: uses: gradle/actions/setup-gradle@v3 env: GRADLE_ENTERPRISE_ACCESS_KEY: ${{ secrets.GRADLE_ENTERPRISE_ACCESS_KEY }} - GRADLE_ENTERPRISE_BUILD_CACHE_NODE_KEY: ${{ secrets.GRADLE_ENTERPRISE_BUILD_CACHE_NODE_KEY }} - GRADLE_ENTERPRISE_BUILD_CACHE_NODE_USER: ${{ secrets.GRADLE_ENTERPRISE_BUILD_CACHE_NODE_USER }} ORG_GRADLE_PROJECT_sonatypeUsername: ${{ secrets.SONATYPE_USERNAME }} ORG_GRADLE_PROJECT_sonatypePassword: ${{ secrets.SONATYPE_PASSWORD }} ORG_GRADLE_PROJECT_sonatypeStagingProfileId: ${{ secrets.SONATYPE_STAGING_PROFILE_ID }} @@ -54,8 +50,6 @@ jobs: 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 @@ -63,13 +57,17 @@ jobs: if: success() uses: micronaut-projects/github-pages-deploy-action@grails env: - BETA: ${{ contains(steps.release_version.outputs.release_version, 'M') || contains(steps.release_version.outputs.release_version, 'RC') }} + TARGET_REPOSITORY: ${{ github.repository }} + GH_TOKEN: ${{ secrets.GH_TOKEN }} BRANCH: gh-pages COMMIT_EMAIL: ${{ env.GIT_USER_EMAIL }} COMMIT_NAME: ${{ env.GIT_USER_NAME }} FOLDER: docs/build/docs GH_TOKEN: ${{ secrets.GH_TOKEN }} VERSION: ${{ steps.release_version.outputs.release_version }} + DOC_FOLDER: gh-pages + COMMIT_EMAIL: 'grails-build@users.noreply.github.com' + COMMIT_NAME: 'grails-build' - name: Set projectVersion to the next snapshot version if: steps.publish_to_sonatype.outcome == 'success' diff --git a/LICENSE b/LICENSE index 5e829a5e..607eabdf 100644 --- a/LICENSE +++ b/LICENSE @@ -224,7 +224,6 @@ SECTION 1: BSD-STYLE, MIT-STYLE, OR SIMILAR STYLE LICENSES >>> dom4j-1.6.1 >>> hsqldb-1.8.0.10 >>> jline-2.11 - >>> sitemesh-2.4 >>> slf4j-1.7.5 @@ -394,57 +393,6 @@ This software is distributable under the BSD license. See the terms of the BSD license in the documentation provided with this software. ->>> sitemesh-2.4 - -The OpenSymphony Software License, Version 1.1 - -(this license is derived and fully compatible with the Apache Software -License - see http://www.apache.org/LICENSE.txt) - -Copyright (c) 2001 The OpenSymphony Group. All rights reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions -are met: - -1. Redistributions of source code must retain the above copyright -notice, this list of conditions and the following disclaimer. - -2. Redistributions in binary form must reproduce the above copyright -notice, this list of conditions and the following disclaimer in -the documentation and/or other materials provided with the -distribution. - -3. The end-user documentation included with the redistribution, -if any, must include the following acknowledgment: -"This product includes software developed by the -OpenSymphony Group (http://www.opensymphony.com/)." -Alternately, this acknowledgment may appear in the software itself, -if and wherever such third-party acknowledgments normally appear. - -4. The names "OpenSymphony" and "The OpenSymphony Group" -must not be used to endorse or promote products derived from this -software without prior written permission. For written -permission, please contact license@opensymphony.com . - -5. Products derived from this software may not be called "OpenSymphony" -or "SiteMesh", nor may "OpenSymphony" or "SiteMesh" appear in their -name, without prior written permission of the OpenSymphony Group. - -THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED -WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES -OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE -DISCLAIMED. IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR -ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF -USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND -ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, -OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT -OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF -SUCH DAMAGE. - - >>> slf4j-1.7.5 Copyright (c) 2004-2007 QOS.ch diff --git a/build.gradle b/build.gradle index 4062810d..a1804d7b 100644 --- a/build.gradle +++ b/build.gradle @@ -26,9 +26,11 @@ if(isReleaseVersion) { } } + subprojects { version = rootProject.version repositories { + mavenLocal() // Used by Groovy Joint Workflow mavenCentral() maven { url = 'https://repo.grails.org/grails/core' } if (libs.versions.groovy.get().endsWith('-SNAPSHOT')) { diff --git a/buildSrc/build.gradle b/buildSrc/build.gradle index 21d47188..4949e239 100644 --- a/buildSrc/build.gradle +++ b/buildSrc/build.gradle @@ -9,8 +9,9 @@ repositories { maven { url = 'https://repo.grails.org/grails/core' } } -dependencies { +configurations.configureEach { exclude group: 'org.apache.groovy' } +dependencies { // Needs to be implementation as classes are referenced in build scripts implementation buildsrcLibs.grails.docs implementation buildsrcLibs.nexus.publish.gradle.plugin @@ -18,4 +19,21 @@ dependencies { runtimeOnly buildsrcLibs.grails.gradle.plugin runtimeOnly buildsrcLibs.grails.views.gradle.plugin runtimeOnly buildsrcLibs.groovydoc.gradle.plugin +} + +def groovyVersion = project.rootProject + .extensions + .getByType(VersionCatalogsExtension.class) + .named("libs") + .findVersion("groovy") + .get() + .displayName + +configurations.configureEach { + resolutionStrategy.eachDependency { DependencyResolveDetails details -> + if ((details.requested.group == 'org.codehaus.groovy' || details.requested.group == 'org.apache.groovy') && details.requested.name != 'groovy-bom') { + details.useTarget(group: 'org.apache.groovy', name: details.requested.name, version: groovyVersion) + details.because "The dependency coordinates are changed in Apache Groovy 4, plus ensure version" + } + } } \ No newline at end of file diff --git a/buildSrc/settings.gradle b/buildSrc/settings.gradle index 6cd9ab17..80738597 100644 --- a/buildSrc/settings.gradle +++ b/buildSrc/settings.gradle @@ -3,5 +3,9 @@ dependencyResolutionManagement { buildsrcLibs { from(files('../gradle/buildsrc.libs.versions.toml')) } + + libs { + from(files('../gradle/libs.versions.toml')) + } } } \ No newline at end of file diff --git a/docs/src/main/docs/guide/asyncGorm.adoc b/docs/src/main/docs/guide/asyncGorm.adoc index 6e6c56f7..701ef1a5 100644 --- a/docs/src/main/docs/guide/asyncGorm.adoc +++ b/docs/src/main/docs/guide/asyncGorm.adoc @@ -1,6 +1,6 @@ Since Grails 2.3, GORM features an asynchronous programming model that works across all supported datastores (Hibernate, MongoDB etc.). -NOTE: Although GORM executes persistence operations asynchronously, these operations still block as the underlying database drivers are not asynchronous. Asynchornous GORM is designed to allow you to isolate these blocking operations onto a separate thread you can scale and control allowing your controller layer to remain non-blocking. +NOTE: Although GORM executes persistence operations asynchronously, these operations still block as the underlying database drivers are not asynchronous. Asynchronous GORM is designed to allow you to isolate these blocking operations onto a separate thread you can scale and control allowing your controller layer to remain non-blocking. === The AsyncEntity Trait @@ -9,7 +9,7 @@ Since Grails 3.3, the asynchronous part of GORM is optional. To enable it you fi [source,groovy] .build.gradle ---- -compile "org.grails:grails-datastore-gorm-async" +implementation "org.grails:grails-datastore-gorm-async" ---- Then in your domain classes you wish to allow asynchronous processing you should use the `AsyncEntity` trait: @@ -19,7 +19,7 @@ Then in your domain classes you wish to allow asynchronous processing you should import grails.gorm.async.* class MyEntity implements AsyncEntity { - ... + //... } ---- diff --git a/docs/src/main/docs/guide/asyncRequests.adoc b/docs/src/main/docs/guide/asyncRequests.adoc index 41a6abdf..231d4184 100644 --- a/docs/src/main/docs/guide/asyncRequests.adoc +++ b/docs/src/main/docs/guide/asyncRequests.adoc @@ -54,8 +54,8 @@ You can even render different view by passing the `PromiseMap` to the `model` at [source,groovy] ---- -import static grails.async.WebPromises.* -... +import static grails.async.web.WebPromises.* +//... def index() { render view:"myView", model: tasks( one:{ 2 * 2 }, two:{ 3 * 3 } ) @@ -70,7 +70,8 @@ You can also write to the response asynchronously using promises in Grails 2.3 a [source,groovy] ---- -import static grails.async.WebPromises.* +import static grails.async.web.WebPromises.* + class StockController { def stock(String ticker) { diff --git a/docs/src/main/docs/guide/events.adoc b/docs/src/main/docs/guide/events.adoc index a1425e86..15a8b9d8 100644 --- a/docs/src/main/docs/guide/events.adoc +++ b/docs/src/main/docs/guide/events.adoc @@ -7,7 +7,7 @@ To use the Grails Events abstraction you should add a dependency on the `events` [source,groovy,subs="attributes"] .build.gradle ---- -runtime "org.grails.plugins:events:{version}" +implementation "org.grails.plugins:events:{version}" ---- If no asynchronous framework is present on the classpath then by default Grails creates an EventBus based off of the currently active `PromiseFactory`. The default implementation is link:{api}/org/grails/async/factory/future/CachedThreadPoolPromiseFactory.html[CachedThreadPoolPromiseFactory] which uses a thread pool that will create threads as needed (the same as `java.util.concurrent.Executors.newCachedThreadPool()`). @@ -17,7 +17,7 @@ If you wish to use a popular async framework such as RxJava as the `EventBus` im [source,groovy,subs="attributes"] .build.gradle ---- -runtime "org.grails:grails-events-rxjava:{version}" +runtimeOnly "org.grails:grails-events-rxjava:{version}" ---- The following table summarizes async framework support and the necessary dependency: diff --git a/docs/src/main/docs/guide/events/consuming.adoc b/docs/src/main/docs/guide/events/consuming.adoc index 96db04dd..f6f7c20a 100644 --- a/docs/src/main/docs/guide/events/consuming.adoc +++ b/docs/src/main/docs/guide/events/consuming.adoc @@ -25,7 +25,7 @@ If you wish to subscribe to events dynamically or need more flexibility, then an .TotalService.groovy ---- import grails.events.bus.EventBusAware -import javax.annotation.PostConstruct +import jakarta.annotation.PostConstruct ... include::{sourcedir}/grails-events-transform/src/test/groovy/grails/events/ManualPubSubSpec.groovy[tags=subscriber] ---- diff --git a/docs/src/main/docs/guide/promises.adoc b/docs/src/main/docs/guide/promises.adoc index 3aa77132..ceb5a9fe 100644 --- a/docs/src/main/docs/guide/promises.adoc +++ b/docs/src/main/docs/guide/promises.adoc @@ -5,7 +5,7 @@ To use the Grails Promise abstraction you should add a dependency on the `async` [source,groovy,subs="attributes"] .build.gradle ---- -runtime "org.grails.plugins:async:{version}" +implementation "org.grails.plugins:async:{version}" ---- === Promise Basics @@ -72,14 +72,14 @@ def result = p.get(1,MINUTES) === The PromiseFactory Interface -By default the `Promises` static methods use an instance of `PromiseFactory`. This `PromiseFactory` interface has various implementations. The default implementation is link:{api}/org/grails/async/factory/future/CachedThreadPoolPromiseFactory.html[CachedThreadPoolPromiseFactory] which uses a thread pool that will create threads as needed (the same as `java.util.concurrent.Executors.newCachedThreadPool()`) +By default, the `Promises` static methods use an instance of `PromiseFactory`. This `PromiseFactory` interface has various implementations. The default implementation is link:{api}/org/grails/async/factory/future/CachedThreadPoolPromiseFactory.html[CachedThreadPoolPromiseFactory] which uses a thread pool that will create threads as needed (the same as `java.util.concurrent.Executors.newCachedThreadPool()`) However, the design of the Grails promises framework is such that you can swap out the underlying implementation for your own or one of the pre-supported implementations. For example to use RxJava 1.x simply add the RxJava dependency to `build.gradle`: [source,groovy,subs="attributes"] .build.gradle ---- -runtime "org.grails:grails-async-rxjava:{version}" +runtimeOnly "org.grails:grails-async-rxjava:{version}" ---- With the above in place RxJava 1.x will be used to create `Promise` instances. diff --git a/docs/src/main/docs/guide/rxjava.adoc b/docs/src/main/docs/guide/rxjava.adoc index 804b1ab6..757abca8 100644 --- a/docs/src/main/docs/guide/rxjava.adoc +++ b/docs/src/main/docs/guide/rxjava.adoc @@ -6,8 +6,8 @@ To get started simply declare a dependency on the plugin in `build.gradle`: .build.gradle ---- dependencies { - ... - compile 'org.grails.plugins:rxjava' + //... + implementation 'org.grails.plugins:rxjava' } ---- diff --git a/docs/src/main/docs/resources/styles/layout.html b/docs/src/main/docs/resources/styles/layout.html index fdff713a..5c744649 100644 --- a/docs/src/main/docs/resources/styles/layout.html +++ b/docs/src/main/docs/resources/styles/layout.html @@ -7,7 +7,7 @@ - +