File tree Expand file tree Collapse file tree 3 files changed +36
-1
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 +36
-1
lines changed Original file line number Diff line number Diff line change 8
8
- Fix missing space in ` ApacheNoticeResourceTransformer ` preamble causing malformed NOTICE header. ([ #1623 ] ( https://github.com/GradleUp/shadow/pull/1623 ) ).
9
9
- Fix using ` ApacheNoticeResourceTransformer ` without ` projectName ` . ([ #1627 ] ( https://github.com/GradleUp/shadow/pull/1627 ) ).
10
10
- Fix extra indents of ` ApacheNoticeResourceTransformer ` output. ([ #1628 ] ( https://github.com/GradleUp/shadow/pull/1628 ) ).
11
+ - Fix resolving BOM dependencies when ` minimize ` is enabled. ([ #1637 ] ( https://github.com/GradleUp/shadow/pull/1637 ) ).
11
12
12
13
## [ 9.0.1] ( https://github.com/GradleUp/shadow/releases/tag/9.0.1 ) - 2025-08-09
13
14
Original file line number Diff line number Diff line change @@ -279,6 +279,36 @@ class MinimizeTest : BasePluginTest() {
279
279
}
280
280
}
281
281
282
+ @Issue(
283
+ " https://github.com/GradleUp/shadow/issues/1636" ,
284
+ )
285
+ @Test
286
+ fun minimizeBomDependency () {
287
+ writeApiLibAndImplModules()
288
+ path(" impl/build.gradle" ).appendText(
289
+ """
290
+ dependencies {
291
+ api platform('org.jetbrains.kotlin:kotlin-bom:2.2.0')
292
+ }
293
+ """ .trimIndent(),
294
+ )
295
+
296
+ run (" :impl:$SHADOW_JAR_TASK_NAME " )
297
+
298
+ assertThat(jarPath(" impl/build/libs/impl-all.jar" )).useAll {
299
+ containsAtLeast(
300
+ " api/" ,
301
+ " lib/" ,
302
+ " impl/" ,
303
+ " impl/SimpleEntity.class" ,
304
+ " api/Entity.class" ,
305
+ " api/UnusedEntity.class" ,
306
+ " lib/LibEntity.class" ,
307
+ * manifestEntries,
308
+ )
309
+ }
310
+ }
311
+
282
312
private fun writeApiLibAndImplModules () {
283
313
settingsScript.appendText(
284
314
"""
Original file line number Diff line number Diff line change @@ -4,6 +4,7 @@ import java.io.File
4
4
import org.gradle.api.Project
5
5
import org.gradle.api.artifacts.Configuration
6
6
import org.gradle.api.artifacts.Dependency
7
+ import org.gradle.api.artifacts.ExternalModuleDependency
7
8
import org.gradle.api.artifacts.FileCollectionDependency
8
9
import org.gradle.api.artifacts.ProjectDependency
9
10
import org.gradle.api.file.FileCollection
@@ -54,9 +55,12 @@ internal class UnusedTracker(
54
55
is FileCollectionDependency -> {
55
56
apiJars.addAll(dep.files)
56
57
}
58
+ // Skip BOM dependencies and other non-JAR dependencies.
59
+ is ExternalModuleDependency -> Unit
57
60
else -> {
58
61
addJar(runtimeConfiguration, dep, apiJars)
59
- apiJars.add(runtimeConfiguration.find { it.name.startsWith(" ${dep.name} -" ) } as File )
62
+ val jarFile = runtimeConfiguration.find { it.name.startsWith(" ${dep.name} -" ) } ? : return @forEach
63
+ apiJars.add(jarFile)
60
64
}
61
65
}
62
66
}
You can’t perform that action at this time.
0 commit comments