Skip to content

Commit

Permalink
Use 'kotlin-spring' gradle plugin
Browse files Browse the repository at this point in the history
  • Loading branch information
garyrussell committed Apr 30, 2018
1 parent daebf40 commit 0fce70d
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 4 deletions.
4 changes: 3 additions & 1 deletion build.gradle
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
buildscript {
ext.kotlinVersion = '1.2.40'
ext.kotlinVersion = '1.2.41'
repositories {
maven { url 'https://repo.spring.io/plugins-release' }
}
Expand All @@ -8,6 +8,7 @@ buildscript {
classpath 'org.asciidoctor:asciidoctor-gradle-plugin:1.5.3'
classpath 'me.champeau.gradle:gradle-javadoc-hotfix-plugin:0.1'
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlinVersion"
classpath "org.jetbrains.kotlin:kotlin-allopen:$kotlinVersion"
}
}

Expand Down Expand Up @@ -236,6 +237,7 @@ project('spring-rabbit') {
description = 'Spring RabbitMQ Support'

apply plugin: 'kotlin'
apply plugin: 'kotlin-spring'

dependencies {

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ class EnableRabbitKotlinTests {

@Configuration
@EnableRabbit
open class Config {
class Config {

val latch = CountDownLatch(1)

Expand All @@ -67,17 +67,18 @@ class EnableRabbitKotlinTests {
}

@Bean
open fun rabbitListenerContainerFactory(cf: CachingConnectionFactory): SimpleRabbitListenerContainerFactory {
fun rabbitListenerContainerFactory(cf: CachingConnectionFactory): SimpleRabbitListenerContainerFactory {
val factory = SimpleRabbitListenerContainerFactory()
factory.setConnectionFactory(cf)
return factory
}

@Bean
open fun cf(): CachingConnectionFactory {
fun cf(): CachingConnectionFactory {
return CachingConnectionFactory(
RabbitAvailableCondition.getBrokerRunning().connectionFactory)
}

}

}

0 comments on commit 0fce70d

Please sign in to comment.