Skip to content

Commit c590bcc

Browse files
committed
Switching Gradle build scripts to a modern plugins DSL. Also moving common parts to the root build script.
1 parent e507c0e commit c590bcc

4 files changed

Lines changed: 24 additions & 58 deletions

File tree

app/build.gradle

Lines changed: 2 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,6 @@
1-
plugins {
2-
id "org.springframework.boot"
3-
}
1+
apply plugin: "org.springframework.boot"
42

53
group = "com.webcalc"
6-
version = "0.0.1-SNAPSHOT"
7-
sourceCompatibility = 11
84

95
dependencies {
106
implementation(project(":calculator"))
@@ -13,18 +9,11 @@ dependencies {
139
implementation("org.springframework.boot:spring-boot-starter-security")
1410
testImplementation("org.springframework.boot:spring-boot-starter-test") {
1511
exclude group: "junit", module: "junit"
12+
exclude group: "org.junit.vintage", module: "junit-vintage-engine"
1613
}
1714
testImplementation("io.rest-assured:rest-assured")
1815
testImplementation("org.junit.jupiter:junit-jupiter-api")
1916
testImplementation("org.junit.jupiter:junit-jupiter-params")
2017
testRuntime("org.junit.jupiter:junit-jupiter-engine")
2118
testImplementation("org.assertj:assertj-core")
2219
}
23-
24-
test {
25-
useJUnitPlatform()
26-
27-
testLogging {
28-
events "passed", "skipped", "failed"
29-
}
30-
}

billing/build.gradle

Lines changed: 0 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1,24 +1,7 @@
1-
version = "0.0.1-SNAPSHOT"
2-
sourceCompatibility = 11
3-
4-
dependencyManagement {
5-
imports {
6-
mavenBom "org.springframework.boot:spring-boot-dependencies:${springBootVersion}"
7-
}
8-
}
9-
101
dependencies {
112
implementation(project(":calculator"))
123
testImplementation("org.junit.jupiter:junit-jupiter-api")
134
testImplementation("org.junit.jupiter:junit-jupiter-params")
145
testRuntime("org.junit.jupiter:junit-jupiter-engine")
156
testImplementation("org.assertj:assertj-core")
167
}
17-
18-
test {
19-
useJUnitPlatform()
20-
21-
testLogging {
22-
events "passed", "skipped", "failed"
23-
}
24-
}

build.gradle

Lines changed: 22 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,31 @@
1-
buildscript {
2-
ext {
3-
springBootVersion = "2.1.4.RELEASE"
4-
}
5-
repositories {
6-
mavenCentral()
7-
}
8-
dependencies {
9-
classpath("org.springframework.boot:spring-boot-gradle-plugin:${springBootVersion}")
10-
}
1+
plugins {
2+
id "java"
3+
id "io.spring.dependency-management" version "1.0.9.RELEASE"
4+
id 'org.springframework.boot' version '2.3.1.RELEASE' apply false
115
}
126

137
allprojects {
148
apply plugin: "java"
15-
apply plugin: "io.spring.dependency-management"
9+
apply plugin: 'io.spring.dependency-management'
10+
11+
version = "0.0.1-SNAPSHOT"
12+
sourceCompatibility = 11
13+
14+
dependencyManagement {
15+
imports {
16+
mavenBom org.springframework.boot.gradle.plugin.SpringBootPlugin.BOM_COORDINATES
17+
}
18+
}
1619

1720
repositories {
1821
mavenCentral()
1922
}
23+
24+
test {
25+
useJUnitPlatform()
26+
27+
testLogging {
28+
events "passed", "skipped", "failed"
29+
}
30+
}
2031
}

calculator/build.gradle

Lines changed: 0 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1,23 +1,6 @@
1-
version = "0.0.1-SNAPSHOT"
2-
sourceCompatibility = 11
3-
4-
dependencyManagement {
5-
imports {
6-
mavenBom "org.springframework.boot:spring-boot-dependencies:${springBootVersion}"
7-
}
8-
}
9-
101
dependencies {
112
testImplementation("org.junit.jupiter:junit-jupiter-api")
123
testImplementation("org.junit.jupiter:junit-jupiter-params")
134
testRuntime("org.junit.jupiter:junit-jupiter-engine")
145
testImplementation("org.assertj:assertj-core")
156
}
16-
17-
test {
18-
useJUnitPlatform()
19-
20-
testLogging {
21-
events "passed", "skipped", "failed"
22-
}
23-
}

0 commit comments

Comments
 (0)