Skip to content

Commit

Permalink
Merge pull request #57 from agorapulse/feature/migrate-to-micronaut-4x
Browse files Browse the repository at this point in the history
migrate to micronaut 4x
  • Loading branch information
musketyr authored Dec 19, 2023
2 parents f5ac2cc + 3331f1d commit 6e01e81
Show file tree
Hide file tree
Showing 73 changed files with 227 additions and 253 deletions.
25 changes: 0 additions & 25 deletions .github/workflows/gradle-versions-watchdog.yml

This file was deleted.

23 changes: 5 additions & 18 deletions .github/workflows/gradle.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,26 +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'
- 'migrateMicronautImports check -PmicronautVersion=3.2.1 -PspockVersion=2.0-groovy-3.0 -PgroovyVersion=3.0.9 --scan'
steps:
- uses: actions/checkout@v2
- uses: actions/setup-java@v2
- uses: actions/checkout@v3
- uses: actions/setup-java@v3
with:
java-version: '8'
java-version: 17
distribution: zulu
cache: 'gradle'
- uses: eskatos/gradle-command-action@v2
- uses: gradle/gradle-build-action@v2
with:
arguments: ${{ matrix.versions }}
- name: Show Build Scan
if: always()
run: cat scan-journal.log
arguments: check
12 changes: 5 additions & 7 deletions .github/workflows/publish-documentation.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,19 +10,17 @@ 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
distribution: zulu
java-version: 17
- name: Get Latest Release
id: latest_version
uses: abatilo/[email protected]
with:
owner: agorapulse
repo: micronaut-slack
- name: Publish GitHub Pages
uses: eskatos/gradle-command-action@v2
uses: gradle/gradle-build-action@v2
with:
arguments: migrateMicronautImports gitPublishPush -x groovydoc -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 }}
29 changes: 8 additions & 21 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,12 +15,10 @@ jobs:
SIGNING_PASSWORD: ${{ secrets.SIGNING_PASSWORD }}
steps:
- uses: actions/checkout@v2
- name: Set up JDK 1.8
uses: actions/setup-java@v2
- uses: actions/setup-java@v2
with:
java-version: '8'
java-version: 17
distribution: zulu
cache: 'gradle'
- name: Semantic Version
id: version
uses: ncipollo/semantic-version-action@v1
Expand All @@ -30,32 +28,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: eskatos/gradle-command-action@v2
uses: gradle/gradle-build-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: eskatos/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: eskatos/gradle-command-action@v2
with:
arguments: migrateMicronautImports 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 -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 +55,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-slack", "version": "${{ steps.version.outputs.tag }}-micronaut-1.0", "property" : "micronaut.slack.version", "github" : ${{ toJson(github) }} }'
client-payload: '{ "group": "com.agorapulse", "module": "micronaut-slack", "version": "${{ steps.version.outputs.tag }}", "property" : "micronaut.slack.version", "github" : ${{ toJson(github) }} }'
54 changes: 28 additions & 26 deletions build.gradle
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
/*
* SPDX-License-Identifier: Apache-2.0
*
* Copyright 2022 Agorapulse.
* Copyright 2022-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 Down Expand Up @@ -94,6 +94,14 @@ config {
}

docs {
javadoc {
autoLinks {
enabled = false
}
aggregate {
enabled = false
}
}
groovydoc {
enabled = false
aggregate {
Expand Down Expand Up @@ -126,11 +134,22 @@ allprojects {
}
}

projects {
gradleProjects {
subprojects {
dirs(['libs', 'examples']) { Project subproject ->
sourceCompatibility = 1.8
targetCompatibility = 1.8
java {
toolchain {
languageVersion = JavaLanguageVersion.of(17)
}
}

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

repositories {
mavenCentral()
Expand All @@ -154,33 +173,14 @@ projects {
}

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")

annotationProcessor platform("io.micronaut:micronaut-bom:$micronautVersion")
annotationProcessor "io.micronaut:micronaut-inject-java"

implementation platform("io.micronaut:micronaut-bom:$micronautVersion")
implementation "io.micronaut:micronaut-runtime"

testAnnotationProcessor platform("io.micronaut:micronaut-bom:$micronautVersion")
testAnnotationProcessor "io.micronaut:micronaut-inject-java"

testImplementation platform("io.micronaut:micronaut-bom:$micronautVersion")

testImplementation "org.junit.jupiter:junit-jupiter-api"
testImplementation "io.micronaut.test:micronaut-test-junit5"
testImplementation("org.spockframework:spock-core")
testImplementation "org.codehaus.groovy:groovy:$groovyVersion"

testImplementation "io.micronaut:micronaut-inject-groovy"
testImplementation "io.micronaut.test:micronaut-test-spock"
testRuntimeOnly "org.junit.jupiter:junit-jupiter-engine"
testRuntimeOnly "org.junit.vintage:junit-vintage-engine:5.5.0"
testRuntimeOnly "org.junit.vintage:junit-vintage-engine"
}

// useful for IntelliJ
Expand All @@ -207,9 +207,11 @@ projects {
enabled = true
}
}
}

dependencies {
testImplementation group: 'org.spockframework', name: 'spock-core', version: spockVersion
dirs(['examples']){
micronaut {
runtime 'netty'
}
}
}
Expand Down
2 changes: 1 addition & 1 deletion docs/guide/guide.gradle
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
/*
* SPDX-License-Identifier: Apache-2.0
*
* Copyright 2022 Agorapulse.
* Copyright 2022-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 Down
3 changes: 2 additions & 1 deletion examples/commander/commander.gradle
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
/*
* SPDX-License-Identifier: Apache-2.0
*
* Copyright 2022 Agorapulse.
* Copyright 2022-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 @@ -19,4 +19,5 @@ dependencies {
implementation project(':micronaut-slack-http')
implementation 'io.micronaut:micronaut-http-server-netty'
implementation 'ch.qos.logback:logback-classic:1.4.1'
implementation 'org.yaml:snakeyaml'
}
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
/*
* SPDX-License-Identifier: Apache-2.0
*
* Copyright 2022 Agorapulse.
* Copyright 2022-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 @@ -23,7 +23,7 @@
import com.slack.api.bolt.response.Response;
import io.micronaut.core.util.StringUtils;

import javax.inject.Singleton;
import jakarta.inject.Singleton;

@Singleton
public class CommandHandler implements MicronautSlashCommandHandler { // <1>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
/*
* SPDX-License-Identifier: Apache-2.0
*
* Copyright 2022 Agorapulse.
* Copyright 2022-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 Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
/*
* SPDX-License-Identifier: Apache-2.0
*
* Copyright 2022 Agorapulse.
* Copyright 2022-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 @@ -15,12 +15,9 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
plugins {
id 'application'
}

dependencies {
implementation project(':micronaut-slack-http')
implementation 'io.micronaut:micronaut-http-server-netty'
implementation 'ch.qos.logback:logback-classic:1.4.1'
implementation 'org.yaml:snakeyaml'
}
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
/*
* SPDX-License-Identifier: Apache-2.0
*
* Copyright 2022 Agorapulse.
* Copyright 2022-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 @@ -21,7 +21,7 @@
import com.agorapulse.slack.install.event.BotSavedEvent;
import io.micronaut.context.event.ApplicationEventListener;

import javax.inject.Singleton;
import jakarta.inject.Singleton;

@Singleton
public class BotSavedHandler implements ApplicationEventListener<BotSavedEvent> {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
/*
* SPDX-License-Identifier: Apache-2.0
*
* Copyright 2022 Agorapulse.
* Copyright 2022-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 Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
/*
* SPDX-License-Identifier: Apache-2.0
*
* Copyright 2022 Agorapulse.
* Copyright 2022-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 @@ -23,7 +23,7 @@
import com.slack.api.bolt.request.builtin.BlockActionRequest;
import com.slack.api.bolt.response.Response;

import javax.inject.Singleton;
import jakarta.inject.Singleton;
import java.io.IOException;
import java.util.Optional;
import java.util.regex.Pattern;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
/*
* SPDX-License-Identifier: Apache-2.0
*
* Copyright 2022 Agorapulse.
* Copyright 2022-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 @@ -27,7 +27,7 @@
import io.micronaut.runtime.event.ApplicationStartupEvent;
import io.micronaut.runtime.event.annotation.EventListener;

import javax.inject.Singleton;
import jakarta.inject.Singleton;
import java.io.IOException;
import java.util.List;
import java.util.Optional;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
/*
* SPDX-License-Identifier: Apache-2.0
*
* Copyright 2022 Agorapulse.
* Copyright 2022-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 Down Expand Up @@ -29,7 +29,7 @@
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

import javax.inject.Singleton;
import jakarta.inject.Singleton;
import java.io.IOException;
import java.util.Optional;

Expand Down
Loading

0 comments on commit 6e01e81

Please sign in to comment.