doclava can't link with *.aar ?

33 views
Skip to first unread message

Evan Brunner

unread,
Jun 2, 2014, 2:59:31 PM6/2/14
to gradle-androi...@googlegroups.com
Am I doing something incorrectly, or is it just that *.aar archives can't be added to the javadoc classpath and expected to work correctly (currently I get error: package [com.thirdparty.tool] does not exist)  If I build a jar, and sort of side-load that - everything works fine.

basically I'm just doing a:

options{ 
  classpath = files(project.configurations.compile)
  ...
}

it properly picks up all the third-party libs that are added as jars, but not aar libs.

All the paths (for both jars and aars) correctly show up in ./build/tmp/[task_name]/javadoc.opitions

Evan Brunner

unread,
Jun 2, 2014, 7:23:02 PM6/2/14
to gradle-androi...@googlegroups.com
It took me eons to figure this out, but you can include the class.jars from build/exploded-aar easily enough.

ext.aarJars = fileTree(dir: "$project.buildDir/exploded-aar", include: "**/classes.jar")

classpath = (files(project.configurations.compile) + files(ext.aarJars) ...)

Evan Brunner

unread,
Jun 3, 2014, 11:45:11 PM6/3/14
to gradle-androi...@googlegroups.com
So not to keep beating a dead bush, but the aforementioned solution doesn't actually work.

If the project is cleaned, and then the gradle script objects are compiled some time later: (ie gradle clean, gradle generateDebugJavadoc as opposed to gradle clean generateReleaseJavadoc)  they'll never find the intended classes.jar files (because they don't exist in the project yet).

What I ended up doing was creating a different configurations container for aar files, and extending compile from it.  This allowed me simply to have a set of exclusively aar dependencies, which I could then strip the groupId, artifactId, and the version from to manufacture the expected path to the classes.jar in buildDir/exploded-aar/.

This is not ideal, but it works.

I'd be glad to hear if anyone had any better idea.
Reply all
Reply to author
Forward
0 new messages