Skip to content

Commit f7e0118

Browse files
committed
feat(gradle): reactor config
1 parent 884dffc commit f7e0118

File tree

4 files changed

+15
-14
lines changed

4 files changed

+15
-14
lines changed

build.gradle

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -85,25 +85,26 @@ subprojects {
8585
testImplementation "org.mockito:mockito-core:4.11.0"
8686
}
8787

88-
task sourcesJar(type: Jar, dependsOn: classes) {
88+
tasks.register('sourcesJar', Jar) {
89+
dependsOn classes
8990
classifier = "sources"
9091
from sourceSets.main.allSource
9192
duplicatesStrategy = DuplicatesStrategy.INCLUDE // allow duplicates
9293
}
9394

9495

95-
tasks.withType(AbstractArchiveTask) {
96+
tasks.withType(AbstractArchiveTask).configureEach {
9697
preserveFileTimestamps = false
9798
reproducibleFileOrder = true
9899
duplicatesStrategy = DuplicatesStrategy.INCLUDE // allow duplicates
99100
}
100101
tasks.withType(Test).configureEach {
101102
// https://docs.gradle.org/current/dsl/org.gradle.api.tasks.testing.Test.html#org.gradle.api.tasks.testing.Test:environment
102-
environment 'CI', 'true'
103+
/* environment 'CI', 'true'*/
103104
}
104105
}
105106

106-
task copyToParent(type: Copy) {
107+
tasks.register('copyToParent', Copy) {
107108
into "$buildDir/libs"
108109
subprojects {
109110
from tasks.withType(Jar)

framework/build.gradle

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -23,15 +23,15 @@ configurations {
2323

2424
}
2525

26-
configurations.getByName('checkstyleConfig') {
26+
configurations.named('checkstyleConfig') {
2727
transitive = false
2828
}
2929

3030
static def isWindows() {
3131
return org.gradle.internal.os.OperatingSystem.current().isWindows()
3232
}
3333

34-
task version(type: Exec) {
34+
tasks.register('version', Exec) {
3535
commandLine 'bash', '-c', '../ver.sh'
3636
}
3737

@@ -88,7 +88,7 @@ checkstyleMain {
8888
source = 'src/main/java'
8989
}
9090

91-
task lint(type: Checkstyle) {
91+
tasks.register('lint', Checkstyle) {
9292
// Cleaning the old log because of the creation of the new ones (not sure if totaly needed)
9393
delete fileTree(dir: "${project.rootDir}/app/build/reports")
9494
source 'src'
@@ -101,7 +101,7 @@ task lint(type: Checkstyle) {
101101
ignoreFailures = false
102102
}
103103

104-
tasks.matching { it instanceof Test }.all {
104+
tasks.matching { it instanceof Test }.configureEach {
105105
testLogging.events = ["failed", "passed", "skipped"]
106106
}
107107

@@ -218,7 +218,7 @@ startShadowScripts {
218218
enabled = false
219219
}
220220

221-
task copyToParent(type: Copy) {
221+
tasks.register('copyToParent', Copy) {
222222
into "../build/distributions"
223223
from "$buildDir/distributions"
224224
include "*.zip"

plugins/build.gradle

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ configurations {
1717
checkstyleConfig
1818
}
1919

20-
configurations.getByName('checkstyleConfig') {
20+
configurations.named('checkstyleConfig') {
2121
transitive = false
2222
}
2323

@@ -46,7 +46,7 @@ checkstyleMain {
4646
source = 'src/main/java'
4747
}
4848

49-
task lint(type: Checkstyle) {
49+
tasks.register('lint', Checkstyle) {
5050
// Cleaning the old log because of the creation of the new ones (not sure if totaly needed)
5151
delete fileTree(dir: "${project.rootDir}/app/build/reports")
5252
source 'src'
@@ -59,7 +59,7 @@ task lint(type: Checkstyle) {
5959
ignoreFailures = false
6060
}
6161

62-
tasks.matching { it instanceof Test }.all {
62+
tasks.matching { it instanceof Test }.configureEach {
6363
testLogging.events = ["failed", "passed", "skipped"]
6464
}
6565

@@ -131,7 +131,7 @@ startShadowScripts {
131131
enabled = false
132132
}
133133

134-
task copyToParent(type: Copy) {
134+
tasks.register('copyToParent', Copy) {
135135
into "../build/distributions"
136136
from "$buildDir/distributions"
137137
include "*.zip"

protocol/build.gradle

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ dependencies {
2020
api group: 'com.google.api.grpc', name: 'proto-google-common-protos', version: '2.15.0'
2121
}
2222

23-
tasks.matching { it instanceof Test }.all {
23+
tasks.matching { it instanceof Test }.configureEach {
2424
testLogging.events = ["failed", "passed", "skipped"]
2525
}
2626

0 commit comments

Comments
 (0)