Commit Graph

54 Commits

Author SHA1 Message Date
Dan Willemsen fd1e67b8ce More performance improvements
Instead of using `x := $(x) foo`, make sure `x` is initialized first,
then use `x += foo`.

For a aosp-master/aosp_crosshatch-userdebug build, this takes the build
from 49s to 33s (no significant difference in peak memory)

Bug: 158488548
Test: build-aosp_crosshatch.ninja is the same before/after
Change-Id: I41fb7611030dd3ba824f896a9c9eadbdd218f464
2020-06-08 19:10:23 -07:00
Yo Chiang 5814247ed2 Access ALL_MODULES subvars with my_register_name
ALL_MODULES and subvars are registered with my_register_name.
Replace references of ALL_MODULES.$(LOCAL_MODULE).* with
ALL_MODULES.$(my_register_name).*.

Bug: 155869107
Test: TH presubmit build pass
Test: TH presubmit build noop
Change-Id: I1481c341a285dc04de86619abec3194bb92c9739
2020-05-14 04:08:42 +00:00
Jaewoong Jung c8faeb574c Install .idsig files to test suite dirs.
(This is a cherry-pick change.)

Bug: 153675112
Test: m cts && ls out/host/linux-x86/cts/android-cts/testcases/
Change-Id: I2f24f4567ed3fab1f6ad4d66cc0f798332543b8d
Merged-In: I2f24f4567ed3fab1f6ad4d66cc0f798332543b8d
2020-05-07 11:54:22 -07:00
Jiyong Park 7b96c59751 Stem names are used in apkcerts.txt
_apkcerts_write_line has assumed that the stem name of a package is the
same as the module of it. That assumption however breaks for
APK-in-APEX, in which case the stem name is Foo while the module name is
Foo.com.android.bar (where com.android.bar is the name of the APEX where
the APK is in).

Fixing the issue by recording the stem name and use it.

Bug: 155440232
Test: OVERRIDE_TARGET_FLATTEN_APEX=true m apkcerts-list
and check the generat4ed apkcerts txt file to see that it has
Tethering.apk instead of Tethering.com.android.tethering.apex

Exempt-From-Owner-Approval: cherry-pick from AOSP

Merged-In: I56bc55e2231eb946617a9d6f97d55c9b61f3bff7
(cherry picked from commit f58fd52b14)
Change-Id: I56bc55e2231eb946617a9d6f97d55c9b61f3bff7
2020-05-02 18:29:24 +09:00
Bill Peckham 19c3feb2d3 Build merged apexkeys.txt/apkcerts.txt by partition.
Propagate partition tag data to apexkeys.txt and
apkcerts.txt so that merge_target_files.py can build
merged versions of these files by filtering the
framework files for framework partitions and filtering
the vendor files for vendor partitions.

Bug: 138942268
Change-Id: Ic3226728e97dae84d38ec230ccc86d1b124bea94
2020-03-30 22:33:27 +00:00
Jaewoong Jung e66eaf3602 Install JNI coverage outputs from Soong-built apps
Test: Built mainline module coverage data
Bug: 152117890
Change-Id: Ibb809c3e8b599b467c7176e750e0b78a5bfee38e
2020-03-27 01:39:06 +00:00
Colin Cross 24c77395be Enforce LOCAL_CERTIFICATE is set in soong_app_prebuilt.mk
Missing LOCAL_CERTIFICATE produces an apkcerts.txt file that
has no key for the APK, which confuses the signing tools.
Enforce that it is set.

Bug: 147765187
Test: m apkcerts-list
Change-Id: I1299505d193deba5956954e5d9b6e4c727456b9c
2020-01-28 14:13:52 -08:00
Colin Cross 8e28a17bfe Add Soong android_app and android_test modules to javac-check
android_app and android_test modules were not built as part of
javac-check, which resulted in not running them in the Error Prone
build.

Fixes: 146455923
Test: m RUN_ERROR_PRONE=true javac-check
Change-Id: I278d7ee0cdc3f49aa8fa4d4f13309e29d700f2ba
2019-12-30 22:08:07 -08:00
Jaewoong Jung 8bc6908feb Copy additional test apk outputs to suite dirs.
Bug: 143902486
Test: m CtsIsolatedSplitApp
Change-Id: I13900ac2c8bb886987362dd380818ab5df2f23c6
2019-11-21 10:36:28 -08:00
Nicolas Geoffray 2ca0e49f61 Remove support for stripping dex.
Stripping is incompatible with ART module updatability.

Bug: 65154345
Bug: 138851227

Test: build and observe no change in output (stripping is not used by
default).

Change-Id: Ic2d9738ef393814c3af3cad116071f7b5938aa84
2019-10-21 09:36:45 +01:00
Justin Yun 6151e3f1ea Rename product_services to system_ext
Bug: 134359158
Test: build and check if system_ext.img is created
Change-Id: I67f2e95dd29eac6a28e07e24ea973d3a134c3bfc
2019-07-09 08:57:19 +00:00
Treehugger Robot d4079c5019 Merge "Support PRESIGNED in soong_app_prebuilt.mk" 2019-05-04 00:22:29 +00:00
Colin Cross e6210f6eb2 Remove AAPT1 support
AAPT2 is used everywhere now, remove support for AAPT1.  Also
removes dpi_specific_apk.mk, it was never updated to use AAPT2
and has been generating bad APKs (resource ID mismatch between
the dex files and the resources) since AAPT2 was made the default
in May 2018 (I9b67fd2a9b3234798b2aac879b5242c2097b3863).

Bug: 80450981
Test: m checkbuild
Change-Id: I2ff768897360ff866dbae5562455bab22be270f7
Merged-In: I2ff768897360ff866dbae5562455bab22be270f7
2019-04-17 16:50:30 -07:00
Anton Hansson cb8276fa93 Put DEVICE/PRODUCT overlays in different partitions
This change changes auto-generated RROs from DEVICE_PACKAGE_OVERLAYS
to be generated in the vendor partition, as opposed to /product where
they were generated in the past.

Note that PRODUCT_PACKAGE_OVERLAYS continue generating RRO packages
to /product, which means that a single app can be overlayed from
different partitions. These RROs have been given module and package
names based on their location.

Bug: 127758779
Test: verify noop on presubmit targets
Change-Id: I5cee70e28e3969e67b2d83eaf25d9c6e3a11102d
2019-03-22 13:25:20 +00:00
Colin Cross 74889a1681 Support PRESIGNED in soong_app_prebuilt.mk
app_import support in Soong will require support for PRESIGNED.

Test: not yet
Change-Id: I436e41358b6a1ee2895ecaa9769e96cbf0714a2f
2019-03-21 15:46:25 -07:00
Anton Hansson dc017122fb Read product/device RRO dirs separately from soong
This change splits the LOCAL_SOONG_RRO_DIRS into two,
representing RRO dirs that originated from device and
product overlay configs, respectively.

Also plumb the device/product configs in separately.

Bug: 127758779
Test: verify noop on presubmit targets
Change-Id: Iddee1b4d7303b7ecaeced91216ea82fe29123770
2019-03-18 19:39:51 +00:00
Luca Stefani fb3e985a5f Remove extra $ in soong_app_prebuilt
Change-Id: Ia21d8f7fb3fd5f9e3b8e764d42ebbc61be4226f7
2019-02-06 17:54:21 +01:00
Treehugger Robot 61ae763ec4 Merge "Remove dependencies on hiddenapi files with UNSAFE_DISABLE_HIDDENAPI_FLAGS=true" 2019-01-31 19:25:59 +00:00
Anton Hansson bb83cc2689 Merge "Fix RRO when LOCAL_EXPORT_PACKAGE_RESOURCES is unset" 2019-01-30 22:19:25 +00:00
Treehugger Robot badde7ced7 Merge changes I0bee792d,I2b7c3c8f
* changes:
  Build aar files for m <module name>
  Add LOCAL_ADDITIONAL_CHECKED_MODULE
2019-01-30 18:26:24 +00:00
Colin Cross 89d3d2ae3b Fix RRO when LOCAL_EXPORT_PACKAGE_RESOURCES is unset
If LOCAL_EXPORT_PACKAGE_RESOURCES is unset then
append_enforce_rro_sources was inserting a blank entry into
the 4th.  When converting the || separator back to space that
resulted in a two sequential spaces, which is treated as a
single word separator, causing the 5th field to be treated
as the 4th field.

Put "false" into the 4th field in soong_app_prebuilt.mk to match
package_internal.mk.

Bug: 123510624
Test: m SystemUIGoogle
Change-Id: I794c413e33df2020d0dc43379cfb017e7e09baa1
2019-01-30 16:09:41 +00:00
Colin Cross cd6622e832 Build soong odex files for mma
Add the LOCAL_SOONG_BUILD_INSTALLED files as dependencies of
$(my_all_targets) instead of $(my_register_name) so they are built
for mma and mmma as well as m <module name>.

Fixes: 123262430
Test: mmma packages/apps/Gallery2
Change-Id: I0d55beccf9385144c190ea4bf099fb267ac6db1c
2019-01-30 00:35:34 +00:00
Colin Cross bd2287b846 Build aar files for m <module name>
Test: m SystemUI-core
Change-Id: I0bee792d1af80abb3e74c278db488bd668bd1fb4
2019-01-29 15:12:17 -08:00
Adrian Roos 21028b7ad6 Remove dependencies on hiddenapi files with UNSAFE_DISABLE_HIDDENAPI_FLAGS=true
Fixes: 122957987
Test: UNSAFE_DISABLE_HIDDENAPI_FLAGS=true make droid
Change-Id: Iafef8cc69971fd10718882326fbba99a6223d0f8
2019-01-25 17:35:25 +01:00
Jeongik Cha 83c50324ca Define non-system module as variable
Define non_system_module in base_rules.mk when the module is product, vendor,
product_services or proprietary module.

Bug: 74699609

Test: m -j
Change-Id: Iebdd3ec8c643be3d9877b7a96cbdd83465fa3878
2019-01-18 18:24:30 +09:00
Colin Cross 83b7bdf765 Simplify soong_java_prebuilt.mk and soong_app_prebuilt.mk
Simplify importing Soong modules into Make by always copying
LOCAL_PREBUILT_MODULE_FILE to LOCAL_BUILT_MODULE, which lets
Soong pick the final output file instead of trying to figure
out which of the various intermediate files should be the
output file.

Also fixes an issue where hostdex modules could attempt to
copy to both $(common_javalib.jar) and $(LOCAL_BUILT_MODULE),
which are the same file for host java modules.

Test: set compile_dex:true on core.platform.api.stubs. no warnings
      of target overriding
Test: m checkbuild

Change-Id: I2e089012436fe8649db82a673d446d1c5a73a731
2019-01-17 10:23:06 -08:00
Jeongik Cha f712ce79f5 Execute appcompat for apps built from soong
Appcompat runs for app defined in Android.mk, but not in Android.bp
So make appcompat run for app from soong(Android.bp)

Bug: 110073830
Bug: 122026042

Test: m out/target/product/$(get_build_var TARGET_DEVICE)/appcompat.zip

Change-Id: I73832410ec5850222b04086c2a377146886ba035
2019-01-16 14:27:21 +09:00
Colin Cross 5d196364e1 Revert "Simplify soong_java_prebuilt.mk and soong_app_prebuilt.mk"
This reverts commit a76cc6d732.

Reason for revert: broke emma turbine build

Change-Id: Ie894565501d0de44f96dc736408a8c4e2ba2ed90
2019-01-16 01:38:41 +00:00
Colin Cross a76cc6d732 Simplify soong_java_prebuilt.mk and soong_app_prebuilt.mk
Simplify importing Soong modules into Make by always copying
LOCAL_PREBUILT_MODULE_FILE to LOCAL_BUILT_MODULE, which lets
Soong pick the final output file instead of trying to figure
out which of the various intermediate files should be the
output file.

Also fixes an issue where hostdex modules could attempt to
copy to both $(common_javalib.jar) and $(LOCAL_BUILT_MODULE),
which are the same file for host java modules.

Test: set compile_dex:true on core.platform.api.stubs. no warnings
      of target overriding
Test: m checkbuild

Change-Id: Id84d499a0869961be5a906d8472b75b9c843b4b4
2019-01-15 10:16:55 -08:00
Jeongik Cha b2c4bb7e3d Dump and enforce certificate for apks
Dump the list of APKs that aren't located at system partition and signed
with system certificate.
And when enforcement option is enabled, it makes build error if there is
the apk that satisfies the condition above.

Bug: 74699609

Test: m -j
Test: m out/target/product/$(get_build_var TARGET_DEVICE)/certificate_violation_modules.txt

Change-Id: I23c41f2665dd97abac3e77d1c82d81ff91b894eb
2019-01-10 11:37:22 +09:00
Colin Cross 6db5b0ea9a Move dexpreopting to Soong
Move the dexpreopting logic into Soong.  Make modules will be
dexpreopted by executing the Soong logic in the standalone
dexpreopt_gen binary, which will generate scripts that will
perform dexpreopting for each module.  Export global configuration
as JSON to $OUT/dexpreopt.config, which will be used by
dexpreopt_gen and Soong, and per-module JSON configuration that
will be used by dexpreopt_gen.

This relands I59b20c931ee3e5a8d35eb30da4148691c5095502,
I39d580999947ee54cfefe875b57a028be5333bd7,
Ie7daa94e107d53eff075ca58dbe721bd9d7fc8c2 and
Ica006a007d112c232311435aaac0c0e476232b67, with a minor
update to match the changes made to dexpreopt_gen arguments
and a fix to correctly keep dexpreopt disabled on mac builds.

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: I25163e91886cea6941afa25cdb529ed053278dcb
2018-12-17 13:46:17 -08:00
Colin Cross b8901d7fb8 Revert "Move dexpreopting to Soong"
This reverts commit e736c58043.

Test: none
Bug: 119412419
2018-12-14 11:49:55 -08:00
Colin Cross e736c58043 Move dexpreopting to Soong
Move the dexpreopting logic into Soong.  Make modules will be
dexpreopted by executing the Soong logic in the standalone
dexpreopt_gen binary, which will generate scripts that will
perform dexpreopting for each module.  Export global configuration
as JSON to $OUT/dexpreopt.config, which will be used by
dexpreopt_gen and Soong, and per-module JSON configuration that
will be used by dexpreopt_gen.

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: I59b20c931ee3e5a8d35eb30da4148691c5095502
2018-12-12 17:21:22 -08:00
Nicolas Geoffray ed167cf814 Factor out common code.
Test: m
Change-Id: If718c281656a890fb5eba54eb290976c153e2bb6
2018-12-07 14:35:52 +00:00
Nicolas Geoffray d80f9c0d32 Use the final APK for dexpreopt when it's not stripped.
The final APK may contain compressed or uncompressed dex files,
and this affects dex2oat compilation.

Test: build sailfish, test that SystemUI.vdex and Settings.vdex
don't have the dex code.

Change-Id: Ic032f61ed67dcdf342f6eaef71d805b89d6fc99a
2018-12-07 00:19:57 +00:00
Colin Cross 0fb8c97b02 Dist bundle modules from Soong
Dist bundle modules when requested by TARGET_BUILD_APPS.

Bug: 117295826
Test: tapas RecoveryLocalizer && m dist
Change-Id: Iad63ceafc2a60e6735b50eca65cc4859f9d71b52
2018-10-30 15:47:59 -07:00
Colin Cross fc782ad949 Reduce the propagation of LOCAL_DEX_PREOPT := nostripping
nostripping causes confusing double negatives, allow nostripping
in LOCAL_DEX_PREOPT and DEFAULT_DEX_PREOPT, but convert to
LOCAL_STRIP_DEX outside of dex_preopt_odex_install.mk.

Test: m checkbuild
Change-Id: I996e9258ce20c394900d9fe937d638bc2ab8589d
2018-10-23 22:33:07 -07:00
Colin Cross 0fa751ba68 Add support for JNI libraries to soong_app_prebuilt.mk
Use install_jni_libs_internal.mk to install JNI libraries alongside
preinstalled APKs.  APKs with embedded JNI libraries are handled
within Soong.

Bug: 80095087
Test: m checkbuild
Change-Id: I2ecf10b6771dff14c940cc6e6442eb2ae43a75b0
2018-10-04 11:24:15 -07:00
Colin Cross 53c8f9789a Fix PDK builds
$OUT/obj/APPS/SystemUI_intermediates/package.dex.apk was not being
written after being converted to Soong.  Add a copy rule for it
to soong_app_prebuilt.mk, add it as an implicit output to the Make
rules that create it, and add it as a real dependency to the
platform.zip rules.

Test: m platform
Change-Id: I96f58d3d80b764a51a6acb87e92498589cfe5c18
2018-09-29 22:33:41 -07:00
Colin Cross 1fe104cc13 Fix preopting Soong apps
dex_preopt_odex_install.mk should always be included, it handles
setting a default value for LOCAL_DEX_PREOPT.
Use dexpreopt-copy-jar when preopting to strip the dex file if
necessary.

Bug: 115967961
Test: m SystemUI
Change-Id: I74f77ed0e88a67043836407261f3845a16cbaf37
2018-09-18 10:16:37 -07:00
Colin Cross 7a504334cd Fix java soong_to_convert data
soong_to_convert looks for modules with no unconverted deps, but
the list of converted modules was not being updated for java and
app prebuilts.  That meant soong_to_convert only reported modules
with no deps at all.

Test: examine soong_to_convert.txt
Change-Id: I136e6fa74153a80df5ecd767642bb2feb2ddb9dc
2018-08-16 22:55:43 -07:00
Jason Monk 87eb791c4f Adding overrides support to android_app bps
Test: build
Change-Id: I7910d042c6e7f8ac9c77e294aca11b01713d0fef
2018-08-10 13:38:57 -04:00
Treehugger Robot 0b4b321565 Merge "Remove unnecessary link-type check" 2018-03-09 00:21:21 +00:00
Jiyong Park 98a4f52c28 Remove unnecessary link-type check
Modules from Soong do not have dependency specified (via
LOCAL_JAVA_LIBRARIES). So, link-type check 'from' them doesn't make
sense. Resetting my_warn_types and my_allowed_types

Bug: 69899800
Test: m -j checkbuild on aosp_walleye, aosp_sailfish
Test: build/soong/build_test.bash --dist
Change-Id: I2a409e64f388bd8cb9336be589bf6af33e48a6f4
2018-03-08 15:23:08 +09:00
Colin Cross 7874138a8a Allow soong java libraries to include exported resources and proguard flags
Test: m checkbuild
Change-Id: Ia02f816084d0eb1c0e0f20e1ecd57aaf3778874c
2018-03-07 09:48:33 -08:00
Nan Zhang 78c19aa9ef Fix the incorrect turbine flag.
Test: m -j java TURBINE_ENABLED=false
Change-Id: Id6ca380c97bbcd3731c815e37513b7e949cccdfb
2018-03-05 13:35:45 -08:00
Jiyong Park 5ebca30d21 Support LOCAL_SDK_VERSION := core_current
core_current is a pseudo SDK version which is a core Java API subset of
the Android API. It is expected to be mainly used for external Java
projects which are agnostic to Android; such as junit, guava, etc.

A module built with this SDK version can only link to java modules of
the same kind. It can't depend on modules built with LOCAL_SDK_VERSION
:= current or without LOCAL_SDK_VERSION.

Bug: 72206056
Test: m -j
Change-Id: I34a9696393aa6704fd6684a40ea5b05d3fb46b23
2018-02-01 17:14:55 +09:00
Colin Cross 5e0986cb51 Add R8 support to Soong.
Move R8_COMPAT_PROGUARD definition to Soong.
Copy the proguard_dictionary file so that the find
command that builds proguard_dict.zip can find it.

Test: m checkbuild
Change-Id: I28b2fce26ccb6225be0bd71802a43fe63df85daa
2018-01-03 14:21:35 -08:00
Colin Cross 20e06d25ac Fix dependency on Soong jacoco report classes
The dependency on the Soong jacoco report classes was mistakenly
using $(common_javalib.jar) which was never set, so was using
the value from the last module.  Use $(LOCAL_BUILT_MODULE)
instead.

Test: m checkbuild
Change-Id: If502d67f9e5e0c107de44e96cbf232406c027e44
2018-01-03 14:21:35 -08:00
Colin Cross 4e34ce054c Fix swapped certificate and private key in soong apps
The .x509.pem file should be in CERTIFICATE, and the .pk8 file
in PRIVATE_KEY.

Bug: 70669383
Test: examine apkcerts.txt
Change-Id: I480f19be2efbbd72ea23ebd681f312b94accfd7a
2017-12-15 13:41:24 -08:00