Skip to content

Commit

Permalink
Migrate to build plugins 6.1.1, update version catalog and dependenci…
Browse files Browse the repository at this point in the history
…es to correspond to changed bom/platform architecture, misc build fixes. (#641)
  • Loading branch information
wetted authored Dec 21, 2022
1 parent 651c861 commit f825f5b
Show file tree
Hide file tree
Showing 13 changed files with 92 additions and 39 deletions.
18 changes: 17 additions & 1 deletion .github/workflows/graalvm.yml
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,11 @@ jobs:
version: ${{ matrix.graalvm }}
java-version: ${{ matrix.java }}
components: 'native-image'
github-token: ${{ secrets.GITHUB_TOKEN }}
- name: Setup Gradle
uses: gradle/gradle-build-action@v2.3.3
- name: Build with Gradle
id: gradle
run: |
if ./gradlew tasks --no-daemon --all | grep -w "testNativeImage"
then
Expand All @@ -56,9 +60,21 @@ jobs:
GRADLE_ENTERPRISE_CACHE_USERNAME: ${{ secrets.GRADLE_ENTERPRISE_CACHE_USERNAME }}
GRADLE_ENTERPRISE_CACHE_PASSWORD: ${{ secrets.GRADLE_ENTERPRISE_CACHE_PASSWORD }}
PREDICTIVE_TEST_SELECTION: "${{ github.event_name == 'pull_request' && 'true' || 'false' }}"
- name: Add build scan URL as PR comment
uses: actions/github-script@v5
if: github.event_name == 'pull_request' && failure()
with:
github-token: ${{secrets.GITHUB_TOKEN}}
script: |
github.rest.issues.createComment({
issue_number: context.issue.number,
owner: context.repo.owner,
repo: context.repo.repo,
body: '❌ ${{ github.workflow }} ${{ matrix.java }} ${{ matrix.graalvm }} failed: ${{ steps.gradle.outputs.build-scan-url }}'
})
- name: Publish Test Report
if: always()
uses: mikepenz/action-junit-report@v3.6.1
uses: mikepenz/action-junit-report@v3.7.0
with:
check_name: GraalVM CE CI / Test Report (Java ${{ matrix.java }})
report_paths: '**/build/test-results/test/TEST-*.xml'
Expand Down
25 changes: 16 additions & 9 deletions .github/workflows/gradle.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,17 +29,13 @@ jobs:
sudo apt-get clean
df -h
- uses: actions/checkout@v3
- uses: actions/cache@v3
with:
path: ~/.gradle/caches
key: ${{ runner.os }}-gradle-${{ hashFiles('**/*.gradle') }}
restore-keys: |
${{ runner.os }}-gradle-
- name: Set up JDK
uses: actions/setup-java@v3
with:
distribution: 'temurin'
java-version: ${{ matrix.java }}
- name: Setup Gradle
uses: gradle/gradle-build-action@v2.3.3
- name: Optional setup step
env:
GRADLE_ENTERPRISE_ACCESS_KEY: ${{ secrets.GRADLE_ENTERPRISE_ACCESS_KEY }}
Expand All @@ -48,19 +44,30 @@ jobs:
run: |
[ -f ./setup.sh ] && ./setup.sh || true
- name: Build with Gradle
id: gradle
run: |
# Awful hack for kapt and JDK 16. See https://youtrack.jetbrains.com/issue/KT-45545
if [ ${{ matrix.java }} == 16 ]; then export GRADLE_OPTS="-Dorg.gradle.jvmargs=--illegal-access=permit"; fi
./gradlew check --no-daemon --parallel --continue
env:
TESTCONTAINERS_RYUK_DISABLED: true
GRADLE_ENTERPRISE_ACCESS_KEY: ${{ secrets.GRADLE_ENTERPRISE_ACCESS_KEY }}
GRADLE_ENTERPRISE_CACHE_USERNAME: ${{ secrets.GRADLE_ENTERPRISE_CACHE_USERNAME }}
GRADLE_ENTERPRISE_CACHE_PASSWORD: ${{ secrets.GRADLE_ENTERPRISE_CACHE_PASSWORD }}
PREDICTIVE_TEST_SELECTION: "${{ github.event_name == 'pull_request' && 'true' || 'false' }}"
- name: Add build scan URL as PR comment
uses: actions/github-script@v5
if: github.event_name == 'pull_request' && failure()
with:
github-token: ${{secrets.GITHUB_TOKEN}}
script: |
github.rest.issues.createComment({
issue_number: context.issue.number,
owner: context.repo.owner,
repo: context.repo.repo,
body: '❌ ${{ github.workflow }} failed: ${{ steps.gradle.outputs.build-scan-url }}'
})
- name: Publish Test Report
if: always()
uses: mikepenz/action-junit-report@v3.6.1
uses: mikepenz/action-junit-report@v3.7.0
with:
check_name: Java CI / Test Report (${{ matrix.java }})
report_paths: '**/build/test-results/test/TEST-*.xml'
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -147,7 +147,7 @@ jobs:
actions: read # To read the workflow path.
id-token: write # To sign the provenance.
contents: write # To add assets to a release.
uses: slsa-framework/slsa-github-generator/.github/workflows/generator_generic_slsa3.yml@v1.3.0
uses: slsa-framework/slsa-github-generator/.github/workflows/generator_generic_slsa3.yml@v1.4.0
with:
base64-subjects: "${{ needs.provenance-subject.outputs.artifacts-sha256 }}"
upload-assets: true # Upload to a new release.
Expand Down
2 changes: 1 addition & 1 deletion buildSrc/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -8,5 +8,5 @@ repositories {
}

dependencies {
implementation 'io.micronaut.gradle:micronaut-gradle-plugin:3.6.5'
implementation libs.micronaut.gradle.plugin
}
7 changes: 7 additions & 0 deletions buildSrc/settings.gradle
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
dependencyResolutionManagement {
versionCatalogs {
libs {
from(files("../gradle/libs.versions.toml"))
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,6 @@ repositories {
configurations.all {
resolutionStrategy.dependencySubstitution {
substitute(module("org.codehaus.groovy:groovy"))
.using(module("org.apache.groovy:groovy:4.0.6"))
.using(module("org.apache.groovy:groovy:${libs.versions.groovy}"))
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -13,12 +13,12 @@ dependencies {

testAnnotationProcessor mn.micronaut.inject.java

testImplementation mn.micronaut.micrometer.core
testImplementation mnMicrometer.micronaut.micrometer.core
testImplementation mn.micronaut.management
testImplementation libs.testcontainers.kafka

testRuntimeOnly mn.micronaut.cache.core
testRuntimeOnly mn.micronaut.reactor
testRuntimeOnly mnCache.micronaut.cache.core
testRuntimeOnly mnReactor.micronaut.reactor
testRuntimeOnly mn.micronaut.http.server.netty
testRuntimeOnly mn.micronaut.management
testRuntimeOnly mn.snakeyaml
Expand Down
6 changes: 4 additions & 2 deletions config/checkstyle/checkstyle.xml
Original file line number Diff line number Diff line change
Expand Up @@ -96,11 +96,13 @@
<!-- Checks for Javadoc comments. -->
<!-- See https://checkstyle.org/config_javadoc.html -->
<module name="JavadocMethod">
<property name="excludeScope" value="private"/>
<property name="accessModifiers" value="public, protected"/>
</module>
<module name="JavadocType"/>
<module name="JavadocStyle"/>
<module name="MissingJavadocType"/>
<module name="MissingJavadocType">
<property name="severity" value="warning"/>
</module>

<!-- Checks for Naming Conventions. -->
<!-- See https://checkstyle.org/config_naming.html -->
Expand Down
27 changes: 24 additions & 3 deletions gradle/libs.versions.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
[versions]
micronaut = "4.0.0-SNAPSHOT"
micronaut-docs = "2.0.0"
micronaut-gradle-plugin = "3.6.6"

# Required to keep catalog compatibility with 3.4.x. Can be removed for 4.0.0
managed-kafka-compat = "3.3.1"
Expand All @@ -11,8 +12,19 @@ groovy = "4.0.6"
opentracing-kafka-client = '0.1.15'
opentracing-mock = '0.33.0'

testcontainers = "1.17.6"

zipkin-brave-kafka-clients = '5.14.1'

micronaut-cache = "4.0.0-SNAPSHOT"
micronaut-micrometer = "5.0.0-SNAPSHOT"
micronaut-reactor = "3.0.0-SNAPSHOT"
micronaut-rxjava2 = "2.0.0-SNAPSHOT"
micronaut-serde = "2.0.0-SNAPSHOT"
micronaut-tracing = "5.0.0-SNAPSHOT"
micronaut-test = "4.0.0-SNAPSHOT"


[libraries]
# Duplicated to keep catalog compatibility with 3.4.x. Can be removed for 4.0.0
managed-kafka = { module = 'org.apache.kafka:kafka-clients', version.ref = 'managed-kafka-compat' }
Expand All @@ -25,6 +37,15 @@ opentracing-mock = { module = 'io.opentracing:opentracing-mock', version.ref = '

zipkin-brave-kafka-clients = { module = 'io.zipkin.brave:brave-instrumentation-kafka-clients', version.ref = 'zipkin-brave-kafka-clients' }

testcontainers-bom = { module = "org.testcontainers:testcontainers-bom" }
testcontainers-kafka = { module = 'org.testcontainers:kafka' }
testcontainers-spock = { module = 'org.testcontainers:spock' }
testcontainers-kafka = { module = 'org.testcontainers:kafka', version.ref = 'testcontainers' }
testcontainers-spock = { module = 'org.testcontainers:spock', version.ref = 'testcontainers' }

micronaut-cache = { module = "io.micronaut.cache:micronaut-cache-bom", version.ref = "micronaut-cache" }
micronaut-micrometer = { module = "io.micronaut.micrometer:micronaut-micrometer-bom", version.ref = "micronaut-micrometer" }
micronaut-reactor = { module = "io.micronaut.reactor:micronaut-reactor-bom", version.ref = "micronaut-reactor" }
micronaut-rxjava2 = { module = "io.micronaut.rxjava2:micronaut-rxjava2-bom", version.ref = "micronaut-rxjava2" }
micronaut-serde = { module = "io.micronaut.serde:micronaut-serde-bom", version.ref = "micronaut-serde" }
micronaut-tracing = { module = "io.micronaut.tracing:micronaut-tracing-bom", version.ref = "micronaut-tracing" }

micronaut-gradle-plugin = { module = "io.micronaut.gradle:micronaut-gradle-plugin", version.ref = "micronaut-gradle-plugin" }

4 changes: 2 additions & 2 deletions kafka-streams/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ plugins {
dependencies {
api projects.kafka
api libs.managed.kafka.streams
compileOnly mn.micronaut.micrometer.core
compileOnly mnMicrometer.micronaut.micrometer.core
testImplementation mn.micronaut.http.client
testImplementation mn.micronaut.serde.jackson
testImplementation mnSerde.micronaut.serde.jackson
}
12 changes: 6 additions & 6 deletions kafka/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -13,15 +13,15 @@ dependencies {

api libs.managed.kafka.clients

compileOnly mn.micronaut.micrometer.core
compileOnly mnMicrometer.micronaut.micrometer.core
compileOnly libs.zipkin.brave.kafka.clients
compileOnly mn.micronaut.graal

testImplementation mn.micronaut.serde.jackson
testImplementation mn.micronaut.rxjava2
testImplementation mnSerde.micronaut.serde.jackson
testImplementation mnRxjava2.micronaut.rxjava2
testImplementation mn.micronaut.http.client
testImplementation mn.micronaut.rxjava2
testImplementation mnRxjava2.micronaut.rxjava2

testRuntimeOnly mn.micronaut.micrometer.registry.statsd
testRuntimeOnly mn.micronaut.tracing.core
testRuntimeOnly mnMicrometer.micronaut.micrometer.registry.statsd
testRuntimeOnly mnTracing.micronaut.tracing.core
}
16 changes: 8 additions & 8 deletions settings.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -6,22 +6,22 @@ pluginManagement {
}

plugins {
id("io.micronaut.build.shared.settings") version "6.1.0"
id("io.micronaut.build.shared.settings") version "6.1.1"
}

enableFeaturePreview("TYPESAFE_PROJECT_ACCESSORS")

dependencyResolutionManagement {
repositories {
mavenCentral()
maven { url "https://s01.oss.sonatype.org/content/repositories/snapshots/" }
}
}

rootProject.name = 'kafka-parent'

micronautBuild {
addSnapshotRepository()
importMicronautCatalog()
importMicronautCatalog("micronaut-cache")
importMicronautCatalog("micronaut-micrometer")
importMicronautCatalog("micronaut-reactor")
importMicronautCatalog("micronaut-rxjava2")
importMicronautCatalog("micronaut-serde")
importMicronautCatalog("micronaut-tracing")
}

include 'kafka-bom'
Expand Down
4 changes: 2 additions & 2 deletions tests/tasks-sasl-plaintext/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -16,12 +16,12 @@ micronaut {

dependencies {
implementation projects.kafka
implementation mn.micronaut.serde.jackson
implementation mnSerde.micronaut.serde.jackson
implementation mn.snakeyaml
testImplementation mn.micronaut.http.client
testImplementation libs.testcontainers.kafka
testImplementation libs.testcontainers.spock
testImplementation mn.micronaut.test.spock
testImplementation mnTest.micronaut.test.spock
}

graalvmNative {
Expand Down

0 comments on commit f825f5b

Please sign in to comment.