History log of /build/core/java_library.mk
Revision Date Author Comments
b9aa5d43de114cecdf94fabb23d3f61f147b627d 13-May-2014 Ying Wang <wangying@google.com> Multilib support for odex

If the VM is libart and DEXPREOPT is enabled,
- For a Java library and the boot image, we build for both 1st arch and
2nd arch.
- For an app, we build for the multilib arch the module is targeted for.
The odex file will be in <arch_name>/<module_name>.odex inside the same
dir where the jar/apk file gets installed.
Nothing changed if it's built for libdvm.

Bug: 14694978
Change-Id: I45118a83758b41d52d6c9e38f93f0ba2775a6c74
ced4bff58e76a16ebce3a35ed24aadc8490ca39b 15-Nov-2013 Brian Carlstrom <bdc@google.com> Add DEXPREOPT support for ART

Change-Id: I24d0d7b2a23a769f5d69bd4dc14be22e1475b759
71fc41df1eea345949e8e838b573ac367a52f9c7 12-Sep-2013 Brian Carlstrom <bdc@google.com> Enable art for user builds

Bug: 10069754
Change-Id: Iaaff33a97bd7b68b2e8d84cd0034b15dde8a4316
576e0146a91f0f092cf67208c864ab9635b42222 28-Aug-2013 Ying Wang <wangying@google.com> Make it a fatal error if no source files for Java module.

Change-Id: Ia04158c11381b6b1687b9d5c699a9ea8ae3cb317
ba71aba939dc58a3278646039337f13d17e65ef2 26-Mar-2013 Ying Wang <wangying@google.com> Allow to run Proguard on static Java library

1. Let aapt output the proguard_options file
2. If proguard is enabled, switch the dependency from
$(full_classes_jar) to $(full_classes_proguard_jar).

Change-Id: Idc641a1515b8899a4623a2aeec5cd494f6c1c1c5
a1fece009f2e93250b2d3bc8ee4a296d100da6dc 12-Mar-2013 Dianne Hackborn <hackbod@google.com> Add LOCAL_APK_LIBRARIES argument.

This allows you to build apks that link against other
apks using the framework's new shared library apk feature.

Also if you are using LOCAL_APK_LIBRARIES, then LOCAL_DEX_PREOPT
will not be allowed. This is because using preopt means the
apk is stripped of its dex file, so the pre-installed apk can't
be redexed if its associated library changes. (Even if the build
system didn't strip the dex, Dalvik still has issues because it
assumes a pre-odex file is always valid.)

Change-Id: I952c0d24f8975f75aff67f78b5faeec91144c3e7
c3ccfeee88c4b62e50c6ad8eb63cc963998c96f9 24-Jan-2013 -b master <morrildl@google.com> Build libcore without a dep on aapt.

Currently building libcore (i.e. to get the core Java libraries) has a
dependency on AAPT. This is problematic for some users that don't want to pull
in the entirety of frameworks/base, e.g. for Dalvik development.

It turns out that all definitions.mk is using aapt for in this case is 'aapt
add -k <jar> <dex>', which adds a file to a JAR while stripping path info.
This is functionally equivalent to 'zip -j', and this CL just makes that
switch.

Change-Id: I292ecaf9d0321018bb7d2e68a49b2cc81de98a20
3e500c63563c9a2ed1ed7b1ae8a094493dbc65d2 10-Aug-2012 Ying Wang <wangying@google.com> Automatically add Java resources carried by static Java libraries.

Bug: 6892294
Change-Id: I3ff71ee3d7b9ccdfde6a5284cc350864fbffa71f

Conflicts:

core/package.mk
af4800c8a6a9266ceb7269bd2c6b0bb2f0965bea 22-Aug-2012 Ying Wang <wangying@google.com> Support EMMA_INSTRUMENT in both full and unbundled builds.

Bug: 6987838
- With this change, use "EMMA_INSTRUMENT=true" to enable emma in full or
unbundled build.
- You don't need to add "LOCAL_STATIC_JAVA_LIBRARIES += emma" any more for
unbundled apps.
- Now a single var LOCAL_EMMA_INSTRUMENT replaces the previous
LOCAL_NO_EMMA_INSTRUMENT and LOCAL_NO_EMMA_COMPILE.
- By default, if EMMA_INSTRUMENT is true, emma is enabled for only
non-test apps.
- A new global var EMMA_INSTRUMENT_STATIC. It enables EMMA_INSTRUMENT
and builds emma into apk/jar as static library, instead of using emma
as part of shared library core.jar.

Change-Id: I0aa219e83074879ececc159b5b07c39eb07ccc00
85480629220c9afb0d138ff1ce5ea1ccbe66c7f7 10-Aug-2012 Ying Wang <wangying@google.com> Automatically add Java resources carried by static Java libraries.

Bug: 6892294
Change-Id: I3ff71ee3d7b9ccdfde6a5284cc350864fbffa71f
5c97da76ad90492a500c63d1cebb8a369795a956 25-Jan-2012 Haruyasu Ishida <haruyasu.ishida@sonyericsson.com> Fix for "dexopt: No such file or directory" error

When common_javalib.jar is created, both LOCAL_BUILT_MODULE and
built_odex targets can be run.

If built_odex target runs before the directory is created by
LOCAL_BUILT_MODULE target, the error occurs.

Change-Id: I1ebcb27630f8373558da6acdfce95f5cdf714bbf
20e2083ea0f8bae57ace17f098e7fe71a9625f84 14-Dec-2011 Ying Wang <wangying@google.com> Support to build static Java library with Android resource

Bug: 5714516

The rationale behind this change:
- the library is compiled into a jar file, but its R class is generated
making the constant not constant (static, not final static) (aapt
option --non-constant-id). Also the jar file does not contain the R
class.
- this allows the integer value to not be inlined in the compiled
class files. Note that this prevents using switch statements.
- the main project use this jar file as a normal static library: it will
add all the class files except the R.class.
- the main project uses the library res folder as a resource
folder with lower priority than the main project (basically the
main project is an overlay. This is accomplished using aapt's
--auto-add-overlay to handle resources only in the main project
(which the normal overlay mechanism doesn't allow).
- the main project creates R classes in the main project's
package but also in the library's package. This is done with
aapt's --extra-packages which accept as many packages as
needed, separated by a :.
- manifest merging is not done yet, so
activities/services/permissions/etc... have to be manually declared in
the main app.

To use a static library with Android resource in your app,
1. Add the library's resource dir to your app as an overlay:
LOCAL_RESOURCE_DIR := <app_resource_dir> <static_library_resource_dirs>
2. Set the proper aapt flags:
LOCAL_AAPT_FLAGS := <apps_own_flags> --auto-add-overlay \
--extra-packages <lib1_package_name>:<lib2_package_name>:...

Change-Id: Ifb4d2300b952ea4aaee74da1bb0c6c72ea0698a3
79e3dec83ee012e94e34ed092cea5b9d60040e9d 24-Oct-2011 Ying Wang <wangying@google.com> new LOCAL_DEX_PREOPT option "nostripping"

Set "LOCAL_DEX_PREOPT := nostripping" to do dex-preopt while not strip
the classes.dex.

Bug: 5396625 5502338
Change-Id: Ie8dea4414ebeefeae89c6433b246faea27baa5e7
bb7c6d88c6dd5ee48e8b8ec85ee04c0aa7bc5979 02-Apr-2011 Brian Carlstrom <bdc@google.com> Tracking merge of dalvik-dev to master

git cherry-pick --no-commit 5fac8d8f7096d8a950acad1ad0a8b963cef72e03

git cherry-pick --no-commit 1a8210710b46a0796ff2f8e76b6beb3a54f89019

git cherry-pick --no-commit 4fe2ac9f7284b838393aec8f0f48caef2510fd46

git cherry-pick --no-commit 7beb710a8f976fc4cb1e8be780644386870c4975

Change-Id: Ib10348e5509c906c6b95fa4accd6a18900bfe748
7bbea4b5c1f053cbe428025e9f9dec0e50bcc551 12-Jan-2011 Ying Wang <wangying@google.com> Disable dexpreopt for unbundled build.

Cherry-picked from Honeycomb.

Change-Id: I1b8bf7faa3974f389a1f105b3397c4ceeea68885
94978cf495879120c2dadf7afb2058688546be09 12-Jan-2011 Ying Wang <wangying@google.com> Disable dexpreopt for unbundled build.

Change-Id: Iad0cc41cfad2533703a0dddad743720c43ddb667
a83940fa7851b35712e559be2246b56b5666b805 25-Sep-2010 Ying Wang <wangying@google.com> Move odex related files to product-specific dir.

For target Java libraries, now the LOCAL_BUILT_MODULE includes both javalib.jar
and the .odex file, if dexpreopt is enabled.
These 2 files are moved to a product-specific dir in this change.
For target Java Libraries, $(intermediates) now points to the product-specific dir.
There is still a javalib.jar in the $(intermediates.COMMON) dir, which is used as dependency.
Nothing is changed for host Java libraries.

Change-Id: I2546dbb940c74537864ca002d1acb49bb731fbbc
30090e41e31e7db34a1092d8173c1413c036b49d 27-Sep-2010 Ying Wang <wangying@google.com> Set the intermediate dirs before using them.

Change-Id: Ibdab1234ca8c5a86c5226ed71e84374c3fcd7a90
9049e321aec53cfb23b63bbee7c21878a087350f 27-Sep-2010 Ying Wang <wangying@google.com> Add javalib.dex.jar to LOCAL_INTERMEDIATE_TARGETS

So the its target-specific PRIVATE vars can be set properly.

Change-Id: I83b60bd56ee8523b0ba97092010c76c270b60c02
e7874c430895b9a4e631c89f1e7729da9264d167 18-Sep-2010 Ying Wang <wangying@google.com> Integrate dexpreopt into the build system.

Change-Id: Id67f85d0f5c8674f5bc22e431114ca73625811ef
88b607994a148f4af5bffee163e39ce8296750c6 04-Mar-2009 The Android Open Source Project <initial-contribution@android.com> auto import from //depot/cupcake/@135843
05806d7af62e07c6225b2e7103a1b115ecf6c9ad 04-Mar-2009 The Android Open Source Project <initial-contribution@android.com> auto import from //depot/cupcake/@135843
b6c1cf6de79035f58b512f4400db458c8401379a 21-Oct-2008 The Android Open Source Project <initial-contribution@android.com> Initial Contribution