Skip to content

Commit

Permalink
Merge pull request #37 from agorapulse/chore/upgrade-to-micronuat-4.x
Browse files Browse the repository at this point in the history
Upgraded to Micronaut 4.x
  • Loading branch information
musketyr authored Dec 19, 2023
2 parents e397ec7 + e26d979 commit 2e7b1b1
Show file tree
Hide file tree
Showing 19 changed files with 83 additions and 236 deletions.
27 changes: 0 additions & 27 deletions .github/workflows/gradle-versions-watchdog.yml

This file was deleted.

28 changes: 5 additions & 23 deletions .github/workflows/gradle.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,31 +6,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'
- 'check -PmicronautVersion=2.5.13 -PspockVersion=2.0-groovy-3.0 -PgroovyVersion=3.0.9'
- 'check -PmicronautVersion=3.2.1 -PspockVersion=2.0-groovy-3.0 -PgroovyVersion=3.0.9'
steps:
- uses: actions/checkout@v2

- name: Setup Java 8
uses: actions/setup-java@v3
- uses: actions/checkout@v3
- uses: actions/setup-java@v3
with:
distribution: corretto
java-version: 8
cache: gradle
distribution: zulu
java-version: 17
- uses: gradle/gradle-command-action@v2
with:
arguments: ${{ matrix.versions }} --scan --parallel
- name: Show Reports
uses: actions/upload-artifact@v1
if: failure()
with:
name: reports
path: build/reports/
arguments: check coveralls
12 changes: 4 additions & 8 deletions .github/workflows/publish_documentation.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,16 +6,12 @@ jobs:
publish:
name: Publish Documentation
runs-on: ubuntu-latest
env:
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
distribution: zulu
java-version: 17
- name: Get Latest Release
id: latest_version
uses: abatilo/release-info-action@v1.3.0
Expand All @@ -25,4 +21,4 @@ jobs:
- name: Publish GitHub Pages
uses: gradle/gradle-command-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 }}
32 changes: 9 additions & 23 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/checkout@v3
- uses: actions/setup-java@v3
with:
distribution: corretto
java-version: 8
cache: gradle
distribution: zulu
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: 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: 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
env:
SIGNING_SECRET_KEY_PATH: ${{ steps.write_file.outputs.filePath }}
uses: gradle/gradle-command-action@v2
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 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.GITHUB_PERSONAL_TOKEN }}
repository: ${{ matrix.repository }}
event-type: ap-new-version-released-event
client-payload: '{ "group": "com.agorapulse", "module": "micronaut-log4aws", "version": "${{ steps.version.outputs.tag }}-micronaut-1.0", "property" : "micronaut.log4aws.version", "github" : ${{ toJson(github) }} }'
client-payload: '{ "group": "com.agorapulse", "module": "micronaut-log4aws", "version": "${{ steps.version.outputs.tag }}", "property" : "micronaut.log4aws.version", "github" : ${{ toJson(github) }} }'
28 changes: 20 additions & 8 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 Down Expand Up @@ -131,16 +139,20 @@ subprojects { subproject ->
if (subproject.name == 'guide') return

apply plugin: 'groovy'
apply plugin: 'io.micronaut.minimal.library'

java {
toolchain {
languageVersion = JavaLanguageVersion.of(17)
}
}

dependencies {
compile platform("org.spockframework:spock-bom:$spockVersion")
testCompile platform("org.spockframework:spock-bom:$spockVersion")
// add your global dependencies
testCompile("org.spockframework:spock-core") {
exclude group: "org.codehaus.groovy", module: "groovy-all"
micronaut {
importMicronautPlatform = true
testRuntime 'spock'
processing {
incremental false
}
testCompile "net.bytebuddy:byte-buddy:$bytebuddyVersion"
testCompile "org.objenesis:objenesis:$objenesisVersion"
}

// useful for Micronaut
Expand Down
40 changes: 0 additions & 40 deletions examples/micronaut-log4aws-demo/micronaut-log4aws-demo.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -17,55 +17,15 @@
*/
plugins {
id 'groovy'
id "jp.classmethod.aws.lambda"
id "com.github.johnrengelman.shadow"
}

dependencies {
implementation project(':micronaut-log4aws')

annotationProcessor platform("io.micronaut:micronaut-bom:$micronautVersion")
implementation platform("io.micronaut:micronaut-bom:$micronautVersion")
testAnnotationProcessor platform("io.micronaut:micronaut-bom:$micronautVersion")
testCompile platform("io.micronaut:micronaut-bom:$micronautVersion")

annotationProcessor "io.micronaut:micronaut-inject-java"

implementation "io.micronaut:micronaut-core"
implementation "io.micronaut:micronaut-function"
implementation 'javax.inject:javax.inject:1'

compileOnly "io.micronaut:micronaut-inject-groovy"

testAnnotationProcessor "io.micronaut:micronaut-inject-java"

testImplementation "io.micronaut:micronaut-inject-groovy"
testImplementation "com.github.stefanbirkner:system-lambda:$systemLambdaVersion"
testImplementation("org.spockframework:spock-core") {
exclude group: "org.codehaus.groovy", module: "groovy-all"
}
}


shadowJar {
mergeServiceFiles()
mergeGroovyExtensionModules()
transform(com.github.jengelman.gradle.plugins.shadow.transformers.Log4j2PluginsCacheFileTransformer)
}

aws {
profileName = 'beta'
region = 'eu-west-1'
}

task deploy(type: jp.classmethod.aws.gradle.lambda.AWSLambdaMigrateFunctionTask, dependsOn: shadowJar) {
functionName = "MicronautLog4AwsDemo"
handler = "com.agorapulse.micronaut.log4aws.demo.LoggingDemo::apply"
role = "arn:aws:iam::${aws.accountId}:role/lambda-basic-role"
runtime = com.amazonaws.services.lambda.model.Runtime.Java8
zipFile = shadowJar.archivePath
memorySize = 1024
timeout = 300
publish = true
}

Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
import io.micronaut.function.FunctionBean;
import io.micronaut.function.executor.FunctionInitializer;

import javax.inject.Inject;
import jakarta.inject.Inject;
import java.util.Map;
import java.util.function.Function;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

import javax.inject.Singleton;
import jakarta.inject.Singleton;
import java.util.Map;
import java.util.stream.Collectors;

Expand Down
16 changes: 7 additions & 9 deletions gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -19,17 +19,15 @@
slug = agorapulse/micronaut-log4aws
group = com.agorapulse

kordampPluginVersion = 0.46.0
kordampPluginVersion = 0.53.0
coverallsPluginVersion = 2.9.0
gitPublishPluginVersion = 2.1.3
nexusPluginVersion=1.0.0

micronautVersion = 1.3.7
micronautVersion = 4.2.0
micronautGradlePluginVersion = 4.2.0
sentryVersion = 6.16.0
log4jVersion = 2.20.0
awsLog4jVersion = 1.5.1
systemLambdaVersion = 1.2.0
gruVersion = 0.9.4
bytebuddyVersion = 1.10.17
objenesisVersion = 3.1
spockVersion=2.0-groovy-2.5
log4jVersion = 2.22.0
awsLog4jVersion = 1.6.0
systemLambdaVersion = 1.2.1
gruVersion = 2.0.5
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.9.1-all.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-8.5-all.zip
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
15 changes: 3 additions & 12 deletions settings.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -38,28 +38,19 @@ buildscript {
}
dependencies {
classpath group: "org.kordamp.gradle", name: "settings-gradle-plugin", version: kordampPluginVersion
// forces the version suitable for all currently used plugins
classpath 'org.eclipse.jgit:org.eclipse.jgit:5.6.0.201912101111-r', {
force = true
}
classpath 'org.ajoberstar.grgit:grgit-core:4.0.1'
classpath 'jp.classmethod.aws:gradle-aws-plugin:0.41'
classpath 'com.github.jengelman.gradle.plugins:shadow:5.2.0'
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"
}
}
}

Expand Down
40 changes: 10 additions & 30 deletions subprojects/micronaut-log4aws/micronaut-log4aws.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -26,48 +26,28 @@ config {
}

dependencies {
// rewrite("org.openrewrite.recipe:rewrite-micronaut:1.3.0")

annotationProcessor enforcedPlatform("io.micronaut:micronaut-bom:$micronautVersion")
api enforcedPlatform("io.micronaut:micronaut-bom:$micronautVersion")
testAnnotationProcessor enforcedPlatform("io.micronaut:micronaut-bom:$micronautVersion")
testImplementation enforcedPlatform("io.micronaut:micronaut-bom:$micronautVersion")

annotationProcessor enforcedPlatform("org.apache.logging.log4j:log4j-bom:$log4jVersion")
api enforcedPlatform("org.apache.logging.log4j:log4j-bom:$log4jVersion")
testAnnotationProcessor enforcedPlatform("org.apache.logging.log4j:log4j-bom:$log4jVersion")
testImplementation enforcedPlatform("org.apache.logging.log4j:log4j-bom:$log4jVersion")

annotationProcessor "io.micronaut:micronaut-inject-java"
annotationProcessor platform("org.apache.logging.log4j:log4j-bom:$log4jVersion")
api platform("org.apache.logging.log4j:log4j-bom:$log4jVersion")
testAnnotationProcessor platform("org.apache.logging.log4j:log4j-bom:$log4jVersion")
testImplementation platform("org.apache.logging.log4j:log4j-bom:$log4jVersion")

api "io.sentry:sentry-log4j2:$sentryVersion"
api group: 'com.amazonaws', name: 'aws-lambda-java-log4j2', version: awsLog4jVersion
api "org.apache.logging.log4j:log4j-slf4j-impl:$log4jVersion"
api "com.amazonaws:aws-lambda-java-log4j2:$awsLog4jVersion"
api "org.apache.logging.log4j:log4j-slf4j2-impl:$log4jVersion"
api "org.apache.logging.log4j:log4j-api:$log4jVersion"
api "org.apache.logging.log4j:log4j-core:$log4jVersion"

implementation "io.micronaut:micronaut-core"

compileOnly 'io.micronaut:micronaut-function'
compileOnly 'io.micronaut:micronaut-http'
implementation 'io.micronaut:micronaut-aop'
implementation 'io.reactivex.rxjava2:rxjava'
implementation 'javax.inject:javax.inject:1'

testAnnotationProcessor "io.micronaut:micronaut-inject-java"

testImplementation "io.micronaut:micronaut-inject-groovy"
testImplementation "io.micronaut:micronaut-validation"
testImplementation "io.micronaut:micronaut-http-server-netty"
testImplementation 'io.micronaut.validation:micronaut-validation'
testImplementation 'io.micronaut:micronaut-http-server-netty'

testImplementation "com.github.stefanbirkner:system-lambda:$systemLambdaVersion"
testImplementation "com.agorapulse:gru-micronaut:$gruVersion"

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

testImplementation "com.agorapulse:gru-http:$gruVersion"
testImplementation "net.bytebuddy:byte-buddy:$bytebuddyVersion"
testImplementation "org.objenesis:objenesis:$objenesisVersion"
testImplementation 'io.micronaut:micronaut-jackson-databind'
}

Loading

0 comments on commit 2e7b1b1

Please sign in to comment.