File tree Expand file tree Collapse file tree 1 file changed +5
-3
lines changed
Expand file tree Collapse file tree 1 file changed +5
-3
lines changed Original file line number Diff line number Diff line change @@ -99,7 +99,7 @@ compileOnlyDependencies.extendsFrom(configurations.getByName("compileOnly"))
9999
100100dependencies {
101101 add(shadowedDependencies.name, " com.squareup.okhttp3:okhttp:4.9.0" )
102- add(compileOnlyDependencies.name , gradleApi())
102+ add(" compileOnly " , gradleApi())
103103 // More dependencies here
104104}
105105
@@ -109,6 +109,9 @@ if (shadow) {
109109 val shadowedJar = create(" default" ) {
110110 addProgramJarsFrom(shadowedDependencies)
111111 addProgramJarsFrom(tasks.getByName(" jar" ))
112+ // classpath jars are only used by R8 for analysis but are not included in the
113+ // final shadowed jar.
114+ addClassPathJarsFrom(compileOnlyDependencies)
112115
113116 proguardFile(" rules.pro" )
114117 registerFilterTransform(listOf (" .*/impldep/META-INF/versions/.*" ))
@@ -125,12 +128,11 @@ if (shadow) {
125128
126129 // Allow to compile the module without exposing the shadowedDependencies downstream
127130 configurations.getByName(" compileOnly" ).extendsFrom(shadowedDependencies)
128- configurations.getByName(" compileOnly" ).extendsFrom(compileOnlyDependencies)
129131 configurations.getByName(" testImplementation" ).extendsFrom(shadowedDependencies)
130132 }
131133 }
132134} else {
133- configurations.named (" implementation" ).extendsFrom(shadowedDependencies)
135+ configurations.getByName (" implementation" ).extendsFrom(shadowedDependencies)
134136}
135137```
136138
You can’t perform that action at this time.
0 commit comments