您的位置:首页 > 移动开发 > Android开发

Android ADT20+ 关联 libs/*.jar 源码包的方法

2012-12-04 12:33 537 查看
在libs下新建一个与jar同名的properties文件:

eg. commons-httpclient-3.1.jar,然后建立一个
commons-httpclient-3.1.jar.properties 文件

src:源码包路径

doc:doc包路径

eg.

src:/tools/android-sdk-macosx/commons-httpclient-3.1-src.zip
doc:/tools/android-sdk-macosx/commons-httpclient-3.1-doc.zip




Restart eclipse.

Comment 21 by project member x...@android.com, Apr 23, 2012

The source attachement in fixed for r20.

If you have library projects you should see the source for those automatically.

As for the original issue in this bug:

- if you want to manually reference libraries in your project, you need to make them exported. If the project is a library then project referencing your library will *not* have access to those libraries.

- adding them to libs/ is the way to have dependencies be automatically resolved when you have several libraries, all depending on 3rd party libs (some of which may be the same or may be conflicting with each other).

Source attachement: to work with the new dependency system, we need to put the source attachement outside of the eclipse config.

Next to any jar files in libs/ simply put a .properties file (foo.jar -> foo.jar.properties). This properties file currently support two properties:

src: relative or absolute path to the source folder (or archive).

doc: relative or absolute path to the javadoc.

The properties file is a standard Java properties file, using ISO 8859-1 character encoding.
http://code.google.com/p/android/issues/detail?id=27490#c21
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: