Skip to content

Commit

Permalink
Filter bogus AndroidX Media jar file when creating javadoc
Browse files Browse the repository at this point in the history
#minor-release

PiperOrigin-RevId: 452282128
  • Loading branch information
marcbaechinger committed Jun 7, 2022
1 parent 97210b5 commit 2441bc6
Showing 1 changed file with 13 additions and 1 deletion.
14 changes: 13 additions & 1 deletion javadoc_combined.gradle
Expand Up @@ -48,9 +48,21 @@ class CombinedJavadocPlugin implements Plugin<Project> {
libraryModule.android.libraryVariants.all { variant ->
def name = variant.buildType.name
if (name == "release") {
// Works around b/234569640 that causes different versions of the androidx.media
// jar to be on the classpath.
def allJarFiles = []
allJarFiles.addAll(variant.javaCompileProvider.get().classpath.files)
def filteredJarFiles = allJarFiles.findAll { file ->
if (file ==~ /.*media-.\..\..-api.jar$/
&& !file.path.endsWith(
"media-" + project.ext.androidxMediaVersion + "-api.jar")) {
return false;
}
return true;
}
classpath +=
libraryModule.project.files(
variant.javaCompileProvider.get().classpath.files,
filteredJarFiles,
libraryModule.project.android.getBootClasspath())
}
}
Expand Down

0 comments on commit 2441bc6

Please sign in to comment.