Android SDK Compilation--How to add source code to Android.jar and make principle 2

Source: Internet
Author: User
In addition, Javadoc can also specify custom Doclet (Doclet is a small program based on Javadoc-specific API development,


The program is responsible for the actual output of the document. Android's compiler system contains such a doclet called Droiddoc.


You can find all the source code for the tool in the/build/tools/droiddoc directory.


It is the tool that generates HTML at the same time


Under the/out/target/common/obj/java_libraries/android_stubs_current_intermediates


Copy (or regenerate) all the source code (. java files) that will be generated into the Android.jar.
The tool package the source files that generate document to the above directory by the organization.
It is then compiled and packaged into Android.jar.
Based on the above analysis, in fact the Android.jar file is the source file of each published API after Javadoc re


The organization is later compiled again. Therefore, the content of Android.jar is actually controlled by the notation of Javadoc.


and makefile control. For code that already exists in Android, such as WiFi native, you can modify the source generation


Notation method of Javadoc in code to get new Android.jar with WiFi native interface


(Replace the @hide this notation in the source file with something else, and make the Update-api;make SDK). and the


To the newly added code, you need to modify the makefile as above.


The following is a summary of the knowledge involved in the investigation process:
1 Javadoc and Doclet, a simple look at the use of tools and parameters, another look at the Drioddoc this


Doclet source code to find out where the. Java source files are generated.
2.makefile analysis, the Android make Showcommands command can be used with any other target to observe


Look at what was actually done during make. (This also needs to investigate how this showcommands is implemented.)


, because the information given by make-d This command is not helpful for finding a problem.
3. When tracking the makefile build process, use $ (warning xxxxx) and $ (error xxxx) to remove the rule


To print out the value of a variable. This method identifies the actual set of files to be compiled.
Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.