Skip to content

Commit

Permalink
Upgrade to Micronaut 4.x
Browse files Browse the repository at this point in the history
  • Loading branch information
musketyr committed Dec 18, 2023
1 parent 83da906 commit 744dd54
Show file tree
Hide file tree
Showing 15 changed files with 66 additions and 179 deletions.
27 changes: 0 additions & 27 deletions .github/workflows/gradle-versions-watchdog.yml

This file was deleted.

34 changes: 6 additions & 28 deletions .github/workflows/gradle.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
12 changes: 5 additions & 7 deletions .github/workflows/license_updater.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
8 changes: 4 additions & 4 deletions .github/workflows/publish_documentation.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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 }}
36 changes: 8 additions & 28 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -26,44 +25,25 @@ 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 }}
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-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
needs: [ release ]
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
Expand All @@ -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) }} }'
44 changes: 21 additions & 23 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -94,6 +94,14 @@ config {
}

docs {
javadoc {
autoLinks {
enabled = false
}
aggregate {
enabled = false
}
}
groovydoc {
enabled = false
aggregate {
Expand All @@ -117,9 +125,7 @@ nexusPublishing {

allprojects {
repositories {
jcenter()
mavenCentral()
maven { url "https://dl.bintray.com/agorapulse/libs" }
maven { url "https://repo.spring.io/release" }
}

Expand All @@ -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)
Expand All @@ -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])
Expand All @@ -188,10 +190,6 @@ projects {
enabled = true
}
}

dependencies {
testImplementation group: 'org.spockframework', name: 'spock-core', version: spockVersion
}
}
}
}
Expand Down
24 changes: 0 additions & 24 deletions examples/micronaut-snitch-example/micronaut-snitch-example.gradle

This file was deleted.

9 changes: 4 additions & 5 deletions gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -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

2 changes: 1 addition & 1 deletion gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
@@ -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
26 changes: 7 additions & 19 deletions libs/micronaut-snitch/micronaut-snitch.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -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'
}
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down
Loading

0 comments on commit 744dd54

Please sign in to comment.