Android: Attaching Sources to Libraries in Eclipse
Since ADT r17, Android projects in Eclipse have had a nice property: all jars in your libs directory have been automatically picked up by Eclipse projects under a magic “Android Dependencies” entry in the build path. Ant builds use the same conventions, so adding a library is as simple as dropping it into the right directory. Unfortunately, though, this magic came with a major limitation: there was no way to attach sources to these libraries (see issue 27940). This led me to duplicate build path entries manually just to get source attachments.
Good news: in the just-released r20 version of ADT, Google have provided a solution to this problem. It’s not well advertised, but if you check out comment 21 on the aforementioned issue, you see that by creating a properties file for each library, you can tell ADT where to find the sources. So, for example, if you have a jar named:
you can create a properties file alongside it named:
Within the properties file you can add a src property set to the relative (or absolute, but that’s version-control-unfriendly) path of the source jar, zip or directory. Say, like me, you put it in the libs/src subdirectory, your properties file might look like:
Once you’ve added the properties file, refresh the project in Eclipse and voilà: the sources will be attached! A similar property named doc is supported for javadoc attachments.
Although this new feature is very welcome, I feel like it could use a bit more fine tuning. The main issue is the need to create a separate properties file for each jar. I keep my source jars in predictable locations, with conventional names, so I should be able to configure the convention once and have everything Just Work from then on. Heck, I’m not sure why there isn’t a default convention, which I could just follow with no further configuration!
===============================================
注:
上文所说的路径有错,properties文件必须放在libs目录下才能生效,而不能放在libs/src目录下
相关推荐
6 Volumes: attaching disk storage to containers 7 ConfigMaps & Secrets: configuring applications 8 Accessing Pod metadata and other resources from applications 9 Deployments: updating applications ...
mptsas: ioc0: attaching raid volume, channel 1, id 0 device-mapper: dm-raid45: initialized v0.2594l md: Autodetecting RAID arrays. 很明显是有的,只是无法确定RAID卡的类型是ioc0还是dm-raid45,于是开始...
xmlns:android="http://schemas.android.com/apk/res/android" android:id="@+id/toolbar" android:layout_width="match_parent" android:layout_height="?attr/actionBarSize" android:background="?attr/...
An Android Toast replacement, similar to the one seen in the GMail app. Multiple messages can be posted in succession, and each message will be shown for 5 seconds. Usage There's two ways to use the ...
7)....Fixed: Attaching .PAS files instead of .OBJ in C++ Builder 2006+ Pro/Trial EurekaLog 7.2 Hotfix 1 (7.2.1.0), 3-April-2015 1)....Fixed: Wrong float-str convertion when ThousandSeparator is '.' ...
rem Un-rem next line to enable debugger attaching to this instance of Tomcat set JAVA_OPTS=%JAVA_OPTS% -Xnoagent -Xdebug -Xrunjdwp:transport=dt_socket,address=8002,server=y,suspend=n ``` 这段代码会...
4. 安装反编译插件:Eclipse没有内置反编译功能,所以需要安装第三方插件,如JD-Eclipse或Decompiler Plug-In。你可以通过Eclipse Marketplace搜索并安装这些插件。如果无法访问Marketplace,也可以手动下载插件的...
DLL: Re-attaching to existing debug session after connecting and disconnecting once via TELNET (e.g. used by RTTClient and RTTViewer) did not work properly. Fixed. DLL: Renesas R5F51306 (RX130) ...
易字节编码器 介绍 Easy-byte-coder是基于JVM的非侵入性字节码注入框架。 Java应用程序开发人员可以快速实现字节码注入,而无需关心底层的仪器原理和实现... Attaching to target JVM with PID: 91420 Attached to tar
- **Attaching an External Partitioned Table to an HDFS Directory Structure**: Guide on creating external tables and linking them to directories in HDFS. - **Switching Back and Forth Between Impala and...
In the framework of model-based software development, applica- tion functions are checked in an iterative process....instruments the model by attaching scope blocks to each of the desired signals.
Be aware, Android Studio can interfere with jadx debugger, so it is better to close it before attaching to the process in jadx. Smali debugger, check wiki page for setup and usage. View decompiled ...
Be aware, Android Studio can interfere with jadx debugger, so it is better to close it before attaching to the process in jadx. Smali debugger, check wiki page for setup and usage. View decompiled ...
This classic book hones in on the most exciting features of each release of iOS, providing you with introductory guidelines to the tools in iOS and Xcode that will distinguish your app and cause users...
- **Writing Code:** Attaching code to events, such as a button click, to perform actions. #### C. Instructions, Procedures: Subs, Functions ##### 1. Instructions Instructions are single commands in ...
Filters play a vital role in optimizing the profiling process by allowing users to focus on specific parts of the code. Topics covered include: - Defining filters based on class names, package names, ...