summaryrefslogtreecommitdiffstats
path: root/core/package_internal.mk
Commit message (Collapse)AuthorAgeFilesLines
* build: Make sure we're building our secondary resource package as dependency.Adnan Begovic2015-10-091-0/+20
| | | | | | | This allows us to reference internal or public resources without going explicitily through the platform sdk. Change-Id: Iba361a3dcd20bc62a06e600e0240fb09d4e7bda4
* Don't extract jni from prebuilt apks.Ying Wang2015-06-011-1/+0
| | | | | | | | | | | | | | | | | | | | - 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: Ic3666dc72bf17cd293787414dd185470b365f967
* Revert "Don't extract jni from prebuilt apks."Ying Wang2015-05-041-0/+1
| | | | | | | | This reverts commit 3797466fbd31cc3ca5a1eddea64e7fdf0921ea67. Bug: 20810492 Bug: 20811499 Change-Id: Ic922d9daccc4550db489c0f3d4ad6b4ff85b5e60
* Don't extract jni from prebuilt apks.Ying Wang2015-05-011-1/+0
| | | | | | | | | | | | | | | | | | | | - 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
* am a6c44859: am bc671bc6: am e3aa1c1f: Merge "Remove ↵Dmitriy Ivanov2015-04-171-1/+0
|\ | | | | | | | | | | | | LOCAL_JNI_SHARED_LIBRARIES_ZIP_OPTIONS" * commit 'a6c44859c5344d489526641ce5a08598254da57b': Remove LOCAL_JNI_SHARED_LIBRARIES_ZIP_OPTIONS
| * Remove LOCAL_JNI_SHARED_LIBRARIES_ZIP_OPTIONSDmitriy Ivanov2015-04-171-1/+0
| | | | | | | | | | | | Use LOCAL_PAGE_ALIGN_JNI_SHARED_LIBRARIES instead. Change-Id: Id30529fbc1652d066e0008813352848b5e404ab9
* | resolved conflicts for merge of eec386a4 to masterYing Wang2015-04-151-1/+1
|\ \ | |/ | | | | Change-Id: Ia686e67ed480427a6422d87bef2dcd4e44e27266
| * Move package signing after file strippingKenny Root2015-04-151-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | 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
| * Add back Java resources to apk without Java code.Ying Wang2015-03-271-1/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | With commit 33360dd56925276e4526f5f52c26423e2bb1a670 we moved Java resource packaging forward to creation of the jar file. But the Java resource packaging will be skipped if a module has no Java code at all. (The build system does support building an apk without Java code.) In this change we add back the Java resources directly to the built apk when the apk has no Java code. (cherry-picked from commit 8b27d1879c5692ebe6c5ac85383981fd96dfe2e1) Bug: 19947218 Change-Id: I0e1a65a9cbe656974f8ef3923b2f15e9efa5feb9
* | Add back Java resources to apk without Java code.Ying Wang2015-03-271-1/+4
| | | | | | | | | | | | | | | | | | | | | | | | With commit 33360dd56925276e4526f5f52c26423e2bb1a670 we moved Java resource packaging forward to creation of the jar file. But the Java resource packaging will be skipped if a module has no Java code at all. (The build system does support building an apk without Java code.) In this change we add back the Java resources directly to the built apk when the apk has no Java code. Bug: 19947218 Change-Id: I0e1a65a9cbe656974f8ef3923b2f15e9efa5feb9
* | am cafb413c: am 59c24c79: am 095c4515: Merge "Remove unused variables."Narayan Kamath2015-02-271-8/+0
|\ \ | |/ | | | | | | * commit 'cafb413c2d4ec69ac111df76ea264f8594065398': Remove unused variables.
| * am 095c4515: Merge "Remove unused variables."Narayan Kamath2015-02-271-8/+0
| |\ | | | | | | | | | | | | * commit '095c451541765c7efb9d5a8152f8ef15626ccedb': Remove unused variables.
| | * Remove unused variables.Narayan Kamath2015-02-261-8/+0
| | | | | | | | | | | | | | | | | | Follow up from 13e5965306212a9051772ff1d5bc3a88e5fb5. Change-Id: I370e52acd998ce72b4d7dbf2aba604d4b08bb0cf
* | | am 738871f6: am e886392c: am 37a44faa: Merge "Store native libs aligned to ↵Narayan Kamath2015-02-261-1/+11
|\ \ \ | |/ / | | | | | | | | | | | | | | | PAGE_SIZE" * commit '738871f6eb3c372b60928e761f0dc24e46a6bba5': Store native libs aligned to PAGE_SIZE
| * | am 37a44faa: Merge "Store native libs aligned to PAGE_SIZE"Narayan Kamath2015-02-261-1/+11
| |\ \ | | |/ | | | | | | | | | * commit '37a44faa7266c8a7e0cc5077a4c028d6f5bfa7f7': Store native libs aligned to PAGE_SIZE
| | * Store native libs aligned to PAGE_SIZEDmitriy Ivanov2015-02-261-1/+11
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | - 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
* | | Change built module of static java librariesYohann Roussel2015-02-181-6/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | Set LOCAL_BUILT_MODULE of static java libraries when Jack is enabled to classes.jack instead of javalib.jar. This allows that running mm in those libraries will build classes.jack instead of the jar. Change-Id: I96b4b227848e971df96331b3f0cc731e856be349
* | | Engage Jack incremental on demandYohann Roussel2015-02-041-6/+13
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Each module may engage Jack incremental with LOCAL_JACK_ENABLED := incremental Include renaming of LOCAL_USE_JACK to LOCAL_JACK_ENABLED that is now accepting 3 values "disabled", "full" and "incremental". Change-Id: Icbff275b397bee36b29312e821f3e8d45f83fbcc
* | | am 7c05897b: am e937ac81: Merge "Add new build flag LOCAL_DONT_DELETE_JAR_DIRS."Ying Wang2015-01-291-0/+1
|\ \ \ | |/ / | | | | | | | | | * commit '7c05897b69801e1945889a9b1a89b86bbbbbdd3a': Add new build flag LOCAL_DONT_DELETE_JAR_DIRS.
| * | am e937ac81: Merge "Add new build flag LOCAL_DONT_DELETE_JAR_DIRS."Ying Wang2015-01-291-0/+1
| |\ \ | | |/ | | | | | | | | | * commit 'e937ac814c7f4e1989509f94f7ac8ae5b28a3526': Add new build flag LOCAL_DONT_DELETE_JAR_DIRS.
| | * Add new build flag LOCAL_DONT_DELETE_JAR_DIRS.Fredrik Roubert2015-01-291-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Normally the build function initialize-package-file will delete all class files and all directory entries from JAR files, but sometimes external projects (eg. ICU4J) depend on having directory entries in their JAR files. This change adds the flag LOCAL_DONT_DELETE_JAR_DIRS (analogous to the flag LOCAL_DONT_DELETE_JAR_META_INF) which when set will skip deletion of directory entries in initialize-package-file. Change-Id: I4464b947b7528fca23925affa95e4071915f04d4
| * | am 29a29875: Merge "Running jarjar on Java resources."Ying Wang2015-01-221-5/+8
| |\ \ | | |/ | | | | | | | | | * commit '29a29875627758aa3c76aa5256641c1782c904bf': Running jarjar on Java resources.
| | * Running jarjar on Java resources.Ying Wang2015-01-211-5/+8
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Before this change, Java resources are added as a separate step (add-java-resources-to-package) after dex is run, so jarjar isn't run on the resource files. With this change, we add Java resources immediately after we call javac, so jarjar is run on the resource files (the module's own resource, as well as resources carried by static Java libraries). When we generate the final apk/jar, we use the jarjar'ed jar as the inital pacakge file, with class files and empty folders removed. (cherry-picked from commit 140274707e31c9585aa28b0de2f1418c64ecd272) Bug: 18837479 Change-Id: I15ecf282bfb65fd53dd03fbd03dd4c71927c186a
* | | Running jarjar on Java resources.Ying Wang2015-01-211-8/+14
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Before this change, Java resources are added as a separate step (add-java-resources-to-package) after dex is run, so jarjar isn't run on the resource files. With this change, we add Java resources immediately after we call javac, so jarjar is run on the resource files (the module's own resource, as well as resources carried by static Java libraries). When we generate the final apk/jar, we use the jarjar'ed jar as the inital pacakge file, with class files and empty folders removed. When jack is enabled, in jack-java-to-dex we add the Java resources to a temp jar using the PRIVATE_EXTRA_JAR_ARGS, and extrac the files in a temp dir. Jack will process the resource files and output the result to PRIVATE_JACK_INTERMEDIATES_DIR. When we package the final apk/jar, we need to call add-carried-jack-resources to readd the resources. (TODO: if jack can output all resources to a jar/zip file, we can use that file as the initial package file as well.) Bug: 18837479 Change-Id: I8d7296e30ec8d005054cf04c4f2aed6d7a0d823b
* | | Revert "Running jarjar on Java resources."Narayan Kamath2015-01-211-14/+8
| | | | | | | | | | | | | | | | | | | | | | | | This reverts commit 140274707e31c9585aa28b0de2f1418c64ecd272. Breaks the build on uiautomator_compat. Change-Id: I6d14f39e3432bf5e691027bbb8e7260e4bec8e8d
* | | Running jarjar on Java resources.Ying Wang2015-01-201-8/+14
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Before this change, Java resources are added as a separate step (add-java-resources-to-package) after dex is run, so jarjar isn't run on the resource files. With this change, we add Java resources immediately after we call javac, so jarjar is run on the resource files (the module's own resource, as well as resources carried by static Java libraries). When we generate the final apk/jar, we use the jarjar'ed jar as the inital pacakge file, with class files and empty folders removed. When jack is enabled, in jack-java-to-dex we add the Java resources to a temp jar using the PRIVATE_EXTRA_JAR_ARGS, and extrac the files in a temp dir. Jack will process the resource files and output the result to PRIVATE_JACK_INTERMEDIATES_DIR. When we package the final apk/jar, we need to call add-carried-jack-resources to readd the resources. (TODO: if jack can output all resources to a jar/zip file, we can use that file as the initial package file as well.) Bug: 18837479 Change-Id: I15ecf282bfb65fd53dd03fbd03dd4c71927c186a
* | | am aa4c8870: am a1e09b1a: am 98ae7985: Fix using variable ↵Ying Wang2014-12-191-8/+4
|\ \ \ | |/ / | | | | | | | | | | | | | | | intermediates.COMMON before defining. * commit 'aa4c8870a802e317fda14f0574b00d844a4b4716': Fix using variable intermediates.COMMON before defining.
| * | Fix using variable intermediates.COMMON before defining.Ying Wang2014-12-181-8/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | In commit e9dd9f2bf we moved "include $(BUILD_SYSTEM)/android_manifest.mk" forward before the variable intermediates.COMMON gets defined. That's a mistake. This change replaced the tentative variables package_expected_intermediates_COMMON and guessed_intermediates with their proper counterparts defined in base_rules.mk. If their values differ in the two file, that's an error and we should fix. Bug: 18168693 Change-Id: I2bf17b0476b4a7f97810fbb0bde7630eb8878b53
| * | Add support for prebuilt AARs.Ying Wang2014-12-171-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | - 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 (cherry picked from commit e9dd9f2bfceed3b5f630b0edbe3feb7f34548d8b)
* | | Merge "Compile using Jack."Yohann Roussel2014-12-041-0/+23
|\ \ \
| * | | Compile using Jack.Yohann Roussel2014-12-021-0/+23
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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
* | | | am 8070b20f: Support to build dpi-specific apk variants.Ying Wang2014-12-021-0/+10
|\ \ \ \ | |/ / / |/| / / | |/ / | | | * commit '8070b20f9ec899a5dc27c7589f11c6db8c72180a': Support to build dpi-specific apk variants.
| * | Support to build dpi-specific apk variants.Ying Wang2014-12-021-0/+10
| |/ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | In unbundled apps_only build, in addition to the base apk, you can also build the dpi-specific apk variants, with: LOCAL_DPI_VARIANTS := <a list of dpi names> Previously user needs to include $(BUILD_PACKAGE) repeatedly with the same package definition except dpi flags. With this change, all the dpi-specific apk variants share the base apk's compiled Java code and only diverge at the point we add resources/assets to the apk. Also we set up variables/targets/rules in a way those dpi-specific apks appear to be independent apks to the users, for example, you can pass "AppName_<dpi_name>" to tapas, and AppName_<dpi_name>.apk lives in its own intermediate directory. Bug: 18388705 Change-Id: I2ba4972ea7d1f796352fab2407888f996781ae44
* | Add support for prebuilt AARs.Ying Wang2014-11-021-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | - 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
* | Revert "Add support for prebuilt AARs."Nick Kralevich2014-11-021-2/+2
| | | | | | | | | | | | | | | | master doesn't compile anymore. This reverts commit f56729250448200834c5c95c86c937e887d73623. Change-Id: Icc16fe5360d1222740b803e9dd006081e3c66e46
* | Add support for prebuilt AARs.Ying Wang2014-10-291-2/+2
|/ | | | | | | | | | | | | | - 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
* Convert comma in split arguments to underscore.Ying Wang2014-10-011-3/+5
| | | | | | | aapt already does so. Bug: 16947729 Change-Id: I813fb8cf41b3ec836e6e6d5f68af12dc385169f8
* Allow LOCAL_ASSET_DIR point to nonexistent dirYing Wang2014-09-201-1/+8
| | | | | | | | | | LOCAL_ASSET_DIR may point to a dir generated during the build process. We have done similiar things to LOCAL_RESOURCE_DIR. (cherry picked from commit bfcdf060bab129581acff32eb70896f719162bc9) Bug: 16563899 Change-Id: Iaa72196e1e6350ae0720f8a4e0abc68d8d7ed642
* Support to build apk odex for both arch.Ying Wang2014-09-131-1/+2
| | | | | | | | | | Build odex for both arch in multilib build if an app has LOCAL_MULTILIB := both. Refactored the common setup code to a separate file setup_one_odex.mk. Bug: 17409149 Bug: 14694978 Change-Id: I74c9426cd74fe0b0cb4811368f740a88ac2ae022
* Don't apply PRODUCT_AAPT_PREF_CONFIG if LOCAL_PACKAGE_SPLITS is setYing Wang2014-07-301-0/+4
| | | | | Bug: 16319961 Change-Id: I8ea308c94ff58eaccd8854ab98e11238b993f867
* Improve rules of split apks.Ying Wang2014-07-231-6/+16
| | | | | | | | | | | - Better messaging if the expected split apk isn't generated by the aapt command in the base apk rule; Remove the built base apk, so make will rerun aapt after the user changes the splitting parameters. - Use cleaner static pattern rules instead of running $(foreach) with $(eval). Bug: 16319961 Change-Id: If6ae302e1a39d2e0db8f784d4e1cf292ec855281
* Support LOCAL_PACKAGE_SPLITS.Ying Wang2014-07-221-0/+30
| | | | | | | | | Support LOCAL_PACKAGE_SPLITS, which accepts a list of resource lables and generates multiple apks. The build system sets up rules to sign and zipalign the split apks. Bug: 16319961 Change-Id: I344b3d1c7eb158c6d0df879093d666a89870aadd
* Support "LOCAL_SDK_VERSION := system_current"Ying Wang2014-07-191-2/+2
| | | | | | | | A module can declare "LOCAL_SDK_VERSION := system_current" to build against the android system stubs generated from source. For now this is only supported in platform build. Change-Id: I1e9bbd159886bc0ea3a02b1dc4cbcb1a56e9cb15
* New installation path for apks and their JNIs.Ying Wang2014-07-181-0/+1
| | | | | | | | | 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
* am 01b179bf: am bb964f00: am 432cd6dd: Merge "Allow LOCAL_RESOURCE_DIR ↵Ying Wang2014-06-251-5/+13
|\ | | | | | | | | | | | | pointing to dir generated during the build" * commit '01b179bf3b5c4c0307e0efb4004a1c44705fe780': Allow LOCAL_RESOURCE_DIR pointing to dir generated during the build
| * am bb964f00: am 432cd6dd: Merge "Allow LOCAL_RESOURCE_DIR pointing to dir ↵Ying Wang2014-06-251-5/+13
| |\ | | | | | | | | | | | | | | | | | | generated during the build" * commit 'bb964f00403a23d2f1ec3313f7b579a9e7f0f12a': Allow LOCAL_RESOURCE_DIR pointing to dir generated during the build
| | * Allow LOCAL_RESOURCE_DIR pointing to dir generated during the buildYing Wang2014-06-251-5/+13
| | | | | | | | | | | | | | | Bug: 15850610 Change-Id: I46b98adb556d8e6bf166761f8bb240006dbe5b14
* | | am 904446ce: am 1a3d260f: am e69d4350: Merge "Support to add JNI of both ↵Ying Wang2014-06-251-2/+4
|\ \ \ | |/ / | | | | | | | | | | | | | | | archs in multilib build." * commit '904446ce0b3f430ac88ae0c08b9c613721474cd5': Support to add JNI of both archs in multilib build.
| * | am 1a3d260f: am e69d4350: Merge "Support to add JNI of both archs in ↵Ying Wang2014-06-251-2/+4
| |\ \ | | |/ | | | | | | | | | | | | | | | multilib build." * commit '1a3d260f68755b476aa867477fc75d47ef5317bf': Support to add JNI of both archs in multilib build.
| | * Support to add JNI of both archs in multilib build.Ying Wang2014-06-251-2/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Use "LOCAL_MULTILIB := both" to install jni libraries of both archs in multilib build. The build system will package jni of both archs to the apk, or install them to the right location on the system image and create symlinks, extract .so files from prebuilt apk, etc if appropriate. Bug: 15849902 Change-Id: I7e147b5a47db476584c38250de7b36c75ea40d81