Skip to content

Commit e1e657c

Browse files
author
Alexander Furer
committed
simplify gradle build config
1 parent b13a9f8 commit e1e657c

File tree

2 files changed

+8
-25
lines changed

2 files changed

+8
-25
lines changed

.github/workflows/gradle.yml

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,4 @@ jobs:
2525
- name: Grant execute permission for gradlew
2626
run: chmod +x gradlew
2727
- name: Build with Gradle
28-
run: ./gradlew build
29-
- name: Print docker images
30-
run: docker images
28+
run: ./gradlew build ; docker images

grpc-spring-boot-starter-demo/build.gradle

Lines changed: 7 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@ facets {
2424
bothPureAndShadedNettyTest
2525
noConsulDependenciesTest
2626
}
27+
2728
grpcSpringBoot {
2829
grpcSpringBootStarterVersion.set((String)null)
2930
}
@@ -53,26 +54,15 @@ configurations.findAll{ cfg ->
5354
}
5455

5556

56-
configurations {
57-
pureNettyTestCompile.extendsFrom( testCompile)
58-
pureNettyTestRuntime.extendsFrom(testRuntime)
59-
60-
customSecurityTestCompile.extendsFrom( testCompile)
61-
customSecurityTestRuntime.extendsFrom(testRuntime)
62-
63-
bothPureAndShadedNettyTestCompile.extendsFrom( testCompile)
64-
bothPureAndShadedNettyTestRuntime.extendsFrom( testRuntime)
65-
66-
kafkaStreamTestCompile.extendsFrom( testCompile)
67-
kafkaStreamTestRuntime.extendsFrom(testRuntime)
68-
69-
noConsulDependenciesTestCompile.extendsFrom( testCompile)
70-
noConsulDependenciesTestRuntime.extendsFrom(testRuntime)
71-
57+
extensions.facets.each{
58+
if(it.name.endsWith("Test")) {
59+
configurations.getByName("${it.name}Compile").extendsFrom(configurations.testCompile)
60+
configurations.getByName("${it.name}Runtime").extendsFrom(configurations.testRuntime)
7261

62+
dependencies.add("${it.name}Compile", sourceSets.test.output)
63+
}
7364
}
7465

75-
7666
dependencies {
7767

7868
implementation "org.springframework.boot:spring-boot-starter-actuator"
@@ -104,21 +94,16 @@ dependencies {
10494
testImplementation 'org.hamcrest:hamcrest:2.2'
10595
testImplementation 'org.mockito:mockito-core:2.23.0'
10696

107-
customSecurityTestCompile sourceSets.test.output
10897

109-
pureNettyTestCompile sourceSets.test.output
11098
pureNettyTestCompile "io.grpc:grpc-netty"
11199

112100

113-
bothPureAndShadedNettyTestCompile sourceSets.test.output
114101
bothPureAndShadedNettyTestCompile "io.grpc:grpc-netty"
115102

116-
kafkaStreamTestCompile sourceSets.test.output
117103
kafkaStreamTestCompile "com.playtika.testcontainers:embedded-kafka:2.0.9"
118104
kafkaStreamTestCompile "org.springframework.cloud:spring-cloud-starter-stream-kafka"
119105

120106

121-
noConsulDependenciesTestCompile sourceSets.test.output
122107
//testCompile "org.testcontainers:junit-jupiter:1.14.3"
123108

124109

0 commit comments

Comments
 (0)