On Fri, Mar 23, 2012 at 10:33 AM, Nikolay Elenkov <nikolay.elen...@gmail.com
> wrote:

> Library projects now (since ADT15?) produce a jar. Linked source
> folders are now longer used, so there is no code merging.
>

Thanks Nikolay for confirming that.


>  Don't refer to A.java directly. Put an abstract class or interface
> in the library project, different implementations in the app projects,
> etc.
>

That is a good solution when there are few well separated classes. In my
case there are many intricate dependencies which makes this cumbersome.

I found a workaround. I moved the contents of the *src* folder in the
Library project into a new folder called *libsrc* (some name different from
src). I then link this folder into my dependent projects (Project ->
Properties -> Java Build Path -> Source -> Link Source).

So, Eclipse does the code merging now, instead of the Android SDK. Works
like a charm and I didn't have to make any changes to the source code!

Another benefit is that when I try to navigate to a class (with say
Ctrl+T), I don't see duplicate classes from the Library project. Ditto for
duplicate errors, search results, etc.

The only hitch is I haven't figured out the Ant equivalent of this. (I may
not need it anyway since the new SDK+ADT has good Proguard support).

cheers,
-- 
Harshad RJ
http://lavadip.com

-- 
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en

Reply via email to