Skip to content

Commit

Permalink
Migrate to Micronaut 4.x
Browse files Browse the repository at this point in the history
  • Loading branch information
musketyr committed Dec 19, 2023
1 parent ab33ca9 commit 36af74d
Show file tree
Hide file tree
Showing 61 changed files with 207 additions and 512 deletions.
27 changes: 0 additions & 27 deletions .github/workflows/gradle-versions-watchdog.yml

This file was deleted.

22 changes: 4 additions & 18 deletions .github/workflows/gradle.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#
# SPDX-License-Identifier: Apache-2.0
#
# Copyright 2020-2022 Agorapulse.
# 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.
Expand All @@ -24,27 +24,13 @@ jobs:
name: Check
runs-on: ubuntu-latest
env:
GRADLE_OPTS: "-Xmx6g -Xms4g"
CI: true
COVERALLS_REPO_TOKEN: ${{ secrets.COVERALLS_REPO_TOKEN }}
strategy:
fail-fast: false
matrix:
versions:
- 'check coveralls -PmicronautVersion=1.3.7 -PspockVersion=2.0-groovy-2.5 -PgroovyVersion=2.5.15 --scan'
- 'check -PmicronautVersion=2.5.13 -PspockVersion=2.0-groovy-3.0 -PgroovyVersion=3.0.9 --scan'
- 'migrateImports check -PmicronautVersion=3.2.1 -PspockVersion=2.0-groovy-3.0 -PgroovyVersion=3.0.9 --scan'
steps:
- uses: actions/checkout@v2
- name: Setup Java 8
uses: actions/setup-java@v3
- uses: actions/setup-java@v3
with:
distribution: corretto
java-version: 8
cache: gradle
java-version: 17
- uses: gradle/gradle-command-action@v2
with:
arguments: ${{ matrix.versions }}
- name: Show Build Scan
if: always()
run: cat scan-journal.log
arguments: check
8 changes: 3 additions & 5 deletions .github/workflows/publish-documentation.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,12 +10,10 @@ jobs:
GRADLE_OPTS: "-Xmx6g -Xms4g"
steps:
- uses: actions/checkout@v2
- name: Setup Java 8
uses: actions/setup-java@v3
- uses: actions/setup-java@v3
with:
distribution: corretto
java-version: 8
cache: gradle
java-version: 17
- name: Get Latest Release
id: latest_version
uses: abatilo/release-info-action@v1.3.0
Expand All @@ -25,4 +23,4 @@ jobs:
- name: Publish GitHub Pages
uses: gradle/gradle-command-action@v2
with:
arguments: migrateImports gitPublishPush -x groovydoc -x aggregateGroovydoc -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 --stacktrace -Dorg.ajoberstar.grgit.auth.username=${{ secrets.AGORAPULSE_BOT_PERSONAL_TOKEN }}
28 changes: 7 additions & 21 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,19 +8,16 @@ jobs:
name: Release
runs-on: ubuntu-latest
env:
GRADLE_OPTS: "-Xmx6g -Xms4g"
SONATYPE_USERNAME: ${{ secrets.SONATYPE_USERNAME }}
SONATYPE_PASSWORD: ${{ secrets.SONATYPE_PASSWORD }}
SIGNING_KEY_ID: ${{ secrets.SIGNING_KEY_ID }}
SIGNING_PASSWORD: ${{ secrets.SIGNING_PASSWORD }}
steps:
- uses: actions/checkout@v2
- name: Setup Java 8
uses: actions/setup-java@v3
- 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 @@ -30,32 +27,21 @@ jobs:
with:
fileName: 'secret.pgp'
encodedString: ${{ secrets.SIGNING_SECRET_KEY_BASE64 }}
- name: Release Micronaut 1.x
- name: Release
env:
SIGNING_SECRET_KEY_PATH: ${{ steps.write_file.outputs.filePath }}
uses: gradle/gradle-command-action@v2
with:
arguments: -x groovydoc publishToSonatype closeAndReleaseSonatypeStagingRepository -Pversion=${{ steps.version.outputs.tag }}-micronaut-1.0 -Prelease=true --stacktrace
- name: Release Micronaut 2.x
env:
SIGNING_SECRET_KEY_PATH: ${{ steps.write_file.outputs.filePath }}
uses: gradle/gradle-command-action@v2
with:
arguments: -x groovydoc publishToSonatype closeAndReleaseSonatypeStagingRepository -Pversion=${{ steps.version.outputs.tag }}-micronaut-2.0 -Prelease=true --stacktrace -PmicronautVersion=2.5.13 -PspockVersion=2.0-groovy-3.0 -PgroovyVersion=3.0.9
- name: Release Micronaut 3.x
env:
SIGNING_SECRET_KEY_PATH: ${{ steps.write_file.outputs.filePath }}
uses: gradle/gradle-command-action@v2
with:
arguments: migrateImports gitPublishPush -x groovydoc -x aggregateGroovydoc publishToSonatype closeAndReleaseSonatypeStagingRepository -Pversion=${{ steps.version.outputs.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 publishToSonatype closeAndReleaseSonatypeStagingRepository -Pversion=${{ steps.version.outputs.tag }} -Prelease=true --stacktrace -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 everything is migrated to Micronaut 4.x
# - agorapulse/agorapulse-bom
- agorapulse/agorapulse-oss
steps:
- uses: actions/checkout@v1
Expand All @@ -68,4 +54,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-worker", "version": "${{ steps.version.outputs.tag }}-micronaut-1.0", "property" : "micronaut.worker.version", "github" : ${{ toJson(github) }} }'
client-payload: '{ "group": "com.agorapulse", "module": "micronaut-worker", "version": "${{ steps.version.outputs.tag }}", "property" : "micronaut.worker.version", "github" : ${{ toJson(github) }} }'
65 changes: 22 additions & 43 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -100,8 +100,12 @@ config {
autoLinks {
enabled = false
}
aggregate {
enabled = false
}
}
sourceHtml {
groovydoc {
enabled = false
aggregate {
enabled = false
}
Expand Down Expand Up @@ -137,11 +141,20 @@ allprojects {

gradleProjects {
subprojects {
dirs(['libs', 'examples']) { Project subproject ->
apply plugin: 'micronaut-compatibility'
dirs(['libs']) { Project subproject ->
java {
toolchain {
languageVersion = JavaLanguageVersion.of(17)
}
}

sourceCompatibility = 1.8
targetCompatibility = 1.8
micronaut {
importMicronautPlatform = true
testRuntime 'spock'
processing {
incremental false
}
}

repositories {
mavenCentral()
Expand All @@ -164,44 +177,16 @@ gradleProjects {
}

dependencies {
annotationProcessor platform("org.codehaus.groovy:groovy-bom:$groovyVersion")
api platform("org.codehaus.groovy:groovy-bom:$groovyVersion")
implementation platform("org.codehaus.groovy:groovy-bom:$groovyVersion")
compileOnly platform("org.codehaus.groovy:groovy-bom:$groovyVersion")
testImplementation platform("org.codehaus.groovy:groovy-bom:$groovyVersion")

annotationProcessor platform("io.micronaut:micronaut-bom:$micronautVersion")
api platform("io.micronaut:micronaut-bom:$micronautVersion")
implementation platform("io.micronaut:micronaut-bom:$micronautVersion")
compileOnly platform("io.micronaut:micronaut-bom:$micronautVersion")
testImplementation platform("io.micronaut:micronaut-bom:$micronautVersion")

annotationProcessor 'io.micronaut:micronaut-inject-java'
annotationProcessor 'io.micronaut:micronaut-validation'

implementation 'io.micronaut:micronaut-core'
implementation 'io.micronaut:micronaut-inject'
implementation 'io.micronaut:micronaut-validation'
implementation 'io.micronaut:micronaut-runtime'
annotationProcessor 'io.micronaut.validation:micronaut-validation-processor'

implementation 'io.micronaut.validation:micronaut-validation'

compileOnly 'io.micronaut:micronaut-inject-groovy'
compileOnly "com.agorapulse:remember:$rememberVersion"

testImplementation("org.spockframework:spock-core") {
exclude group: 'org.codehaus.groovy', module: 'groovy-all'
version {
strictly spockVersion
}
}

testImplementation 'com.agorapulse:micronaut-log4aws:1.1.5'
testImplementation 'com.agorapulse:micronaut-log4aws:4.0.0'
testImplementation 'io.micronaut:micronaut-inject-groovy'
testImplementation 'io.micronaut.test:micronaut-test-spock'

testImplementation(group: 'org.testcontainers', name: 'spock', version: project.testcontainersVersion) {
exclude group: 'org.codehaus.groovy', module: 'groovy-all'
}
testImplementation(group: 'org.testcontainers', name: 'spock', version: project.testcontainersVersion)
}

// useful for IntelliJ
Expand All @@ -210,9 +195,7 @@ gradleProjects {
}

clean.dependsOn cleanOut
}

dir('libs') {
processResources {
filesMatching('**/org.codehaus.groovy.runtime.ExtensionModule') {
filter(org.apache.tools.ant.filters.ReplaceTokens, tokens: [VERSION: version])
Expand All @@ -222,10 +205,6 @@ gradleProjects {
jar {
manifest.attributes provider: 'gradle'
}

dependencies {
testImplementation group: 'org.spockframework', name: 'spock-core', version: spockVersion
}
}

dir('examples') {
Expand Down
34 changes: 0 additions & 34 deletions buildSrc/build.gradle

This file was deleted.

Loading

0 comments on commit 36af74d

Please sign in to comment.