Commit Graph

71 Commits

Author SHA1 Message Date
Ying Wang 97dfa3177d Revert "Don't extract jni from prebuilt apks."
This reverts commit 3797466fbd.

Bug: 20810492
Bug: 20811499
Change-Id: Ic922d9daccc4550db489c0f3d4ad6b4ff85b5e60
2015-05-04 18:39:46 +00:00
Ying Wang 3797466fbd Don't extract jni from prebuilt apks.
- We don't need LOCAL_PAGE_ALIGN_JNI_SHARED_LIBRARIES now, for we always
  page-align jni shared libraries and store them umcompressed.
- For prebuilt apks, we don't extract jni any more; Instead we always run
  uncompress-shared-libs on them.
- For apks built from source, we still install the jni separately, because
  that way multiple apks can share the same jni and it saves space.

With this change, for most prebuilt apks, we don't need to specify
LOCAL_PREBUILT_JNI_LIBS ("@lib/<abi>/foo.so") any more, for the build
system automatically replaces the embedded jni with uncompressed files;
But if a prebuilt is a fat apk (i.e. containing jni not needed by the
current product architecture), you still need LOCAL_PREBUILT_JNI_LIBS to
specify what jni to keep. Otherwise all embedded jni will be replaced with
uncompressed files, that wastes space.

Bug: 8076853
Change-Id: Icf07e0998ac3602e6e05e80fed836fbafca33e01
2015-05-01 16:09:58 -07:00
Ying Wang ffe376b49e Fix jack transformation on prebuilt AAR.
Change-Id: I74f932cff606138943d97b923bbd059bcd496e46
2015-04-30 09:55:08 -07:00
Dmitriy Ivanov 155d7cc845 am 7347196a: am df7afb47: am 3b023915: am 4fa4e4be: Merge "Do not pack relocations for prebuilts by default"
* commit '7347196acbf640caaf68e4e790489a40d770a083':
  Do not pack relocations for prebuilts by default
2015-04-24 23:36:21 +00:00
Dmitriy Ivanov 64762c3027 Do not pack relocations for prebuilts by default
Do not pack relocations for prebuilds unless
 LOCAL_PACK_MODULE_RELOCATIONS is true

Bug: http://b/20537715
Bug: http://b/18051137
Change-Id: Iddef3b09741da6ae10d73c98103b868cc7695d38
2015-04-24 15:33:14 -07:00
Nick Kralevich e128152c4c am ebe3f7a5: am 700265ce: am 69b20474: Merge "Support LOCAL_PAGE_ALIGN_JNI_SHARED_LIBRARIES for prebuilt APKs"
* commit 'ebe3f7a59878d797f8f0de234f251958fee1c5af':
  Support LOCAL_PAGE_ALIGN_JNI_SHARED_LIBRARIES for prebuilt APKs
2015-04-18 01:33:09 +00:00
Nick Kralevich 5aa0223c6a Support LOCAL_PAGE_ALIGN_JNI_SHARED_LIBRARIES for prebuilt APKs
If a prebuilt APK contains shared libraries and the flag
LOCAL_PAGE_ALIGN_JNI_SHARED_LIBRARIES := true is set, then
uncompress any shared libraries stored within the APK.
This allows processes to load the shared library directly from
the APK.

Bug: 20247329
Bug: 8076853
Bug: 1162500
Change-Id: Iac4db32457d9ce31eb7256410023819b44fda0a6
2015-04-17 16:53:15 -07:00
Ying Wang 87a21c8b89 resolved conflicts for merge of eec386a4 to master
Change-Id: Ia686e67ed480427a6422d87bef2dcd4e44e27266
2015-04-15 14:39:26 -07:00
Kenny Root dff3755a93 Move package signing after file stripping
For dex preopt and JNI library extraction, we should remove the
classes.dex and .so files before we sign the APK so that there
isn't an entry in the manifest.

Prebuilt APKs which are pre-signed will simply not have the files
removed. This may cause some system.img bloat, but signature checks make
this necessary.

Bug: 20247329
Change-Id: I4742d1aa3aa64ab5aea2264304cb8c0bea24f784
2015-04-15 12:40:22 -07:00
Yohann Roussel 77cbe10fd9 Use Jack launcher
Bug: 20132430
Change-Id: I6e30ad3dffbb32824a4c62e562359b084e6a8784
2015-04-15 12:29:01 +02:00
Ying Wang aaf9a5b0cc Remove ancient ranlib workaround on Mac OS X.
Apparently we don't need it for Mac OS X 10.7 and above.

Change-Id: I5ee81700c16e8c66b2d5f2b373fd2d523b5ec018
2015-04-09 10:06:33 -07:00
Ying Wang 4972d195dd Remove ancient ranlib workaround on Mac OS X.
Apparently we don't need it for Mac OS X 10.7 and above.

Change-Id: I5ee81700c16e8c66b2d5f2b373fd2d523b5ec018
2015-04-09 09:45:39 -07:00
Ying Wang c1729f3602 Strip prebuilt shared library by default.
Strip prebuilt shared library but not try adding gnu debuglink.
It would fail if you try run the adding gnu debuglink command if a
prebuilt is already stripped.

Bug: 17177288
Change-Id: If5811865715c2437e45fbd329983ef1212ef0109
(cherry picked from commit bfb52a2ec1)
2015-03-13 11:36:15 -07:00
Yohann Roussel 801f2c44d0 Allow to pass arguments to Jill
Bug: 19026410
Change-Id: I3f3d7c0e7f8d6cc7150ae560b8734093798e8299
2015-03-05 14:54:06 +01:00
Narayan Kamath 7a9e388405 am 738871f6: am e886392c: am 37a44faa: Merge "Store native libs aligned to PAGE_SIZE"
* commit '738871f6eb3c372b60928e761f0dc24e46a6bba5':
  Store native libs aligned to PAGE_SIZE
2015-02-26 12:58:11 +00:00
Narayan Kamath e886392c37 am 37a44faa: Merge "Store native libs aligned to PAGE_SIZE"
* commit '37a44faa7266c8a7e0cc5077a4c028d6f5bfa7f7':
  Store native libs aligned to PAGE_SIZE
2015-02-26 12:45:34 +00:00
Dmitriy Ivanov 13e5965306 Store native libs aligned to PAGE_SIZE
- Add a new flag to zipalign (-p) that page aligns shared
  libraries (zip entries ending with ".so") in the archive.

- Add a new build variable LOCAL_PAGE_ALIGN_SHARED_LIBRARIES
  to turn on this behaviour in zipalign.

- Add a new LOCAL_JNI_SHARED_LIBRARIES_ZIP_OPTIONS to control
  zip behaviour.

Bug: 8076853
Bug: 19330157

Co-Authored-By: Simon Baldwin <simonb@google.com>
Co-Authored-By: Dimitry Ivanov <dimitry@google.com>
Change-Id: I1aa2c039bb2a590ae72f256acc9ba5401c2c59b1
2015-02-26 12:31:40 +00:00
Yohann Roussel 1d58de3b0a Merge "Adapt to Jack and Jill Brest release" 2014-12-11 12:28:16 +00:00
Ying Wang 43ad7b9eba am b283ef2c: am 18eee18e: am 60686586: Add product variable PRODUCT_AAPT_PREBUILT_DPI
* commit 'b283ef2c3bf76a268e216ba66d0d9cf97d7b97ea':
  Add product variable PRODUCT_AAPT_PREBUILT_DPI
2014-12-11 01:39:26 +00:00
Ying Wang b283ef2c3b am 18eee18e: am 60686586: Add product variable PRODUCT_AAPT_PREBUILT_DPI
* commit '18eee18e6e51da4857054376ad96add16c0c0b92':
  Add product variable PRODUCT_AAPT_PREBUILT_DPI
2014-12-11 00:07:38 +00:00
Ying Wang 18eee18e6e am 60686586: Add product variable PRODUCT_AAPT_PREBUILT_DPI
* commit '60686586a5f9c8f78b9ad16e19782da85e89a760':
  Add product variable PRODUCT_AAPT_PREBUILT_DPI
2014-12-10 22:19:49 +00:00
Ying Wang 60686586a5 Add product variable PRODUCT_AAPT_PREBUILT_DPI
We use search LOCAL_DPI_VARIANTS in the list of
"$(PRODUCT_AAPT_PREF_CONFIG) $(PRODUCT_AAPT_PREBUILT_DPI)"
and the first takes precedence.
That way if we don't have a best match, we fall back to the second best,
the way how it worked with PRODUCT_AAPT_CONFIG previously.

Bug: 18388705
Change-Id: I8bd646c52215c65cc6e38c728857af9b64d13469
2014-12-10 12:40:09 -08:00
Yohann Roussel 22c3fa6d73 Adapt to Jack and Jill Brest release
Includes cherry-picks of:
2e78d2f4263bc7c0f90d58af7014017f16aa3ce6 Jack option --import-res was renamed --import-resource
fdc913ee86fe0c45581178b901a673fdd7937e03 Update references to Jack type collison policy
8d83d1b21ec678fb9fb1c6ee643ace46d5f700ce Rename jill tmp file
8a1c98ce4ba0b4db39f274d6258b6a08bbc3ec2c Ensure that jar-arg-list is never shared
8d83d1b21ec678fb9fb1c6ee643ace46d5f700ce Remove manipulations of jack libraries

Change-Id: I3ee159d408ba5281ac15c9836dc4fd2bdeb845d3
2014-12-10 15:41:56 +01:00
Yohann Roussel b4c49cba57 Compile using Jack.
This allows to compile dex targeted java sources using Jack and Jill.
Default is still to compile with the legacy toolchain. Default can be
switched to the new toolchain by setting environement variable:
export ANDROID_COMPILE_WITH_JACK=true
Toolchain can also be forced for one module by defining
LOCAL_USE_JACK:=true # false
in the mk portion defining the module.

Jack execution environement can be controlled with:

Global variable ANDROID_JACK_VM allow to change the jvm executing Jack.
Global variable ANDROID_JACK_VM_ARGS allows to change default args given
to the jvm.
Global variable ANDROID_JACK_EXTRA_ARGS allows to define some default args
to give to Jack

LOCAL_JACK_VM_ARGS allows to override default args given to the jvm for
the module.
LOCAL_JACK_EXTRA_ARGS allows to override default args passed to Jack.

Change-Id: Ib81a0fd5f86a51d1e0edbb81cc791d828a05dd29
2014-12-02 18:11:13 +01:00
Ying Wang f9c93d7cbd am 0217e3b2: resolved conflicts for merge of a4f415d6 to lmp-mr1-dev-plus-aosp
* commit '0217e3b20b6a331b0820014dc136d782070bca45':
  Support prebuilt apk source selection based on PRODUCT_AAPT_PREF_CONFIG
2014-11-19 00:33:48 +00:00
Ying Wang 0217e3b20b resolved conflicts for merge of a4f415d6 to lmp-mr1-dev-plus-aosp
Change-Id: Ibb54bce20342bd386ec85388d48c1c08e8b80197
2014-11-18 16:28:04 -08:00
Ying Wang a4f415d65e am ea4dfb75: Merge "Support prebuilt apk source selection based on PRODUCT_AAPT_PREF_CONFIG" into lmp-mr1-dev
* commit 'ea4dfb7551e680f7496e1d35c05bdad10ca58b4a':
  Support prebuilt apk source selection based on PRODUCT_AAPT_PREF_CONFIG
2014-11-19 00:23:00 +00:00
Ying Wang 43f7a3226a Support prebuilt apk source selection based on PRODUCT_AAPT_PREF_CONFIG
Two new LOCAL variables are added to support dpi-specific prebuilt apk
selection:
- LOCAL_DPI_VARIANTS: specify a list of dpis the module provides with
  specific prebuilt.
  Example: LOCAL_DPI_VARIANTS := xxhdpi xhdpi hdpi mdpi
- LOCAL_DPI_FILE_STEM: specify the dpi-specific source file name
  pattern.
  Example: LOCAL_DPI_FILE_STEM := MyApp-%.apk
  "%" will be substitued by $(PRODUCT_AAPT_PREF_CONFIG) in the core
  build system.
  If you don't set up LOCAL_DPI_FILE_STEM, the default is
  $(LOCAL_MODULE)_%.apk.

The build system searches $(PRODUCT_AAPT_PREF_CONFIG) in a prebuilt apk
module's $(LOCAL_DPI_VARIANTS). If not found, use whatever
$(LOCAL_SRC_FILES) as the source file; Otherwise use $(LOCAL_DPI_FILE_STEM)
to construct the dpi-specific apk's source file name, and use whatever
directory name of $(LOCAL_SRC_FILES).

Bug: 18388705
Change-Id: I63cae73f1b6f880302142abc476b3ce1fb5500b5
2014-11-17 17:05:27 -08:00
Dan Albert 6da20991fd am 5245bc8b: am 201f6b3e: Merge "Make modules depend on their makefile."
* commit '5245bc8b3421b3a9676a9ad650d0804d8d9e2787':
  Make modules depend on their makefile.
2014-11-11 23:00:40 +00:00
Dan Albert 5245bc8b34 am 201f6b3e: Merge "Make modules depend on their makefile."
* commit '201f6b3e92a2ef2f3a117f33cd399d5304dd385a':
  Make modules depend on their makefile.
2014-11-11 22:56:01 +00:00
Dan Albert 954b5bdcf4 Make modules depend on their makefile.
This should obviate much of the need for cleanspecs, and also make it
unnecessary to continue adding LOCAL_ADDITIONAL_DEPENDENCIES for this
sort of thing all over the tree.

Change-Id: I97aa8fd280ae868a5f6364f8b7bf3c2fe235d6ce
2014-11-11 14:30:54 -08:00
Ying Wang f4053c70e4 am 007026f0: am 3fe170c5: Merge "Add support for prebuilt AARs." into lmp-mr1-ub-dev
* commit '007026f0ebf2216d875b9fdab44cc68b659e2307':
  Add support for prebuilt AARs.
2014-11-03 18:11:53 +00:00
Ying Wang 007026f0eb am 3fe170c5: Merge "Add support for prebuilt AARs." into lmp-mr1-ub-dev
* commit '3fe170c51ea1eca253164fa8738ab42b5b9aaa6b':
  Add support for prebuilt AARs.
2014-11-03 18:07:45 +00:00
Nick Kralevich 0a5105bd25 am e4cbc2af: Merge "Revert "Add support for prebuilt AARs."" into lmp-mr1-ub-dev
* commit 'e4cbc2af5f476d9eb875253584260bed807acddf':
  Revert "Add support for prebuilt AARs."
2014-11-02 16:53:29 +00:00
Ying Wang e9dd9f2bfc Add support for prebuilt AARs.
- You can give a .aar as source file to a prebuilt static Java library
  module. The build system will set up dependencies and rules to extract
  classes.jar and other resource files.
- To build against a prebuilt AAR module, use:
  LOCAL_STATIC_JAVA_AAR_LIBRARIES := <module names of aar prebuilt AARs>
  The build system will set up rules to merge the library's
  AndroidManifest.xml with the main AndroidManifest.xml, add the AAR's
  resource dirs and link/merge the AAR's classes.jar.

Bug: 18168693
Change-Id: Ic2c1d20572a93bd98dbc72f8a39e26b459e442c2
2014-11-02 16:51:49 +00:00
Nick Kralevich 36fd476843 Revert "Add support for prebuilt AARs."
master doesn't compile anymore.

This reverts commit f567292504.

Change-Id: Icc16fe5360d1222740b803e9dd006081e3c66e46
(cherry picked from commit bcf8683b29)
2014-11-02 05:26:14 +00:00
Nick Kralevich bcf8683b29 Revert "Add support for prebuilt AARs."
master doesn't compile anymore.

This reverts commit f567292504.

Change-Id: Icc16fe5360d1222740b803e9dd006081e3c66e46
2014-11-02 05:11:11 +00:00
Ying Wang df95d8c1f7 am 4ef8133a: am f5672925: Add support for prebuilt AARs.
* commit '4ef8133a421dd92c6feb0508bc2274f12576cfd2':
  Add support for prebuilt AARs.
2014-10-31 00:20:31 +00:00
Ying Wang 4ef8133a42 am f5672925: Add support for prebuilt AARs.
* commit 'f56729250448200834c5c95c86c937e887d73623':
  Add support for prebuilt AARs.
2014-10-31 00:13:50 +00:00
Ying Wang f567292504 Add support for prebuilt AARs.
- You can give a .aar as source file to a prebuilt static Java library
  module. The build system will set up dependencies and rules to extract
  classes.jar and other resource files.
- To build against a prebuilt AAR module, use:
  LOCAL_STATIC_JAVA_AAR_LIBRARIES := <module names of aar prebuilt AARs>
  The build system will set up rules to merge the library's
  AndroidManifest.xml with the main AndroidManifest.xml, add the AAR's
  resource dirs and link/merge the AAR's classes.jar.

Bug: 18168693
Change-Id: I478913d5d498f800b322529d7c2c2c0ea78425e5
2014-10-29 23:40:52 +00:00
Ying Wang 230afab744 am e4e50f9b: am 8330c4c5: Merge "Apply LOCAL_CXX_STL to also prebuilts."
* commit 'e4e50f9bb4ae8af11aaddf9825a09ff33241b204':
  Apply LOCAL_CXX_STL to also prebuilts.
2014-10-07 23:23:15 +00:00
Ying Wang 4019305580 am e4e50f9b: am 8330c4c5: Merge "Apply LOCAL_CXX_STL to also prebuilts."
* commit 'e4e50f9bb4ae8af11aaddf9825a09ff33241b204':
  Apply LOCAL_CXX_STL to also prebuilts.
2014-10-07 23:20:51 +00:00
Ying Wang 75e8fcbb6c Apply LOCAL_CXX_STL to also prebuilts.
Because LOCAL_CXX_STL modifies a module's required shared libaries,
we need this for also prebuilt shared libraries and executables.

Change-Id: I418c26143999a613c40aadf990f131b123e0ac3d
2014-10-07 13:07:00 -07:00
Ying Wang 7c877395b1 Apply LOCAL_CXX_STL to also prebuilts.
Because LOCAL_CXX_STL modifies a module's required shared libaries,
we need this for also prebuilt shared libraries and executables.

Change-Id: I418c26143999a613c40aadf990f131b123e0ac3d
2014-10-07 13:03:29 -07:00
Andreas Gampe 2e3a71e658 am eb304c0d: am 0f85ebab: am 5e0dbe0c: Conditionally skip dex-preopting prebuilts.
* commit 'eb304c0d27fa96773ad52683ee4846e2e66ad61d':
  Conditionally skip dex-preopting prebuilts.
2014-10-02 21:45:54 +00:00
Andreas Gampe 5e0dbe0c37 Conditionally skip dex-preopting prebuilts.
To skip dex-preopting prebuilts (to save system image space),
set "DONT_DEXPREOPT_PREBUILTS := true".

Bug: 17772057

Change-Id: I13f10e2a9c251366f29606158f8c2fb54f8ee8b1
2014-10-02 10:14:59 -07:00
Ying Wang bfb52a2ec1 Strip prebuilt shared library by default.
Strip prebuilt shared library but not try adding gnu debuglink.
It would fail if you try run the adding gnu debuglink command if a
prebuilt is already stripped.

Bug: 17177288
Change-Id: If5811865715c2437e45fbd329983ef1212ef0109
2014-09-03 12:11:06 -07:00
Ying Wang 00fe587974 Support to install prebuilt split APKs with LOCAL_PACKAGE_SPLITS
In prebuilt app module, you can use LOCAL_PACKAGE_SPLITS to specify a
list of prebuilt split apks. The build system will sign and zipalign the
apks and install them with the same file names.
Note that you need to put all the source split apks in the same folder.

Bug: 16319961
Change-Id: Id2b6d743c1edc5e436007ec11acece1748adad45
2014-07-23 14:38:02 -07:00
Ying Wang af9757e849 New installation path for apks and their JNIs.
Apk's path is changed to <parent_dir>/MyApp/MyApp.apk;
JNI path is changed to <parent_dir>/MyApp/lib/<arch_name>/libfoo.so.
Symlinks of JNIs are changed accordingly.

Bug: 16319961
Change-Id: Ib3b2309c95fa9aea27837fcc29e28d990b04747b
2014-07-18 16:26:24 -07:00
Ying Wang 58f8cf7273 am 904446ce: am 1a3d260f: am e69d4350: Merge "Support to add JNI of both archs in multilib build."
* commit '904446ce0b3f430ac88ae0c08b9c613721474cd5':
  Support to add JNI of both archs in multilib build.
2014-06-25 18:52:02 +00:00