Skip to content

Commit

Permalink
Support for Spring-Boot 3.1.0 #116 (#117)
Browse files Browse the repository at this point in the history
* Support for Spring-Boot 3.1.0 #116
  • Loading branch information
osoykan authored May 22, 2023
1 parent 69f7895 commit 3254883
Show file tree
Hide file tree
Showing 16 changed files with 48 additions and 35 deletions.
8 changes: 4 additions & 4 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@ name: Build

on:
push:
branches: [master]
branches: [main, 2.x]
pull_request:
branches: [master]
branches: [main, 2.x]

jobs:
build-and-test:
Expand All @@ -13,7 +13,7 @@ jobs:
- name: Install Java and Maven
uses: actions/setup-java@v3
with:
java-version: 11
java-version: 17
distribution: 'temurin'

- name: Check out Git repository
Expand All @@ -30,4 +30,4 @@ jobs:
name: codecov-umbrella
fail_ci_if_error: true
verbose: true
java-version: 11
java-version: 17
4 changes: 2 additions & 2 deletions .github/workflows/gradle-publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,10 @@ jobs:

steps:
- uses: actions/checkout@v3
- name: Set up JDK 11
- name: Set up JDK 17
uses: actions/setup-java@v3
with:
java-version: '11'
java-version: '17'
distribution: 'temurin'
server-id: github
settings-path: ${{ github.workspace }}
Expand Down
1 change: 1 addition & 0 deletions .java-version
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
17.0.6
22 changes: 7 additions & 15 deletions build.gradle.kts
Original file line number Diff line number Diff line change
@@ -1,14 +1,19 @@
group = "com.trendyol"
version = "2.1.0"

plugins {
kotlin("jvm") version "1.8.21"
id("kediatr-publishing") apply false
id("kediatr-coverage")
id("org.jlleitschuh.gradle.ktlint") version "11.3.2"
id("com.palantir.git-version") version "3.0.0"
java
}

val versionDetails: groovy.lang.Closure<com.palantir.gradle.gitversion.VersionDetails> by extra
val details = versionDetails()
version = details.lastTag
// version = "3.0.0-SNAPSHOT"

jacoco {
reportsDirectory.set(rootProject.buildDir.resolve("jacoco"))
}
Expand Down Expand Up @@ -47,7 +52,7 @@ subprojectsOf("project") {
tasks.withType<org.jetbrains.kotlin.gradle.tasks.KotlinCompile> {
kotlinOptions {
freeCompilerArgs = listOf("-Xjsr305=strict")
jvmTarget = "11"
jvmTarget = "17"
}
}

Expand All @@ -68,19 +73,6 @@ subprojectsOf("project") {
}
}

allprojects {
repositories {
mavenCentral()
maven {
url = uri("https://oss.sonatype.org/content/repositories/snapshots")
}

maven {
url = uri("https://repo.maven.apache.org/maven2/")
}
}
}

tasks.check {
dependsOn(tasks.named("testCodeCoverageReport"))
}
Expand Down
15 changes: 12 additions & 3 deletions buildSrc/src/main/kotlin/kediatr-publishing.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,11 @@ afterEvaluate {
}
}
developers {
developer {
id.set("osoykan")
name.set("Oguzhan Soykan")
email.set("[email protected]")
}
developer {
id.set("canerpatir")
name.set("Caner Patir")
Expand Down Expand Up @@ -71,9 +76,13 @@ afterEvaluate {
val signingKey = getProperty(projectKey = "gpg.key", environmentKey = "gpg_private_key")
val passPhrase = getProperty(projectKey = "gpg.passphrase", environmentKey = "gpg_passphrase")
signing {
if (passPhrase == null) logger.warn(
"The passphrase for the signing key was not found. Either provide it as env variable 'gpg_passphrase' or as project property 'gpg_passphrase'. Otherwise the signing might fail!"
)
if (passPhrase == null) {
logger.warn(
"The passphrase for the signing key was not found. " +
"Either provide it as env variable 'gpg_passphrase' or as project property 'gpg_passphrase'. " +
"Otherwise the signing might fail!"
)
}
useInMemoryPgpKeys(signingKey, passPhrase)
sign(publishing.publications)
}
Expand Down
3 changes: 2 additions & 1 deletion project/kediatr-spring-starter/build.gradle.kts
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
val springVersion = "2.7.12"
val springVersion = "3.1.0"
dependencies {
api(project(":project:kediatr-core"))
implementation("org.springframework.boot:spring-boot-starter:$springVersion")
implementation("org.springframework.boot:spring-boot-autoconfigure:$springVersion")
}

dependencies {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,12 @@ package com.trendyol.kediatr.spring

import com.trendyol.kediatr.Mediator
import com.trendyol.kediatr.MediatorBuilder
import org.springframework.boot.autoconfigure.AutoConfiguration
import org.springframework.context.ApplicationContext
import org.springframework.context.annotation.Bean
import org.springframework.context.annotation.Configuration

@Configuration
open class KediatRConfiguration {
@AutoConfiguration
open class KediatRAutoConfiguration {
@Bean
open fun kediatRSpringBeanProvider(applicationContext: ApplicationContext): KediatRSpringBeanProvider {
return KediatRSpringBeanProvider(applicationContext)
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
# Register EnableAutoConfiguration
org.springframework.boot.autoconfigure.EnableAutoConfiguration = \
com.trendyol.kediatr.spring.KediatRConfiguration
com.trendyol.kediatr.spring.KediatRAutoConfiguration
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
com.trendyol.kediatr.spring.KediatRAutoConfiguration
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ import kotlin.test.assertTrue
private var springTestCounter = 0
private var springAsyncTestCounter = 0

@SpringBootTest(classes = [KediatRConfiguration::class, MyCommandHandler::class])
@SpringBootTest(classes = [KediatRAutoConfiguration::class, MyCommandHandler::class])
class CommandHandlerTest {

init {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ import kotlin.test.*
private var springTestCounter = 0
private var springAsyncTestCounter = 0

@SpringBootTest(classes = [KediatRConfiguration::class, MyAsyncCommandRHandler::class])
@SpringBootTest(classes = [KediatRAutoConfiguration::class, MyAsyncCommandRHandler::class])
class CommandWithResultHandlerTest {

init {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ var asyncNotificationTestCounter = 0

@SpringBootTest(
classes = [
KediatRConfiguration::class,
KediatRAutoConfiguration::class,
MyFirstNotificationHandler::class
]
)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ var loggingPipelineBehaviorHandleBeforeNextCounter = 0
var loggingPipelineBehaviorHandleAfterNextCounter = 0

@SpringBootTest(
classes = [KediatRConfiguration::class, MyCommandHandler::class, ExceptionPipelineBehavior::class, LoggingPipelineBehavior::class]
classes = [KediatRAutoConfiguration::class, MyCommandHandler::class, ExceptionPipelineBehavior::class, LoggingPipelineBehavior::class]
)
class PipelineBehaviorTest {

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ import kotlin.test.assertFailsWith
import kotlin.test.assertNotNull
import kotlin.test.assertTrue

@SpringBootTest(classes = [KediatRConfiguration::class, TestQueryHandler::class])
@SpringBootTest(classes = [KediatRAutoConfiguration::class, TestQueryHandler::class])
class QueryHandlerTest {

@Autowired
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import org.springframework.beans.factory.annotation.Autowired
import org.springframework.boot.test.context.SpringBootTest
import kotlin.test.assertNotNull

@SpringBootTest(classes = [KediatRConfiguration::class])
@SpringBootTest(classes = [KediatRAutoConfiguration::class])
class SpringContextTest {

@Autowired
Expand Down
9 changes: 9 additions & 0 deletions settings.gradle.kts
Original file line number Diff line number Diff line change
@@ -1,7 +1,16 @@
@file:Suppress("UnstableApiUsage")

rootProject.name = "kediatR"
include(
"project:kediatr-core",
"project:kediatr-koin-starter",
"project:kediatr-quarkus-starter",
"project:kediatr-spring-starter"
)

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

0 comments on commit 3254883

Please sign in to comment.