aboutsummaryrefslogtreecommitdiffstats
path: root/java/app.go
Commit message (Collapse)AuthorAgeFilesLines
* Uncompress dex in unbundled privileged appsColin Cross2020-02-011-5/+6
| | | | | | | | | | Mainline builds privileged apps unbundled and then uses them as prebuilts, so they need to respect the privileged flag when deciding whether or not to uncompress the dex. Bug: 135772877 Test: TestUncompressDex Change-Id: I91da7116b779ae35c0617ef77dbcb9788902370c
* Fix split apk paths.Jaewoong Jung2019-12-111-0/+3
| | | | | | | | | | | | | Soong has been outputting incorrect Android.mk entries for split apks. soong_app_prebuilt.mk expects LOCAL_SOONG_BUILT_INSTALLED to contain a list of <split apk path>:<on device install path> pairs whereas Soong outputs <split apk path>:$(LOCAL_MODULE_PATH)/<split apk filename> pairs. This also adds a missing underscore in split apk filenames. Test: m Split Bug: 140795853 Change-Id: I3d6506f5e12106174fbbaef34749a272b5e1b90c
* Fix android_test install path.Jaewoong Jung2019-12-111-10/+17
| | | | | | Test: m nothing + diff soong mk and ninja files. Bug: 140795853 Change-Id: I3667eac951dea7e447cf73219ff89199fca9ed63
* Add default_dev_cert to android_app_importJaewoong Jung2019-12-111-7/+20
| | | | | | | Test: app_test.go Bug: 122333215 Bug: 128610294 Change-Id: I4be98a57ffec0885258ed7d7bb2badc8b2798750
* Add arch variant support to android_app_import.Jaewoong Jung2019-12-111-30/+51
| | | | | | | Bug: 128610294 Fixes: 138792623 Test: app_test.go Change-Id: I47c80ec283ce58a0ce9b7d0af40844bd73e9d3f1
* Add filename property to android_app_importJaewoong Jung2019-12-111-1/+7
| | | | | | Test: app_test.go Bug: 137218697 Change-Id: If2b20a355bb6e9e8dbcd57347c0e2c6fa041a932
* Improve android_app_import.dpi_variants handling.Jaewoong Jung2019-12-111-69/+77
| | | | | | | | | | | | | Instead of circumventing the limitation of Prebuilt implementation by picking a source path itself, it now uses the same mechanism as archMutator and replaces the source path in advance so that Prebuilt always sees the corrent source path. Because this requires the Apk field to be a string pointer, the single source prebuilt implementation is being updated to be reflection-based. Test: Soong unit tests, m soong_docs, TreeHugger Change-Id: I2304f15e32d632f74f95f0d9e9bf1f75ff3e2225
* Implement DPI variants in android_app_import.Jaewoong Jung2019-12-111-5/+79
| | | | | | Bug: 128610294 Test: app_test.go Change-Id: Ie3e558bfdb40de6b0b9df95d3b373d08a4084d7b
* Uncompress dex file in imported apk when needed.Jaewoong Jung2019-12-111-0/+18
| | | | | | | This implements the uncompress-dexs macro's behavior in Soong. Test: Converted TvSampleLeanbackLauncher + zipinfo Change-Id: I9477aa21429d055f3f36ca90c7fd2c345c999029
* uncompressedDex option for android_app_import.Jaewoong Jung2019-12-111-13/+18
| | | | | | | | This also partially consolidates shouldUncompressDex implementations. Bug: 128610294 Test: TreeHugger Change-Id: I7cea5a3890ddd473f63c0738a35af067455b5c4d
* Add android_app_import.Jaewoong Jung2019-12-111-24/+158
| | | | | | | | This is an initial version that handles the most basic cases. Bug: 128610294 Test: app_test.go + prebuilt webview.apk Change-Id: Ic525559aad5612987e50aa75b326b77b23acb716
* soong: Squash of lineage-sdk bringup commitsRashed Abdel-Tawab2019-12-111-1/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Squash of: Author: Rashed Abdel-Tawab <rashed@linux.com> Date: Thu Aug 9 14:08:53 2018 -0700 soong: Special case Lineage SDK * org.lineageos.platform-res.apk needs to be installed to /system/framework * org.lineageos.platform-res needs to be a dependency for org.lineageos.platform and org.lineageos.platform.internal * Add other special exceptions for org.lineageos.platform-res Change-Id: Ic617c07c086916005ea4b88f26d31c61691a45f8 Author: Sam Mortimer <sam@mortimer.me.uk> Date: Thu Aug 30 15:33:16 2018 -0700 soong: make org.lineage.platform-res depend on framework-res *) Allows us to build org.lineage.platform-res with no_framework_libs true (as is done for framework-res). *) Whilst we're here, undo a dependency loop prevention in aar.go that we added during sdk bringup to allow our platform res to build with no_framework_libs false. Change-Id: Ib452a2e45112baf5d61b70b4be1ce0c01dfd84e5 Author: Luca Stefani <luca.stefani.ge1@gmail.com> Date: Mon Feb 4 18:56:52 2019 +0100 Always link org.lineageos.platform-res for org.lineageos.platform.sdk Test: m clean && m org.lineageos.platform.sdk Change-Id: I58956855bd4d1157e2582103c4861e7b384b4f73 Author: Sam Mortimer <sam@mortimer.me.uk> Date: Fri Aug 31 10:52:29 2018 -0700 soong: Allow framework to access lineage-sdk resources *) Make framework depend on lineage-sdk resource package *) Allows framework module to access lineage-sdk resources via usual org.lineageos.platform.internal.R paths. Change-Id: Ifd19d43d9308ac370ad40a499de16bf8ce204beb Change-Id: Icc18de5dfaa83fc0a1eda6f3704f3a92e1de0764
* Uncompress dex in unbundled privileged appsColin Cross2019-06-251-5/+6
| | | | | | | | | | | | Mainline builds privileged apps unbundled and then uses them as prebuilts, so they need to respect the privileged flag when deciding whether or not to uncompress the dex. Bug: 135772877 Test: TestUncompressDex Change-Id: I91da7116b779ae35c0617ef77dbcb9788902370c Merged-In: I91da7116b779ae35c0617ef77dbcb9788902370c (cherry picked from commit 53a87f523b75f86008c3e0971489a06a6450a670)
* Optionally embed NOTICE files in apks.Jaewoong Jung2019-06-251-10/+69
| | | | | | | | | | | | | If embed_notices or ALWAYS_EMBED_NOTICES is set, collect NOTICE files from all dependencies of the android_app, merge them with the app's own one (if exists), transform it to HTML, gzip it, and put it as an asset in the final APK output. Bug: 135460391 Test: app_test.go + Built Mainline modules Change-Id: I52d92e2fd19b3f5f396100424665c5cc344190d8 Merged-In: I52d92e2fd19b3f5f396100424665c5cc344190d8 (cherry picked from commit 5b425e2e20c55216c1ed13fcf047b0df33886736)
* Fix handling optimize.enabled from java_defaultsSasha Smundak2019-04-221-3/+3
| | | | | | | | | | | | | | | Some module types (`android_test`, etc.) set `optimize.enabled` by default. If such module happens to have `defaults` attribute which clears `optimize.enabled`, the latter value is ignored. Fixes: 129858282 Test: unit tests in java_test.go, `atest CtsExtendedMockingTestCases` succeeds with aog/936802 reverted (that is, with cts/test/mocking converted to Android.bp) Change-Id: Ib8e3a0ab0bd489d70ed07f626082aeae31c45e7c Merged-In: Ib8e3a0ab0bd489d70ed07f626082aeae31c45e7c (cherry picked from commit 2057f82161dec05cb23535da713ec0fae44c38d1)
* Always package JNI libs into android_test modulesColin Cross2019-03-271-1/+9
| | | | | | | | | android_test modules should always have native libraries packaged into the APK even when use_embedded_native_libs: false is set. Fixes: 129298278 Test: TestJNIPackaging Change-Id: Idfcc630f7c6579c1280a920b5d71808b0a502e06
* Add package_name property to android_app.Jaewoong Jung2019-03-261-4/+8
| | | | | | | | | This enables users to override the package name of their apps either directly in android_app or through override_android_app. Bug: 122957760 Test: app_test.go Change-Id: I98080a4076ce970fc85e58fc33495ba9b363eec9
* Add override_android_app module type.Jaewoong Jung2019-03-211-8/+41
| | | | | | | | | | | This is a new implementation of overriding module types that makes use of local variants. With this, product owners can use PRODUCT_PACKAGES to decide which override module to include in their products. Bug: 122957760 Bug: 123640028 Test: app_test.go Change-Id: Ie65e97f615d006b6e9475193b6017ea9d97e8e97
* Replace ctx.ExpandSources with android.PathsForModuleSrcColin Cross2019-03-201-1/+1
| | | | | | | | | | | Move the logic from ctx.ExpandSources into android.PathsForModuleSrc and ctx.ExpandSource into android.PathForModuleSrc, and deprecate them. When combined with the pathDepsMutator this will let all properties that take source paths also take filegroups or genrule outputs, as long as they are tagged with `android:"path"`. Test: All soong tests Change-Id: I01625e76b5da19240e9649bf26a014eeeafcab8f
* Support package_splitsColin Cross2019-03-191-3/+18
| | | | | | | | | | Pass the package_splits list from the property to aapt2 as --split arguments, sign the extra outputs, install them, and add them as extra output files for SourceFileProducer. Bug: 127921149 Test: TestAppSplits Change-Id: Id94a53ae6a8a68ec81e98abba2fefc9c23feaa7a
* Annotate paths and deprecate ExtractSource(s)DepsColin Cross2019-03-071-3/+0
| | | | | | | | | Add `android:"path"` to all properties that take paths to source files, and remove the calls to ExtractSource(s)Deps, the pathsDepsMutator will add the necessary SourceDepTag dependency. Test: All soong tests Change-Id: I488ba1a5d680aaa50b04fc38acf693e23c6d4d6d
* aapt2 flag for target manifest package overrideJaewoong Jung2019-02-281-0/+11
| | | | | | | | | | This change adds an aapt2 flag, rename-instrumentation-target-package, when an android test's instrumention target module's manifest package name is overridden. Bug: 122957760 Test: app_test.go, atest DocumentsUITests Change-Id: I7116a51ec5ec9d61a20cd28509b3af0e383730d7
* Revert "Add override_module."Jaewoong Jung2019-02-281-1/+1
| | | | | | | | This reverts commit aa65e17016152d0d73cd10ab3987bc3bd5c2ef91. Reason for revert: Not compatible with PRODUCT_PACKAGES, and so has very limited use. Change-Id: Ib141d3984a6f12bb50989e66037494c466b066f1
* Add override_module.Jaewoong Jung2019-02-271-1/+1
| | | | | | | | | | | This new module type replaces the inherit-package function in make by allowing developers to override the name, the certificate, and the manifest package name of an android_app module. Bug: 122957760 Fixes: 123640028 Test: app_test.go + BrowserGoogle Change-Id: Iefe447e7078b25039233221361ef95c83a29973a
* [SOONG] Not auto-generate test config if test_suite is ctsyangbill2019-02-191-1/+1
| | | | | | | | | | | | Current soong use source code's under cts as the rule for judgement. Should change to use test_suites define instead. Bug: 124313692 Test: m hello_world_test, make sure test config be auog-enerated. Modified platform_testing/tests/example/native/Android.bp m hello_world_test, make sure test config not be auto-generatetd. Change-Id: I1bc5216f73329d2a82d9ff29ccbede436dd2976c
* Set usesNonSdkApi in manifest when Platform_apis=trueDavid Brazdil2019-02-181-0/+2
| | | | | | | | | | | | | | | | The Platform_apis field in CompilerDeviceProperties currently has no effect. Unify the behaviour with make and run manifest_fixer.py to encode the information in the manifest. This is used to exempt bundled apps and platform tests from hidden API access checks without having a fixed whitelist of packages. Bug: 113315999 Bug: 124671117 Test: m UbSystemUiJankTests && \ aapt d xmltree \ target/product/taimen/data/app/UbSystemUiJankTests/UbSystemUiJankTests.apk \ AndroidManifest.xml | grep usesNonSdkApi Change-Id: I20c392d91ee6275ef8139fbeb5b9700385abbc80
* Add module type docs to the java packageColin Cross2019-02-131-0/+8
| | | | | | | | | Add some overview of the java module types so that we have something to display in the autogenerated docs. Bug: 67909957 Test: m soong_docs Change-Id: I3594dd550f8272f4418f3ea12cded4083674809b
* Revert "Revert "Never strip and store dex files uncompressed when they are ↵Nicolas Geoffray2019-02-131-3/+14
| | | | | | | | | | | preopted on system."" This reverts commit 67e8ec1973700bbdbc4cd68b3493d56d270ca377. Test: build && atest android.text.cts.EmojiTest#testEmojiGlyphWebView on Cuttlefish Exempt-From-Owner-Approval: Got +2 from Colin, latest PS is a rebase across conflicts. Change-Id: I99faf0f2ec698d70c107516bd43756b9ddcb90d0
* Add support for use_embedded_dex in SoongColin Cross2019-02-081-0/+9
| | | | | | | | | When use_embedded_dex is set, store the dex uncompressed in the APK and set the android:useEmbeddedDex="true" attribute in the manifest. Test: m checkbuild Change-Id: Iea6e7ed19599830ac72392ef93f9c98957df1cce
* Make manifest and APK agree on uncompressed native libsColin Cross2019-02-081-5/+21
| | | | | | | | | | | Only put uncompressed native libs in an APK if the min_sdk_version supports it (>= 23, Marshmallow), and set android:extractNativeLibs="false" in the AndroidManifest.xml so that the platform won't extract them anyways. Bug: 117618214 Test: m checkbuild Change-Id: I760017e48bf3c6b618aabde0982df45995765d48
* Export RRO resource dirs from static android_library dependenciesColin Cross2019-02-061-4/+0
| | | | | | | | | RRO dirs from static android_library dependencies should be included in the final module. Bug: 123510624 Test: TestEnforceRRO Change-Id: I28c45e139b187894a4ebc43d573eab5ea1be9861
* Remove empty DepsMutator methodsColin Cross2019-02-011-3/+0
| | | | | | | | Add an empty DepsMutator to ModuleBase so it doesn't have to be implemented on every module that doesn't need it. Test: all soong tests Change-Id: I545a832a0dbf27386d3080377a75ea482cd9ce59
* Add a prod var to override package names.Jaewoong Jung2019-01-251-5/+11
| | | | | | | | | | Currently only java/app.go is affected by package name overrides. When the var is used, the corresponding module's install APK name is changed to the overriding name. Bug: 122957760 Test: app_test.go + TreeHugger Change-Id: Ie522da3d7280970d740d779cf2694560feae6180
* Minor refactoring of generateAndroidBuildActions.Jaewoong Jung2019-01-241-14/+36
| | | | | | | | The function became a gigantic machine, so I decided to split it up to smaller, logically self-contained pieces to provide better readability. Test: app.go + TreeHugger Change-Id: I50e5767ed779078b2d8c60c39c3951b0b5a191d7
* Enable certificate overrides with product vars.Jaewoong Jung2019-01-241-2/+10
| | | | | | | | | | | Currently it is only for android_app, though it can be easily ported to apex. The make-side change will be made later, along with a real application. Bug: 122957760 Test: app_test.go Change-Id: I41f0be84f8b9f93e9518a16160e10eaa649388cd
* Minor code/comment cleanup for app.go.Jaewoong Jung2019-01-221-10/+8
| | | | | | | | | | | 1. We no longer need AndroidApp.extraLinkFlags. (https://r.android.com/c/platform/build/soong/+/691332) (https://r.android.com/c/platform/build/soong/+/792280) 2. Early break in the for loop to find --product flags. 3. Minor var name / comment updates for readability. Test: app.go / TreeHugger Change-Id: Iecea3e7cd319267c680422343ded5f7f8e69d0cd
* Use module name as intermediates name for android_app modulesColin Cross2019-01-171-1/+1
| | | | | | | | | Use foo.apk instead of package.apk for the intermediate package for a module named foo. Fixes: 122996822 Test: m checkbuild Change-Id: I38058a54038e1c2eeaefc0f0e7f450a74a3e96a7
* Check system certificate violation for product apksJeongik Cha2019-01-101-0/+14
| | | | | | | | | | Only if enforcement option is enable, it makes build error when there is apk located at system partition but signed with system certificate. Bug: 74699609 Test: m -j Change-Id: I23c41f2665dd97abac3e77d1c82d81ff91b894eb
* Add PRODUCT_MANIFEST_PACKAGE_NAME_OVERRIDESJiyong Park2019-01-091-0/+5
| | | | | | | | | | | | | | | | | | | | | It is a list of <module_name>:<manifest_name> pairs. When the module name of an APK or an APEX matches with <module_name>, then its app manifest name is overridden to <manifest_name>. <module_name> and <manifest_name> can be patterns as in com.android.%:com.mycompany.android.%.release Note that, in case of APEXes, the manifest name refers to the name of the zip container. The apex manifest name (which is specified in apex_manifest.json) is not overridden. Test: m with PRODUCT_MANIFEST_PACKAGE_NAME_OVERRIDES for 1) an APK in Android.mk 2) an APK in ANdroid.bp 3) an APEX and check that manifest names are modified as specified Change-Id: Ie58882d90884695e893944c43d9c8803b283e93d
* Remove duplicated shouldUncompressDex logicColin Cross2019-01-091-1/+0
| | | | | | | | | | | shouldUncompressDex has already been computed and stored in deviceProperties.UncompressDex, pass it to dexpreopter instead of recomputing it. Also add a stub for java libraries to set UncompressDex. Test: no change to build.ninja Change-Id: I663d9fbbe768a8dc9a97c7d456dd7a010f43162d
* Dexpreopt soong modules inside soongColin Cross2018-12-151-44/+28
| | | | | | | | | | | | | | | | | | | | | | | Port the dexpreopt logic from Make to the dexpreopt package in Soong, and use it to dexpreopt Soong modules. The same package is also compiled into the dexpreopt_gen binary to generate dexpreopt scripts for Make modules. This relands Ib67e2febf9ed921f06e8a86b9ec945c80dff35eb and I462182638bd57b1367b5bfb0718e975c11ae66f7, along with multiple fixes to depsfile generation in dexpreopt_gen that caused .odex files for modules in defined make to be missing dependencies on boot.art, and a fix to not dexpreopt and strip tests. Bug: 119412419 Bug: 120273280 Test: no differences to dexpreopt outputs on aosp_sailfish system/, only expected changes to dexpreopt outputs on system_other (.vdex files for privileged Soong modules no longer incorrectly contain .dex contents). Test: OUT_DIR=$PWD/out m Test: NINJA_ARGS="-t deps out/target/product/sailfish/obj/APPS/Contacts_intermediates/dexpreopt.zip" m Change-Id: I6bb2c971cee65d2338839753aa0d84939f335b1b
* Revert "Dexpreopt soong modules inside soong"Colin Cross2018-12-141-25/+39
| | | | | | | This reverts commit 29ff88741e710b05743dcf347484c31311e81cda. Test: none Bug: 119412419
* Dexpreopt soong modules inside soongColin Cross2018-12-131-39/+25
| | | | | | | | | | | | | | | Port the dexpreopt logic from Make to the dexpreopt package in Soong, and use it to dexpreopt Soong modules. The same package is also compiled into the dexpreopt_gen binary to generate dexpreopt scripts for Make modules. Bug: 119412419 Bug: 120273280 Test: no differences to dexpreopt outputs on aosp_sailfish system/, only expected changes to dexpreopt outputs on system_other (.vdex files for privileged Soong modules no longer incorrectly contain .dex contents). Change-Id: Ib67e2febf9ed921f06e8a86b9ec945c80dff35eb
* Create bundle modules suitable for bundletoolColin Cross2018-10-311-0/+6
| | | | | | | | | | | Create a bundle module in addition to creating an APK, which can then optionally be merged with bundle modules from builds for other architectures and then be passed to bundletool to create an app bundle. Bug: 117295826 Test: tapas RecoveryLocalizer && m dist Change-Id: I98a17d7407dc56823ece9ec88c087780185a6555
* APEXs are signed with apk signerJiyong Park2018-10-311-12/+12
| | | | | | | | | | | | | The entire APEX (which is a zip file) is signed with the apk signer. Certificate can be specified via the 'certificate' property just like ordinary apps. Note: multiple additional certificates are not supported. Bug: 115721587 Test: m apex.test Test: jarsigner -verify -verbose -certs .../apex.test.apex shows the certificate info Change-Id: Ia4c898d3427779a3809fdc683b85d7661ca65137
* Add `aapt_include_all_resources`Dan Willemsen2018-10-291-7/+9
| | | | | | | The equivalent of Make's LOCAL_AAPT_INCLUDE_ALL_RESOURCES. Test: build LatinIME with Soong Change-Id: Ib76bea5f28e365b59fa9477b9bceabb84012ff8e
* Don't strip soong APKsColin Cross2018-10-291-1/+3
| | | | | | | | | APKs that are preopted to system_other should not be stripped. For now, don't strip any APKs. Bug: 118592830 Test: m PrintSpooler; zipinfo $OUT/system/app/PrintSpooler.apk | grep classes.dex Change-Id: Ife8a5fe4ff90e5e00ec24f43e089d9b3aa552fc0
* Store dex files uncompressed and unstripped in privileged APKsColin Cross2018-10-251-4/+50
| | | | | | | | | | | Privileged APKs need to store their dex files uncompressed so they can be verified and mapped directly out of the APK. Also track whether the module will be dexpreopted or not in order to determine if the dex file should be stripped before signing. Test: SystemUI.apk contains an uncompressed dex file Change-Id: I4dca86c7f8778595882405b34adcf2a7bae03c67
* Fix instrumentation_for to match LOCAL_INSTRUMENTATION_FORColin Cross2018-10-181-6/+6
| | | | | | | | | | | | | | | The value from instrumentation_for should not go to aapt2 link --rename-instrumentation-target-package, that should be the equivalent of LOCAL_MANIFEST_INSTRUMENTATION_FOR. That property is never used in Make, so it is left unimplemented in Soong. Add the module listed in instrumentation_for as a shared library for javac, but don't import its resources. Bug: 117804211 Test: m checkbuild Change-Id: I7f035dc0ecb964a3ca391ae1ca2b87cb0f6a7cec
* Add android_test_helper_appColin Cross2018-10-081-0/+34
| | | | | | | | | Add a module that can build an APK that will be used by a test. The APK will be sideloadable, and can be added to a test suite, but will not autogenerate a test config file. Test: m checkbuild Change-Id: Idf325b1c9a2cbcd16b126da3331671e4aed4b3da