문제

I generate a javadoc .jar file with Gradle for my Android project. I'm using a similar setup like in this instruction.

But I'm getting a lot of warnings that many symbols are missing. I noticed that the javadoc task doesn't find any of my dependencies. How can I add my dependencies to javadoc task's classpath?

Here is my upload task:

afterEvaluate { project ->
    uploadArchives {

    //...

    }

    //...

    task androidJavadocs(type: Javadoc) {
        source = android.sourceSets.main.allJava
    }

    task androidJavadocsJar(type: Jar, dependsOn: androidJavadocs) {
        classifier = 'javadoc'
        from androidJavadocs.destinationDir
    }

    //...

    artifacts {
        archives androidSourcesJar
        archives androidJavadocsJar
    }
}

There is also filed bug, but I'd like to have a solution now.

도움이 되었습니까?

해결책

roman-mazur answered the question in another issue at Github.

There is currently a discussion going on, whether it's the right way. But for the moment adding these lines solved my issue:

afterEvaluate {
    javadocs.classpath += files(android.plugin.runtimeJarList)
}
라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top