Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Add local javadoc to local aar in Android-Studio

Is there a way to attach javadocs, provided in a jar, to a aar library? There is no source code available and both files exist locally (not in a repository).

The aar is added through:

repositories {
    flatDir {
        dirs 'libs'
    }
}

dependencies {
    compile(name:'library', ext:'aar')
}

And works fine (besides the inability to add docs).

What I tried (and did not work):

  • navigate to a class contained in the aar and tried to attech the javadocs through "attach source"
  • add library.aar.properties containing doc=docs/library-javadoc.jar
  • packed javadoc.jar into library.aar next to the classes.jar

Environment:
Android-Studio 0.8.2
gradle plugin 0.12

It might not be possible ATM (see this bug: https://code.google.com/p/android/issues/detail?id=73087) but any workaround would be appreciated.

like image 636
Zarokka Avatar asked Jul 22 '14 08:07

Zarokka


1 Answers

It is possible now to attach locale javadocs to an aar in Android-Studio, there are still problems though.

This works with Android-Studio 1.3.2 and Android-Gradle-Plugin 1.3 and Gradle 2.5.

In the Project view -> select "Project" viewing style -> Expand "External Libraries" and right click on the desired library -> select "Library Properties..."

Image that shows how to find the "Library Properties"

(The image just shows where to find the "Library Properties", i know that this is not necessary for appcompat)

In the upcoming dialog click the + Symbol and point to the location where the unpacked javadocs are stored.

Caveat:
The settings does currently not survive a gradle project sync.

Reference:
https://code.google.com/p/android/issues/detail?id=73087

like image 127
Zarokka Avatar answered Nov 03 '22 04:11

Zarokka