diff --git a/.github/workflows/gradle-versions-watchdog.yml b/.github/workflows/gradle-versions-watchdog.yml deleted file mode 100644 index 3696e0b..0000000 --- a/.github/workflows/gradle-versions-watchdog.yml +++ /dev/null @@ -1,27 +0,0 @@ -name: Gradle RC Watchdog - -on: - schedule: - - cron: '0 0 13 * *' - -jobs: - check: - name: Verify the Latest Gradle Version - runs-on: ubuntu-latest - env: - GRADLE_OPTS: "-Xmx6g -Xms4g" - CI: true - - steps: - - uses: actions/checkout@v2 - - - name: Setup Java 8 - uses: actions/setup-java@v3 - with: - distribution: corretto - java-version: 8 - cache: gradle - - uses: eskatos/gradle-command-action@v1 - with: - arguments: check --stacktrace - gradle-version: rc diff --git a/.github/workflows/gradle.yml b/.github/workflows/gradle.yml index afb89e4..d48d7c1 100644 --- a/.github/workflows/gradle.yml +++ b/.github/workflows/gradle.yml @@ -23,39 +23,17 @@ jobs: check: name: Check runs-on: ubuntu-latest - strategy: - fail-fast: false - matrix: - versions: - - 'coveralls -PmicronautVersion=1.3.7 -PspockVersion=2.0-groovy-2.5 -PgroovyVersion=2.5.15' - - '-PmicronautVersion=2.5.13 -PspockVersion=2.0-groovy-3.0 -PgroovyVersion=3.0.9' - - '-PmicronautVersion=3.2.1 -PspockVersion=2.0-groovy-3.0 -PgroovyVersion=3.0.9' env: - GRADLE_OPTS: "-Xmx6g -Xms4g" - CI: true COVERALLS_REPO_TOKEN: ${{ secrets.COVERALLS_REPO_TOKEN }} steps: - - uses: actions/checkout@v2 - - - name: Setup Java 8 + - uses: actions/checkout@v3 + - name: Setup Java 17 uses: actions/setup-java@v3 with: distribution: corretto - java-version: 8 - cache: gradle - - - uses: actions/cache@v1 + java-version: 17 + - name: Check + uses: gradle/gradle-build-action@v2 with: - path: ~/.gradle/caches - key: ${{ runner.os }}-gradle-${{ hashFiles('**/*.gradle') }}-${{ hashFiles('**/gradle.properties') }} - restore-keys: | - ${{ runner.os }}-gradle- - - name: Check (${{ matrix.versions }}) - uses: eskatos/gradle-command-action@v1 - with: - arguments: check -Dscan.uploadInBackground=false --scan ${{ matrix.versions }} - - - name: Show Build Scan - if: always() - run: cat scan-journal.log + arguments: check coveralls diff --git a/.github/workflows/license_updater.yml b/.github/workflows/license_updater.yml index fb33a6f..a729a33 100644 --- a/.github/workflows/license_updater.yml +++ b/.github/workflows/license_updater.yml @@ -8,16 +8,14 @@ jobs: name: Formats the license headers for a new year runs-on: ubuntu-latest steps: - - uses: actions/checkout@v2 - - - name: Setup Java 8 + - uses: actions/checkout@v3 + - name: Setup Java 17 uses: actions/setup-java@v3 with: distribution: corretto - java-version: 8 - cache: gradle - - name: Check (${{ matrix.versions }}) - uses: eskatos/gradle-command-action@v1 + java-version: 17 + - name: License Format + uses: gradle/gradle-build-action@v2 with: arguments: licenseFormat - name: Create Pull Request diff --git a/.github/workflows/publish_documentation.yml b/.github/workflows/publish_documentation.yml index 7694658..ae1ee20 100644 --- a/.github/workflows/publish_documentation.yml +++ b/.github/workflows/publish_documentation.yml @@ -10,11 +10,11 @@ jobs: GRADLE_OPTS: "-Xmx6g -Xms4g" steps: - uses: actions/checkout@v2 - - name: Setup Java 8 + - name: Setup Java 17 uses: actions/setup-java@v3 with: distribution: corretto - java-version: 8 + java-version: 17 cache: gradle - name: Get Latest Release id: latest_version @@ -23,6 +23,6 @@ jobs: owner: agorapulse repo: micronaut-snitch - name: Publish GitHub Pages - uses: eskatos/gradle-command-action@v2 + uses: gradle/gradle-build-action@v2 with: - arguments: gitPublishPush -Pversion=${{ steps.latest_version.outputs.latest_tag }}-micronaut-3.0 -Prelease=true --stacktrace -PmicronautVersion=3.2.3 -PspockVersion=2.0-groovy-3.0 -PgroovyVersion=3.0.9 -Dorg.ajoberstar.grgit.auth.username=${{ secrets.AGORAPULSE_BOT_PERSONAL_TOKEN }} + arguments: gitPublishPush -Pversion=${{ steps.latest_version.outputs.latest_tag }} -Prelease=true -Dorg.ajoberstar.grgit.auth.username=${{ secrets.AGORAPULSE_BOT_PERSONAL_TOKEN }} diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 1ce94d8..aa7f2ce 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -11,12 +11,11 @@ jobs: GRADLE_OPTS: "-Xmx6g -Xms4g" steps: - uses: actions/checkout@v2 - - name: Setup Java 8 + - name: Setup Java 17 uses: actions/setup-java@v3 with: distribution: corretto - java-version: 8 - cache: gradle + java-version: 17 - name: Semantic Version id: version uses: ncipollo/semantic-version-action@v1 @@ -26,8 +25,8 @@ jobs: with: fileName: 'secret.pgp' encodedString: ${{ secrets.SIGNING_SECRET_KEY_BASE64 }} - - name: Release Micronaut 1.x - uses: eskatos/gradle-command-action@v1 + - name: Release + uses: gradle/gradle-build-action@v2 env: SONATYPE_USERNAME: ${{ secrets.SONATYPE_USERNAME }} SONATYPE_PASSWORD: ${{ secrets.SONATYPE_PASSWORD }} @@ -35,27 +34,7 @@ jobs: SIGNING_PASSWORD: ${{ secrets.SIGNING_PASSWORD }} SIGNING_SECRET_KEY_PATH: ${{ steps.write_file.outputs.filePath }} with: - arguments: publishToSonatype closeAndReleaseSonatypeStagingRepository -Pversion=${{ steps.version.outputs.tag }}-micronaut-1.0 -Prelease=true -Dorg.ajoberstar.grgit.auth.username=${{ secrets.AGORAPULSE_BOT_PERSONAL_TOKEN }} --stacktrace - - name: Release Micronaut 2.x - uses: eskatos/gradle-command-action@v1 - env: - SONATYPE_USERNAME: ${{ secrets.SONATYPE_USERNAME }} - SONATYPE_PASSWORD: ${{ secrets.SONATYPE_PASSWORD }} - SIGNING_KEY_ID: ${{ secrets.SIGNING_KEY_ID }} - SIGNING_PASSWORD: ${{ secrets.SIGNING_PASSWORD }} - SIGNING_SECRET_KEY_PATH: ${{ steps.write_file.outputs.filePath }} - with: - arguments: publishToSonatype closeAndReleaseSonatypeStagingRepository -Pversion=${{ steps.version.outputs.tag }}-micronaut-2.0 --stacktrace -PmicronautVersion=2.5.13 -PspockVersion=2.0-groovy-3.0 -PgroovyVersion=3.0.9 - - name: Release Micronaut 3.x - uses: eskatos/gradle-command-action@v1 - env: - SONATYPE_USERNAME: ${{ secrets.SONATYPE_USERNAME }} - SONATYPE_PASSWORD: ${{ secrets.SONATYPE_PASSWORD }} - SIGNING_KEY_ID: ${{ secrets.SIGNING_KEY_ID }} - SIGNING_PASSWORD: ${{ secrets.SIGNING_PASSWORD }} - SIGNING_SECRET_KEY_PATH: ${{ steps.write_file.outputs.filePath }} - with: - arguments: gitPublishPush publishToSonatype closeAndReleaseSonatypeStagingRepository -Pversion=${{ steps.version.outputs.tag }}-micronaut-3.0 --stacktrace -PmicronautVersion=3.2.1 -PspockVersion=2.0-groovy-3.0 -PgroovyVersion=3.0.9 -Dorg.ajoberstar.grgit.auth.username=${{ secrets.AGORAPULSE_BOT_PERSONAL_TOKEN }} + arguments: gitPublishPush publishToSonatype closeAndReleaseSonatypeStagingRepository -Pversion=${{ steps.version.outputs.tag }} -Dorg.ajoberstar.grgit.auth.username=${{ secrets.AGORAPULSE_BOT_PERSONAL_TOKEN }} ping: name: Notify Upstream Repositories runs-on: ubuntu-latest @@ -63,7 +42,8 @@ jobs: strategy: matrix: repository: - - agorapulse/agorapulse-bom + # until all projects are migrated to Micronaut 4.x + # - agorapulse/agorapulse-bom - agorapulse/agorapulse-oss steps: - uses: actions/checkout@v1 @@ -76,4 +56,4 @@ jobs: token: ${{ secrets.AGORAPULSE_BOT_PERSONAL_TOKEN }} repository: ${{ matrix.repository }} event-type: ap-new-version-released-event - client-payload: '{ "group": "com.agorapulse", "module": "micronaut-snitch", "version": "${{ steps.version.outputs.tag }}-micronaut-1.0", "property" : "micronaut.snitch.version", "github" : ${{ toJson(github) }} }' + client-payload: '{ "group": "com.agorapulse", "module": "micronaut-snitch", "version": "${{ steps.version.outputs.tag }}", "property" : "micronaut.snitch.version", "github" : ${{ toJson(github) }} }' diff --git a/build.gradle b/build.gradle index bd98729..903a561 100644 --- a/build.gradle +++ b/build.gradle @@ -94,6 +94,14 @@ config { } docs { + javadoc { + autoLinks { + enabled = false + } + aggregate { + enabled = false + } + } groovydoc { enabled = false aggregate { @@ -117,9 +125,7 @@ nexusPublishing { allprojects { repositories { - jcenter() mavenCentral() - maven { url "https://dl.bintray.com/agorapulse/libs" } maven { url "https://repo.spring.io/release" } } @@ -129,14 +135,21 @@ allprojects { } } -projects { +gradleProjects { subprojects { - dirs(['libs', 'examples']) { Project subproject -> - sourceCompatibility = 1.8 - targetCompatibility = 1.8 + dirs(['libs']) { Project subproject -> + java { + toolchain { + languageVersion = JavaLanguageVersion.of(17) + } + } - repositories { - mavenCentral() + micronaut { + importMicronautPlatform = true + testRuntime 'spock' + processing { + incremental false + } } // location independent tests (useful for stable CI builds) @@ -155,24 +168,13 @@ projects { groovyOptions.forkOptions.jvmArgs.add('-Dgroovy.parameters=true') } - dependencies { - api platform("org.codehaus.groovy:groovy-bom:$groovyVersion") - compile platform("org.codehaus.groovy:groovy-bom:$groovyVersion") - implementation platform("org.codehaus.groovy:groovy-bom:$groovyVersion") - compileOnly platform("org.codehaus.groovy:groovy-bom:$groovyVersion") - testCompile platform("org.codehaus.groovy:groovy-bom:$groovyVersion") - testImplementation platform("org.codehaus.groovy:groovy-bom:$groovyVersion") - } - // useful for IntelliJ task cleanOut(type: Delete) { delete file('out') } clean.dependsOn cleanOut - } - dir('libs') { processResources { filesMatching('**/org.codehaus.groovy.runtime.ExtensionModule') { filter(org.apache.tools.ant.filters.ReplaceTokens, tokens: [VERSION: version]) @@ -188,10 +190,6 @@ projects { enabled = true } } - - dependencies { - testImplementation group: 'org.spockframework', name: 'spock-core', version: spockVersion - } } } } diff --git a/examples/micronaut-snitch-example/micronaut-snitch-example.gradle b/examples/micronaut-snitch-example/micronaut-snitch-example.gradle deleted file mode 100644 index 35a1a1c..0000000 --- a/examples/micronaut-snitch-example/micronaut-snitch-example.gradle +++ /dev/null @@ -1,24 +0,0 @@ -/* - * SPDX-License-Identifier: Apache-2.0 - * - * Copyright 2020-2023 Agorapulse. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * https://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -// delete if this subproject should not be published to BinTray - -dependencies { - implementation project(":micronaut-snitch") - - // add example project's dependencies -} diff --git a/gradle.properties b/gradle.properties index d1481a5..020f38f 100644 --- a/gradle.properties +++ b/gradle.properties @@ -18,12 +18,11 @@ slug=agorapulse/micronaut-snitch group=com.agorapulse -version=1.2.0-SNAPSHOT -kordampPluginVersion=0.46.0 +version=2.0.0-SNAPSHOT +kordampPluginVersion=0.51.0 nexusPluginVersion=1.0.0 gitPublishPluginVersion=2.1.3 -groovyVersion=2.5.14 -spockVersion=2.0-groovy-2.5 -micronautVersion=1.3.7 +micronautVersion = 4.2.0 +micronautGradlePluginVersion = 4.2.0 diff --git a/gradle/wrapper/gradle-wrapper.properties b/gradle/wrapper/gradle-wrapper.properties index 25d3265..d0d403e 100644 --- a/gradle/wrapper/gradle-wrapper.properties +++ b/gradle/wrapper/gradle-wrapper.properties @@ -1,5 +1,5 @@ distributionBase=GRADLE_USER_HOME distributionPath=wrapper/dists -distributionUrl=https\://services.gradle.org/distributions/gradle-6.8.2-all.zip +distributionUrl=https\://services.gradle.org/distributions/gradle-8.5-all.zip zipStoreBase=GRADLE_USER_HOME zipStorePath=wrapper/dists diff --git a/libs/micronaut-snitch/micronaut-snitch.gradle b/libs/micronaut-snitch/micronaut-snitch.gradle index 7ca62ea..9f44d22 100644 --- a/libs/micronaut-snitch/micronaut-snitch.gradle +++ b/libs/micronaut-snitch/micronaut-snitch.gradle @@ -16,26 +16,14 @@ * limitations under the License. */ dependencies { - annotationProcessor platform("io.micronaut:micronaut-bom:$micronautVersion") - annotationProcessor "io.micronaut:micronaut-inject-java" - annotationProcessor "io.micronaut:micronaut-validation" + annotationProcessor 'io.micronaut.validation:micronaut-validation-processor' - implementation platform("io.micronaut:micronaut-bom:$micronautVersion") - implementation "io.micronaut:micronaut-inject" - implementation 'io.micronaut:micronaut-validation' - implementation "io.micronaut:micronaut-runtime" - implementation "io.micronaut:micronaut-http-client" + implementation 'io.micronaut.validation:micronaut-validation' + implementation 'io.micronaut:micronaut-http-client' + implementation 'io.micronaut:micronaut-jackson-databind' - // Micronaut 3 Compatibility - annotationProcessor 'com.google.code.findbugs:jsr305:3.0.2' - implementation 'com.google.code.findbugs:jsr305:3.0.2' - implementation 'javax.inject:javax.inject:1' + testImplementation 'io.micronaut:micronaut-inject-groovy' + testImplementation 'io.micronaut.test:micronaut-test-spock' - testAnnotationProcessor platform("io.micronaut:micronaut-bom:$micronautVersion") - - testImplementation "io.micronaut:micronaut-inject-groovy" - testImplementation "io.micronaut.test:micronaut-test-spock" - testImplementation "org.spockframework:spock-core:1.3-groovy-2.5" - - testRuntimeOnly "ch.qos.logback:logback-classic:1.2.3" + testRuntimeOnly 'ch.qos.logback:logback-classic:1.2.9' } diff --git a/libs/micronaut-snitch/src/main/java/com/agorapulse/micronaut/snitch/DefaultSnitchFactory.java b/libs/micronaut-snitch/src/main/java/com/agorapulse/micronaut/snitch/DefaultSnitchFactory.java index 014bc28..bd0b726 100644 --- a/libs/micronaut-snitch/src/main/java/com/agorapulse/micronaut/snitch/DefaultSnitchFactory.java +++ b/libs/micronaut-snitch/src/main/java/com/agorapulse/micronaut/snitch/DefaultSnitchFactory.java @@ -21,8 +21,8 @@ import org.slf4j.Logger; import org.slf4j.LoggerFactory; -import javax.inject.Named; -import javax.inject.Singleton; +import jakarta.inject.Named; +import jakarta.inject.Singleton; /** * Factory for built-in snitch services. diff --git a/libs/micronaut-snitch/src/main/java/com/agorapulse/micronaut/snitch/SnitchInterceptor.java b/libs/micronaut-snitch/src/main/java/com/agorapulse/micronaut/snitch/SnitchInterceptor.java index c0c5842..22f1710 100644 --- a/libs/micronaut-snitch/src/main/java/com/agorapulse/micronaut/snitch/SnitchInterceptor.java +++ b/libs/micronaut-snitch/src/main/java/com/agorapulse/micronaut/snitch/SnitchInterceptor.java @@ -21,7 +21,7 @@ import io.micronaut.aop.MethodInvocationContext; import io.micronaut.context.BeanContext; import io.micronaut.inject.qualifiers.Qualifiers; -import javax.inject.Singleton; +import jakarta.inject.Singleton; /** * Interceptor for @{@link Snitch} annotation. diff --git a/libs/micronaut-snitch/src/main/java/com/agorapulse/micronaut/snitch/SnitchJobConfiguration.java b/libs/micronaut-snitch/src/main/java/com/agorapulse/micronaut/snitch/SnitchJobConfiguration.java index 77d8ed5..727236b 100644 --- a/libs/micronaut-snitch/src/main/java/com/agorapulse/micronaut/snitch/SnitchJobConfiguration.java +++ b/libs/micronaut-snitch/src/main/java/com/agorapulse/micronaut/snitch/SnitchJobConfiguration.java @@ -21,7 +21,7 @@ import io.micronaut.context.annotation.Parameter; import io.micronaut.core.naming.Named; -import javax.annotation.Nonnull; +import jakarta.annotation.Nonnull; /** * Snitch job configuration. diff --git a/libs/micronaut-snitch/src/test/groovy/com/agorapulse/micronaut/snitch/SnitchServiceSpec.groovy b/libs/micronaut-snitch/src/test/groovy/com/agorapulse/micronaut/snitch/SnitchServiceSpec.groovy index 5441184..7af94b1 100644 --- a/libs/micronaut-snitch/src/test/groovy/com/agorapulse/micronaut/snitch/SnitchServiceSpec.groovy +++ b/libs/micronaut-snitch/src/test/groovy/com/agorapulse/micronaut/snitch/SnitchServiceSpec.groovy @@ -24,7 +24,7 @@ import io.micronaut.inject.qualifiers.Qualifiers import spock.lang.AutoCleanup import spock.lang.Specification -import javax.inject.Singleton +import jakarta.inject.Singleton @CompileDynamic class SnitchServiceSpec extends Specification { diff --git a/settings.gradle b/settings.gradle index c29a574..0264e7a 100644 --- a/settings.gradle +++ b/settings.gradle @@ -17,7 +17,6 @@ */ buildscript { repositories { - jcenter() mavenCentral() gradlePluginPortal() } @@ -30,21 +29,19 @@ buildscript { classpath group: 'org.kordamp.gradle', name: 'coveralls-gradle-plugin', version: kordampPluginVersion classpath group: 'org.ajoberstar', name: 'gradle-git-publish', version: gitPublishPluginVersion classpath group: 'io.github.gradle-nexus', name: 'publish-plugin', version: nexusPluginVersion + classpath group: 'io.micronaut.gradle', name: 'micronaut-minimal-plugin', version: micronautGradlePluginVersion } } plugins { - id 'com.gradle.enterprise' version '3.6.1' + id 'com.gradle.enterprise' version '3.15.1' } gradleEnterprise { buildScan { + publishAlways() termsOfServiceUrl = "https://gradle.com/terms-of-service" termsOfServiceAgree = "yes" - - buildScanPublished { scan -> - file("scan-journal.log") << "${new Date()} - ${scan.buildScanId} - ${scan.buildScanUri}\n" - } } } @@ -53,7 +50,7 @@ apply plugin: 'org.kordamp.gradle.settings' rootProject.name = 'micronaut-snitch-root' projects { - directories = ['libs', 'docs', 'examples'] + directories = ['libs', 'docs'] plugins { dir('docs') { @@ -61,7 +58,7 @@ projects { id 'org.ajoberstar.git-publish' } dirs(['libs', 'examples']) { - id 'java-library' + id 'io.micronaut.minimal.library' id 'groovy' } }