Skip to content

Commit 4e790c8

Browse files
refs #270: move versioning to gradle properties instead of constraints (#271)
1 parent ed5bf29 commit 4e790c8

File tree

37 files changed

+216
-159
lines changed

37 files changed

+216
-159
lines changed

api/build.gradle.kts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,9 @@
11
description = "This contains the api functionality for the SQS Listener. This can be used for consumer to implement themselves"
22

3+
val awsVersion: String by project
4+
35
dependencies {
6+
api(platform("software.amazon.awssdk:bom:${awsVersion}"))
47
api("software.amazon.awssdk:sqs")
58
compileOnly(project(":documentation-annotations"))
69
}

build.gradle.kts

Lines changed: 21 additions & 54 deletions
Original file line numberDiff line numberDiff line change
@@ -8,12 +8,12 @@ import org.jetbrains.kotlin.gradle.tasks.KotlinCompile
88
plugins {
99
java
1010
`java-library`
11-
id("com.github.spotbugs") version "4.4.5"
1211
checkstyle
1312
jacoco
14-
kotlin("jvm") version "1.3.72" apply false
13+
id("com.github.spotbugs")
14+
kotlin("jvm") apply false
1515
id("org.jlleitschuh.gradle.ktlint") apply false
16-
id("io.gitlab.arturbosch.detekt") version "1.10.0" apply false
16+
id("io.gitlab.arturbosch.detekt") apply false
1717
}
1818

1919
allprojects {
@@ -27,6 +27,13 @@ allprojects {
2727
}
2828
}
2929

30+
val assertJVersion: String by project
31+
val junitJupiterVersion: String by project
32+
val logbackVersion: String by project
33+
val lombokVersion: String by project
34+
val mockitoVersion: String by project
35+
val spotbugsVersion: String by project
36+
3037
subprojects {
3138
val isKotlinProject = project.name.contains("kotlin") || project.name.contains("ktor")
3239
apply(plugin = "java-library")
@@ -45,65 +52,25 @@ subprojects {
4552
}
4653

4754
dependencies {
48-
// AWS
49-
implementation(platform("software.amazon.awssdk:bom:2.13.66"))
50-
api(platform("software.amazon.awssdk:bom:2.13.58"))
51-
52-
// Spring Boot
53-
api(platform("org.springframework.boot:spring-boot-dependencies:2.3.2.RELEASE"))
54-
5555
// Lombok
56-
compileOnly("org.projectlombok:lombok:1.18.12")
57-
annotationProcessor("org.projectlombok:lombok:1.18.12")
58-
testCompileOnly("org.projectlombok:lombok:1.18.12")
59-
testAnnotationProcessor("org.projectlombok:lombok:1.18.12")
56+
compileOnly("org.projectlombok:lombok:$lombokVersion")
57+
annotationProcessor("org.projectlombok:lombok:$lombokVersion")
58+
testCompileOnly("org.projectlombok:lombok:$lombokVersion")
59+
testAnnotationProcessor("org.projectlombok:lombok:$lombokVersion")
6060

6161
// Testing (JUnit, Mockito, etc)
62-
testImplementation("org.junit.jupiter:junit-jupiter:5.6.2")
63-
testImplementation("org.mockito:mockito-junit-jupiter:3.4.6")
64-
testImplementation("org.mockito:mockito-core:3.4.6")
65-
testImplementation("org.hamcrest:hamcrest:2.2")
66-
testImplementation("org.assertj:assertj-core:3.16.1")
62+
testImplementation("org.assertj:assertj-core:$assertJVersion")
63+
testImplementation("org.junit.jupiter:junit-jupiter:$junitJupiterVersion")
64+
testImplementation("org.mockito:mockito-junit-jupiter:$mockitoVersion")
65+
testImplementation("org.mockito:mockito-core:$mockitoVersion")
6766

6867
// Logging for tests
69-
testImplementation("ch.qos.logback:logback-core")
70-
testImplementation("ch.qos.logback:logback-classic")
68+
testImplementation("ch.qos.logback:logback-core:$logbackVersion")
69+
testImplementation("ch.qos.logback:logback-classic:$logbackVersion")
7170

7271
if (!isKotlinProject) {
7372
// SpotBugs
74-
spotbugs("com.github.spotbugs:spotbugs:4.1.1")
75-
}
76-
77-
constraints {
78-
// Jackson
79-
implementation("com.fasterxml.jackson.core:jackson-databind:2.11.1")
80-
81-
// Avro/Spring Cloud Schema Registry
82-
implementation("org.apache.avro:avro:1.10.0")
83-
implementation("org.springframework.cloud:spring-cloud-schema-registry-client:1.0.7.RELEASE")
84-
85-
// Proxying
86-
implementation("cglib:cglib:3.3.0")
87-
88-
// Slf4j
89-
implementation("org.slf4j:slf4j-api:1.7.30")
90-
91-
// Brave
92-
implementation("io.zipkin.brave:brave:5.12.4")
93-
implementation("io.zipkin.brave:brave-context-slf4j:5.12.4")
94-
implementation("io.zipkin.brave:brave-tests:5.12.4")
95-
96-
// ElasticMQ
97-
implementation("org.elasticmq:elasticmq-rest-sqs_2.12:0.15.6")
98-
99-
// AWS Xray
100-
implementation("com.amazonaws:aws-xray-recorder-sdk-core:2.6.1")
101-
implementation("com.amazonaws:aws-xray-recorder-sdk-spring:2.6.1")
102-
implementation("com.amazonaws:aws-xray-recorder-sdk-aws-sdk-v2-instrumentor:2.6.1")
103-
104-
// Logback (for tests)
105-
implementation("ch.qos.logback:logback-core:1.2.3")
106-
implementation("ch.qos.logback:logback-classic:1.2.3")
73+
spotbugs("com.github.spotbugs:spotbugs:$spotbugsVersion")
10774
}
10875
}
10976

core/build.gradle.kts

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,16 @@
11

22
description = "Contains the core functionality for the library"
33

4+
val jacksonVersion: String by project
5+
val slf4jVersion: String by project
6+
47
dependencies {
58
api(project(":java-dynamic-sqs-listener-api"))
69
implementation(project(":annotation-utils"))
710
compileOnly(project(":documentation-annotations"))
811
implementation(project(":common-utils"))
9-
implementation("org.slf4j:slf4j-api")
10-
api("com.fasterxml.jackson.core:jackson-databind")
12+
implementation("org.slf4j:slf4j-api:$slf4jVersion")
13+
api("com.fasterxml.jackson.core:jackson-databind:$jacksonVersion")
1114

1215
testImplementation(project(":elasticmq-sqs-client"))
1316
testImplementation(project(":proxy-method-interceptor"))

examples/aws-xray-spring-example/build.gradle.kts

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,10 +5,16 @@ plugins {
55
id("org.springframework.boot")
66
}
77

8+
val awsVersion: String by project
9+
val awsXrayVersion: String by project
10+
val springBootVersion: String by project
11+
812
dependencies {
13+
implementation(platform("org.springframework.boot:spring-boot-dependencies:$springBootVersion"))
14+
api(platform("software.amazon.awssdk:bom:$awsVersion"))
915
implementation("software.amazon.awssdk:sns")
10-
implementation("com.amazonaws:aws-xray-recorder-sdk-core")
11-
implementation("com.amazonaws:aws-xray-recorder-sdk-aws-sdk-v2-instrumentor")
16+
implementation("com.amazonaws:aws-xray-recorder-sdk-core:$awsXrayVersion")
17+
implementation("com.amazonaws:aws-xray-recorder-sdk-aws-sdk-v2-instrumentor:$awsXrayVersion")
1218
implementation("org.springframework.boot:spring-boot-starter")
1319
implementation(project(":aws-xray-extension-spring-boot"))
1420
implementation(project(":java-dynamic-sqs-listener-spring-starter"))

examples/core-example/build.gradle.kts

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,20 @@
11

2-
plugins {
3-
java
4-
}
5-
62
description = "Contains examples for using the core implementation of the listener with plan Java objects."
73

4+
val braveVersion: String by project
5+
val guavaVersion: String by project
6+
val logbackVersion: String by project
7+
88
dependencies {
9-
implementation("com.google.guava:guava:29.0-jre")
9+
implementation("com.google.guava:guava:$guavaVersion")
1010
implementation(project(":java-dynamic-sqs-listener-core"))
1111
implementation(project(":elasticmq-sqs-client"))
12-
implementation("io.zipkin.brave:brave")
13-
implementation("io.zipkin.brave:brave-context-slf4j")
12+
implementation("io.zipkin.brave:brave:$braveVersion")
13+
implementation("io.zipkin.brave:brave-context-slf4j:$braveVersion")
1414
implementation(project(":brave-extension-core"))
1515
compileOnly(project(":documentation-annotations"))
16-
implementation("ch.qos.logback:logback-core")
17-
implementation("ch.qos.logback:logback-classic")
16+
implementation("ch.qos.logback:logback-core:$logbackVersion")
17+
implementation("ch.qos.logback:logback-classic:$logbackVersion")
1818
}
1919

2020
tasks.create<JavaExec>("runApp") {

examples/core-kotlin-example/build.gradle.kts

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,21 @@
11

22
description = "Example of using the Core library with the Kotlin DSL, this should be equivalent to the core-examples."
33

4+
val braveVersion: String by project
5+
val jacksonVersion: String by project
6+
val logbackVersion: String by project
7+
48
dependencies {
59
implementation(kotlin("stdlib-jdk8"))
610
implementation(project(":java-dynamic-sqs-listener-core"))
711
implementation(project(":elasticmq-sqs-client"))
812
implementation(project(":core-kotlin-dsl"))
9-
implementation("io.zipkin.brave:brave")
10-
implementation("io.zipkin.brave:brave-context-slf4j")
13+
implementation("io.zipkin.brave:brave:$braveVersion")
14+
implementation("io.zipkin.brave:brave-context-slf4j:$braveVersion")
1115
implementation(project(":brave-extension-core"))
12-
implementation("ch.qos.logback:logback-core")
13-
implementation("ch.qos.logback:logback-classic")
14-
implementation("com.fasterxml.jackson.module:jackson-module-kotlin")
16+
implementation("ch.qos.logback:logback-core:$logbackVersion")
17+
implementation("ch.qos.logback:logback-classic:$logbackVersion")
18+
implementation("com.fasterxml.jackson.module:jackson-module-kotlin:$jacksonVersion")
1519
}
1620

1721
tasks.create<JavaExec>("runApp") {

examples/ktor-example/build.gradle.kts

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,17 @@
11

22
description = "Contains examples for connection to SQS in an Ktor Application"
33

4+
val logbackVersion: String by project
5+
val ktorVersion: String by project
6+
47
dependencies {
58
implementation(project(":java-dynamic-sqs-listener-core"))
69
implementation(project(":core-kotlin-dsl"))
710
implementation(project(":elasticmq-sqs-client"))
811
api(project(":java-dynamic-sqs-listener-ktor-core"))
9-
implementation("io.ktor:ktor-server-netty:1.3.2")
10-
implementation("ch.qos.logback:logback-core")
11-
implementation("ch.qos.logback:logback-classic")
12+
implementation("io.ktor:ktor-server-netty:$ktorVersion")
13+
implementation("ch.qos.logback:logback-core:$logbackVersion")
14+
implementation("ch.qos.logback:logback-classic:$logbackVersion")
1215
}
1316

1417
tasks.create<JavaExec>("runApp") {

examples/spring-aws-example/build.gradle.kts

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,10 @@ plugins {
55
id("org.springframework.boot")
66
}
77

8+
val springBootVersion: String by project
9+
810
dependencies {
11+
implementation(platform("org.springframework.boot:spring-boot-dependencies:$springBootVersion"))
912
implementation("org.springframework.boot:spring-boot-starter")
1013
implementation(project(":java-dynamic-sqs-listener-spring-starter"))
11-
implementation("org.elasticmq:elasticmq-rest-sqs_2.12")
12-
implementation(project(":local-sqs-async-client"))
1314
}

examples/spring-cloud-schema-registry-example/spring-cloud-schema-registry-consumer/build.gradle.kts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,10 @@ plugins {
77
id("com.commercehub.gradle.plugin.avro-base")
88
}
99

10+
val springBootVersion: String by project
11+
1012
dependencies {
13+
implementation(platform("org.springframework.boot:spring-boot-dependencies:$springBootVersion"))
1114
implementation("org.springframework.boot:spring-boot-starter")
1215
implementation("org.springframework.boot:spring-boot-autoconfigure-processor")
1316

examples/spring-cloud-schema-registry-example/spring-cloud-schema-registry-producer-two/build.gradle.kts

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,9 +7,14 @@ plugins {
77
id("com.commercehub.gradle.plugin.avro-base")
88
}
99

10+
val awsVersion: String by project
11+
val springBootVersion: String by project
12+
1013
dependencies {
14+
api(platform("software.amazon.awssdk:bom:$awsVersion"))
15+
api("software.amazon.awssdk:sqs")
16+
implementation(platform("org.springframework.boot:spring-boot-dependencies:$springBootVersion"))
1117
implementation("org.springframework.boot:spring-boot-starter")
12-
implementation("software.amazon.awssdk:sqs")
1318
implementation(project(":avro-spring-cloud-schema-registry-sqs-client"))
1419
}
1520

0 commit comments

Comments
 (0)