Indexing android 'froyo' javadoc in kiwidoc
I just indexed android 'froyo' javadoc in kiwidoc and it was quite a challenge.
1. Downloading the source code
You have to go to http://source.android.com/ to find instructions on how to get it. This part is actually quite challenging because there are lots of steps to simply 'get it'. I understand why it is being done this way: you end up with a ready to develop/contribute environment. On the other end, if you simply want to look at the source code it is quite complex and potentially time consuming.2. Downloading the 'correct' version of the source code
I know it is written in the manual but it is not very intuitive to download the correct version. Under the cover, it usesgit
but it is wrapped by a high level command called repo
. When you use plain git
in a project, you simply clone the project and then you can switch to a branch. When you use the repo
command, you end up with an error message if you try to follow the git
paradigm.
> repo branches (no branches) > repo checkout froyo error: no project has branch froyoIt is very important to 'clone' with the correct version originally:
repo init -u git://android.git.kernel.org/platform/manifest.git -b froyoI am sure there are very good reasons to do it this way, but it would certainly be easier if the command were to behave like
git
.
3. Compiling android
I use a Mac OS X machine (Snow Leopard) and bumped into a lot of issues:- Snow Leopard is not supported
- It requires a case-sensitive file system (which is not the default on Mac OS X)
- It requires Java 1.5 (which is eol now...)
4. Make
For my own purpose I actually only needed the javadoc and the java source code. After running a full build (I just issued themake
command) which took several hours to run (no kidding), there was no javadoc. Not being very familiar with make
, it took me a while to figure out that you can run the command:
make -p > android-make.dbwhich "Print make's internal database". In this case it generated a 156MB file! Sifting through this file, I was able to identify the command I needed:
make offline-sdk-docswhich generated the javadoc.
5. kiwidoc generation
By slightly tweaking the javadoc command in the make file, I was able to generate the information I needed for kiwidoc: mainly all the source files to take into account as well as the classpath. Once I had this information, actually indexing it tooks 20s.6. Android versions
I think that the android version naming, although I understand why it is being done this way, is quite confusing:- Platform version (2.2 is the 'current' latest one)
- API Level (8 is the 'current' latest one)
- Code Name (froyo is the 'current' latest one)
7. Conclusion
It took me a really long time to index froyo (api level 8) but I succeeded which is very satisfying. I also 'promoted' the android platform all the way to the home page.
Jul 10 2010 - Posted by Yan in