@@ -3,6 +3,8 @@ package org.gradlex.jvm.dependency.conflict.test
3
3
import org.gradlex.jvm.dependency.conflict.test.fixture.GradleBuild
4
4
import spock.lang.Specification
5
5
6
+ import static org.gradlex.jvm.dependency.conflict.test.fixture.GradleBuild.GRADLE6_TEST
7
+
6
8
class CapabilityWithDifferentVersionsTest extends Specification {
7
9
8
10
@Delegate
@@ -37,8 +39,44 @@ class CapabilityWithDifferentVersionsTest extends Specification {
37
39
println(configurations.compileClasspath.get().files.joinToString("\\ n") { it.name })
38
40
}
39
41
"""
42
+ if (GRADLE6_TEST ) { configureEnvAttribute() }
40
43
41
44
expect :
42
45
printJars()
43
46
}
47
+
48
+ def " does not fail with empty listenable future dependency on the classpath" () {
49
+ given :
50
+ buildFile << """
51
+ plugins {
52
+ id("org.gradlex.jvm-dependency-conflict-resolution")
53
+ id("java-library")
54
+ }
55
+ tasks.withType<JavaCompile>().configureEach {
56
+ options.release.set(17)
57
+ }
58
+ repositories.mavenCentral()
59
+ dependencies {
60
+ implementation(platform("com.google.cloud:spring-cloud-gcp-dependencies:5.2.0"))
61
+ implementation("com.google.cloud:spring-cloud-gcp-starter-bigquery")
62
+ }
63
+
64
+ tasks.register("printJars") {
65
+ println(configurations.compileClasspath.get().files.joinToString("\\ n") { it.name })
66
+ }
67
+ """
68
+ if (GRADLE6_TEST ) { configureEnvAttribute() }
69
+
70
+ expect :
71
+ printJars()
72
+ }
73
+
74
+ void configureEnvAttribute () {
75
+ buildFile << """
76
+ val envAttribute = Attribute.of("org.gradle.jvm.environment", String::class.java)
77
+ configurations.compileClasspath {
78
+ attributes.attribute(envAttribute, "standard-jvm")
79
+ }
80
+ """
81
+ }
44
82
}
0 commit comments