Skip to content

Commit 9eb23e7

Browse files
fkgozalifacebook-github-bot
authored andcommitted
Android OSS: Solve some Javadoc warning due to missing dependencies
Summary: A bunch of deps were missing when generating Javadoc, producing warnings. One issue was: ``` project.getConfigurations().getByName("compile").asList() ``` Seems to be deprecated (?), so this list is always empty. The mitigation is to create a new configuration that just inherits from `api()` dependencies, so that we can add them in Javadoc task. The other problem (not solved in this commit), is that some deps are .aar files, which require some manual unpacking before they can be processed: https://stackoverflow.com/questions/35853906/how-to-generate-javadoc-for-android-library-when-it-has-dependencies-which-are-a Note that this is separate fix from #30417 Changelog: [Internal] Reviewed By: JoshuaGross Differential Revision: D25041164 fbshipit-source-id: 2ee8b268c2d38e3ecbf622c05c3c56123b7a15a6
1 parent b841ee6 commit 9eb23e7

File tree

2 files changed

+5
-1
lines changed

2 files changed

+5
-1
lines changed

ReactAndroid/build.gradle

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -437,6 +437,7 @@ android {
437437
configurations {
438438
extractHeaders
439439
extractJNI
440+
javadocDeps.extendsFrom api
440441
}
441442
}
442443

@@ -457,6 +458,8 @@ dependencies {
457458
extractHeaders("com.facebook.fbjni:fbjni:0.0.2:headers")
458459
extractJNI("com.facebook.fbjni:fbjni:0.0.2")
459460

461+
javadocDeps("com.squareup:javapoet:1.13.0")
462+
460463
testImplementation("junit:junit:${JUNIT_VERSION}")
461464
testImplementation("org.powermock:powermock-api-mockito2:${POWERMOCK_VERSION}")
462465
testImplementation("org.powermock:powermock-module-junit4-rule:${POWERMOCK_VERSION}")

ReactAndroid/release.gradle

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -76,8 +76,9 @@ afterEvaluate { project ->
7676
task androidJavadoc(type: Javadoc, dependsOn: generateReleaseBuildConfig) {
7777
source = android.sourceSets.main.java.srcDirs
7878
classpath += files(android.bootClasspath)
79-
classpath += files(project.getConfigurations().getByName("compile").asList())
8079
classpath += files("$buildDir/generated/source/buildConfig/release")
80+
// Note: this doesn't handle .aar files, only .jar.
81+
classpath += configurations.javadocDeps
8182
include("**/*.java")
8283
}
8384

0 commit comments

Comments
 (0)