Classes.jar and classes-header.jar with same module name

305 views
Skip to first unread message

Pranitha Reddy

unread,
Apr 14, 2020, 11:10:52 AM4/14/20
to android-...@googlegroups.com, REGURI AKANKSHA
Hello
Say there is module 'X' writtern twice in Android.mk

include $(CLEAR_VARS)
LOCAL_MODULE               := X
LOCAL_MODULE_CLASS         := JAVA_LIBRARIES
LOCAL_SRC_FILES            := same_path/classes-header.jar



include $(CLEAR_VARS)
LOCAL_MODULE               := X
LOCAL_MODULE_CLASS         := JAVA_LIBRARIES
LOCAL_SRC_FILES            := same_path/classes.jar

Is there any way to install X such that both classes.jar and classes-header.jar will be in out folder?
At present with above Android.mk, the rule that is writtern first is being compiled and the rest is being ingnored and so Im seeing only classes-header.jar in out folder

Thanks in advance

Dan Willemsen

unread,
Apr 14, 2020, 7:20:01 PM4/14/20
to Android Building, REGURI AKANKSHA
That generally should be an error, as we normally require modules to be unique based on the combination of LOCAL_MODULE / LOCAL_IS_HOST_MODULE / LOCAL_MODULE_CLASS (this is in build/make/core/base_rules.mk)


If that isn't triggering, you may be making two rules to create the same /system/frameworks/X.jar, and you should be getting a warning like this:

build/make/core/....mk:LLL: warning: overriding commands for target `out/target/product/mydevice/system/frameworks/X.jar'
build/make/core/...mk:LLL: warning: ignoring old commands for target `out/target/product/mydevice/system/frameworks/X.jar'

That should be an error by default unless you've got BUILD_BROKEN_DUP_RULES set (at least as of Android-Q iirc). That means you're getting one of the two, or sometimes a mix, but we don't really even guarantee which one you'll get (it's fairly stable, but can change based on ordering/etc).


What did you intend for the snippet to do? How would we install both classes.jar and classes-header.jar onto the device? Same filenames? Different filenames? Why do they share the same module name?

- Dan

--
--
You received this message because you are subscribed to the "Android Building" mailing list.
To post to this group, send email to android-...@googlegroups.com
To unsubscribe from this group, send email to
android-buildi...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-building?hl=en

---
You received this message because you are subscribed to the Google Groups "Android Building" group.
To unsubscribe from this group and stop receiving emails from it, send an email to android-buildi...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/android-building/CAH4VoYmaY%3DokDbzrBCa%2BGt9ysJNLasKMeK2NKVTH2Lq95QjE3w%40mail.gmail.com.

Pranitha Reddy

unread,
Apr 15, 2020, 10:23:21 AM4/15/20
to android-...@googlegroups.com
Yes they share the same module name,  but different srcs, one source is classes.jar and other is classes-header.jar, however we r not facing module duplication here, Is there any possible way to install the module such both classes.jar and classes-header.jar are compiled. The present scenario one override other.
 
Note that one rule is to make classes.jar and other rule is to make classes-header.jar
Thank you:)

Reply all
Reply to author
Forward
0 new messages