Skip to content

Commit 2339155

Browse files
committed
Seems we don't need an explicit ConfigurationCacheTest anymore
1 parent fb221e3 commit 2339155

File tree

2 files changed

+36
-140
lines changed

2 files changed

+36
-140
lines changed

src/funcTest/kotlin/com/github/jengelman/gradle/plugins/shadow/ConfigurationCacheTest.kt

Lines changed: 0 additions & 140 deletions
This file was deleted.

src/funcTest/kotlin/com/github/jengelman/gradle/plugins/shadow/ShadowPluginTest.kt

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -773,6 +773,42 @@ class ShadowPluginTest : BasePluginTest() {
773773
assertThat(testJar.getEntry("junit")).isNotNull()
774774
}
775775

776+
@Test
777+
fun configurationCachingOfConfigurationsIsUpToDate() {
778+
settingsScriptPath.appendText(
779+
"""
780+
include 'lib'
781+
""".trimIndent(),
782+
)
783+
projectScriptPath.writeText("")
784+
785+
path("lib/src/main/java/lib/Lib.java").writeText(
786+
"""
787+
package lib;
788+
public class Lib {}
789+
""".trimIndent(),
790+
)
791+
path("lib/build.gradle").writeText(
792+
"""
793+
${getDefaultProjectBuildScript()}
794+
dependencies {
795+
implementation 'junit:junit:3.8.2'
796+
}
797+
$shadowJar {
798+
configurations = [project.configurations.compileClasspath]
799+
}
800+
""".trimIndent(),
801+
)
802+
803+
val libShadowJarTask = ":lib:$SHADOW_JAR_TASK_NAME"
804+
run(libShadowJarTask)
805+
val result = run(libShadowJarTask)
806+
807+
assertThat(result.task(libShadowJarTask)).isNotNull()
808+
.transform { it.outcome }.isEqualTo(TaskOutcome.UP_TO_DATE)
809+
assertThat(result.output).contains("Reusing configuration cache.")
810+
}
811+
776812
private fun writeShadowedClientAndServerModules() {
777813
writeClientAndServerModules()
778814
path("client/build.gradle").appendText(

0 commit comments

Comments
 (0)