File tree Expand file tree Collapse file tree 3 files changed +38
-2
lines changed
functionalTest/kotlin/com/github/jengelman/gradle/plugins/shadow
main/kotlin/com/github/jengelman/gradle/plugins/shadow/internal Expand file tree Collapse file tree 3 files changed +38
-2
lines changed Original file line number Diff line number Diff line change 1414### Fixed
1515
1616- Fix the regression of can't shadow directory inputs. ([ #1606 ] ( https://github.com/GradleUp/shadow/pull/1606 ) )
17+ - Fix the regression of ` MinimizeDependencyFilter ` . ([ #1611 ] ( https://github.com/GradleUp/shadow/pull/1611 ) )
1718
1819## [ 9.0.0] ( https://github.com/GradleUp/shadow/compare/9.0.0 ) - 2025-08-07
1920
Original file line number Diff line number Diff line change @@ -2,6 +2,7 @@ package com.github.jengelman.gradle.plugins.shadow
22
33import assertk.assertThat
44import com.github.jengelman.gradle.plugins.shadow.tasks.ShadowJar.Companion.SHADOW_JAR_TASK_NAME
5+ import com.github.jengelman.gradle.plugins.shadow.util.Issue
56import com.github.jengelman.gradle.plugins.shadow.util.containsAtLeast
67import com.github.jengelman.gradle.plugins.shadow.util.containsNone
78import com.github.jengelman.gradle.plugins.shadow.util.containsOnly
@@ -213,6 +214,38 @@ class MinimizeTest : BasePluginTest() {
213214 }
214215 }
215216
217+ @Issue(
218+ " https://github.com/GradleUp/shadow/issues/1610" ,
219+ )
220+ @Test
221+ fun excludeCircularDependencies () {
222+ publishArtifactCD(circular = true )
223+
224+ val dependency = " 'my:d:1.0'"
225+ projectScript.appendText(
226+ """
227+ dependencies {
228+ implementation $dependency
229+ }
230+ $shadowJarTask {
231+ minimize {
232+ exclude(dependency($dependency ))
233+ }
234+ }
235+ """ .trimIndent(),
236+ )
237+
238+ run (shadowJarPath)
239+
240+ assertThat(outputShadowedJar).useAll {
241+ containsOnly(
242+ " c.properties" ,
243+ " d.properties" ,
244+ * manifestEntries,
245+ )
246+ }
247+ }
248+
216249 @ParameterizedTest
217250 @ValueSource(booleans = [false , true ])
218251 fun enableMinimizationByCliOption (enable : Boolean ) {
Original file line number Diff line number Diff line change @@ -13,12 +13,14 @@ internal class MinimizeDependencyFilter(
1313 excludedDependencies : MutableSet <ResolvedDependency >,
1414 ) {
1515 dependencies.forEach {
16- if (it.isIncluded() && ! isParentExcluded(excludedDependencies, it)) {
16+ val added = if (it.isIncluded() && ! isParentExcluded(excludedDependencies, it)) {
1717 includedDependencies.add(it)
1818 } else {
1919 excludedDependencies.add(it)
2020 }
21- resolve(it.children, includedDependencies, excludedDependencies)
21+ if (added) {
22+ resolve(it.children, includedDependencies, excludedDependencies)
23+ }
2224 }
2325 }
2426
You can’t perform that action at this time.
0 commit comments