Skip to content

Commit f82f452

Browse files
committed
Move runtime classpath normalization outside of java compile configuration
1 parent c5d652b commit f82f452

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

src/main/groovy/org/gradle/android/workarounds/JdkImageWorkaround.groovy

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,13 +44,18 @@ class JdkImageWorkaround implements Workaround {
4444

4545
@Override
4646
void apply(Project project) {
47+
// We would prefer not to configure this if a jdkImage is not in use, but the attributes
48+
// being ignored are unlikely to ever have a runtime impact. Doing this outside of task
49+
// configuration prevents issues with things that use the tooling api to finalize the
50+
// runtime configuration before querying (and instantiating) task configurations.
51+
applyRuntimeClasspathNormalization(project)
52+
4753
applyToAllAndroidVariants(project) { variant ->
4854
variant.javaCompileProvider.configure { JavaCompile task ->
4955
def jdkImageInput = getJdkImageInput(task)
5056
if (jdkImageInput != null) {
5157
setupExtractedJdkImageInputTransform(project, getJvmHome(task))
5258
replaceCommandLineProvider(task, jdkImageInput)
53-
applyRuntimeClasspathNormalization(task.project)
5459
}
5560
}
5661
}

0 commit comments

Comments
 (0)