5

I am trying to attach the source for android-support-v4 and have followed the instructions from this question:

How to install javadoc for Android Compatibility Package?

This project is shared on a git repo, so I don't want to checkin a .classpath pointing to a local folder.

What is the best way to point to this javadoc on a shared project? I am open to having everyone else generate the javadoc, but I need a way to point to each person's Android SDK directory. A solution that can checked into the repository would be better though.

Is there a variable I can use in the file path pointing to the javadoc folder? I am hoping for something like this: file:/$ANDROID_SDK_DIR$/extras/android/compatibility/v4/docs/

EDIT: I found a comment on the bug that pertains to an issue with javadocs and android libraries. I created the properties file and I can now see the javadocs in Eclipse, but I still have the same issue. The file contains an absolute path to my own Android SDK directory.

Community
  • 1
  • 1
Austyn Mahoney
  • 11,398
  • 8
  • 64
  • 85
  • Perhaps Maven can give you a more elegant way for dependency management (*.jar, *-source.jar and *-javadoc.jar), see example [here](http://search.maven.org/#browse%7C-1464220800). The pay is you need mavenize your Android project. – yorkw Jun 14 '12 at 21:55
  • that is indeed an issue that was introduced with ADT 17 and yet not fixed at ADT 19. – Raykud Jun 18 '12 at 22:33
  • If you look at edit, a solution was implemented in ADT 20 Preview 3, but even this solution is not working for me. – Austyn Mahoney Jun 20 '12 at 17:07

2 Answers2

2

I have figured out that in the new versions of ADT, you have to include a .properties file along with your jar in the libs folder. The normal way of changing the .classpath to point to docs/sources does not work in Eclipse with ADT, but this will.

If you have GSON in a file gson-2.2.2.jar create gson-2.2.2.jar.properties in the same folder

gson-2.2.2.jar.properties:

src=docs\\gson-2.2.2-sources.jar
doc=docs\\gson-2.2.2-javadoc.jar

Then create a docs folder inside libs and move your sources and javadoc jars into it.

This solves the issue where anything in /libs is compiled into your project. Only files in the root are included, so creating a folder for your docs (/libs/docs) is a great way to handle this.

Austyn Mahoney
  • 11,398
  • 8
  • 64
  • 85
-1

As seen in this solution, he has a third-party library in a SVN repository and he wants to associate source/javadoc with it locally in Eclipse.

I don't think there is a satisfying solution but you can try.

Check this solution,

hope it helps you.

Community
  • 1
  • 1
rogcg
  • 10,451
  • 20
  • 91
  • 133