Commit graph

81 commits

Author SHA1 Message Date
Colin Cross
93ff702df2 Don't build automatic RROs for tests
Automatic RROs don't make sense for tests, the tests can't rely on
overlays being installed on product or vendor.  Creating the RROs
causes a race during builds that build both droid and device-tests
goals, as the RROs may be installed to the vendor directory as a
dependency of the device-tests goal before or after the vendor image
is packaged as a dependency of the droid goal.  If the RROs are
installed first and the vendor image is low on space it may result
in an out-of-space error.

Bug: 282885159
Test: Rule to build $OUT/vendor/overlay/SystemUITests__*__auto_generated_rro_vendor.apk no longer exists
Change-Id: I760355ffb1818e91c02a98473312f9f21c149361
Merged-In: I760355ffb1818e91c02a98473312f9f21c149361
2023-05-18 03:14:01 +00:00
Wei Li
15187b6f1a Merge "Generate SBOM of the target product in file sbom.spdx.json in product out directory." 2023-03-15 05:20:44 +00:00
Wei Li
499333616c Generate SBOM of the target product in file sbom.spdx.json in product out directory.
Original aosp/2374663 was reverted, so this change cnotains the implementation but disabled by default and SBOM will not be built by default with "m dist".

The feature will be enabled later in small CLs after running tests successfully in forrest.

Test: m sbom
Test: m dist
Test: on aosp, lunch aosp_bluejay-userdebug && m dist
Bug: 266726655
Change-Id: I926d0f97f3a0330ef61d059f12ea660005d370e6
2023-03-14 15:14:06 -07:00
Kevin Han
afb2495f6f Merge "Revert "Generate SBOM of the target product in file sbom.spdx in..."" 2023-03-13 21:03:22 +00:00
Kevin Han
161d711d4d Revert "Generate SBOM of the target product in file sbom.spdx in..."
Revert submission 2481062-sbom

Reason for revert: b/273332655

Reverted changes: /q/submissionid:2481062-sbom

Change-Id: Ie8a73d8dc50592204acd489482e0e9d96ffbd5df
2023-03-13 20:57:37 +00:00
Wei Li
27d32b0957 Merge "Generate SBOM of the target product in file sbom.spdx in product out directory." 2023-03-13 17:43:59 +00:00
Wei Li
88ac7ae7df Generate SBOM of the target product in file sbom.spdx in product out directory.
Original aosp/2374663 was reverted, try to submit it again with some fixes in this.

Test: m sbom
Test: m dist
Test: on aosp, lunch aosp_bluejay-userdebug && m dist
Bug: 266726655
Change-Id: Icf305770473f0c448a1ad721cbe7addf737115e4
2023-03-13 17:38:04 +00:00
Cole Faust
a5511ea91a Don't install jni libs for uninstallable modules
Bug: 254205429
Test: Presubmits
Change-Id: I6eec24f17bfeac0179558356e07a13dfb071a2bb
2023-03-10 12:30:12 -08:00
Iván Budnik
4616ec7eb7 Revert "Don't install jni libs for uninstallable modules"
Revert submission 2462194-androidmk_for_apex_dependencies

Reason for revert: DroidMonitor-triggered revert due to breakage https://android-build.googleplex.com/builds/quarterdeck?branch=aosp-master&target=full-eng&lkgb=9723453&lkbb=9724944&fkbb=9723508, bug b/272663333.

Reverted changes: /q/submissionid:2462194-androidmk_for_apex_dependencies

Bug: 272663333
Change-Id: Iecf99713133b2bc8f35614b6b9596422dc051198
2023-03-10 16:11:31 +00:00
Cole Faust
a3763c18ef Don't install jni libs for uninstallable modules
Bug: 254205429
Test: Presubmits
Change-Id: I6739b71ce4a0141ad39d4b6046ae63c4c12e367d
2023-02-28 18:10:23 -08:00
Jihoon Kang
d203e12f20 Create partition-specific symlink for jnilib install
Context
- Currently, unembedded JNI libraries are being installed from a symlink based on an android_app's partition.
- Unembedded JNI library may exist in a different partition from that of the app module, thus create a symlink based on the partition of each jni libraries.
- Scope of this change is limited to bp modules, and does not affect mk modules.

Implementation
- Use the JNI library name:partition mapping from LOCAL_SOONG_JNI_LIBS_PARTITION_<target> to create a symlink.

Bug: 154162945
Test: m
Change-Id: Ie9396e0eb1c5bfc5855a2a84db395a2b9008b17b
2022-09-07 17:35:29 +00:00
Colin Cross
ac7febc9c7 Revert "Revert "Produce mappings of hashes to elf symbols and r8 dictionaries""
This reverts commit 59ecb9e016.

Reason for revert: symbols_map is fixed to ignore non-elf files

Bug: 218888599
Change-Id: I88654b2dba3dfb9ab2809b0555544277279f345d
2022-04-06 01:11:20 +00:00
Colin Cross
59ecb9e016 Revert "Produce mappings of hashes to elf symbols and r8 dictionaries"
This reverts commit 3570b3ed86.

Reason for revert: b/228195288

Bug: 218888599
Change-Id: I17b38ca1b6f8940d682f2782515bfd5f8db1ce58
2022-04-05 17:47:27 +00:00
Colin Cross
3570b3ed86 Produce mappings of hashes to elf symbols and r8 dictionaries
Run the symbols_map tool on each unstripped binary and proguard
dictionary while copying it to produce a textproto that maps the
hash to the symbol/dictionary file location.  Combine the textprotos
into a mapping file when producing the zipped build artifacts.

Bug: 218888599
Test: m dist
Change-Id: I78997e2f3b631ed74213903cc8e72415b2d7eee0
2022-04-04 16:04:52 -07:00
Colin Cross
143af9284f Remove duplicate includes of BUILD_NOTICE_FILE
Some module types include BUILD_NOTICE_FILE a second time after
the include from base_rules.mk.  This won't work after a future
change, and doesn't seem to be necessary as none of the files
leave any modified LOCAL* variables in place for notice_files.mk
to read.

Bug: 207445310
Test: m checkbuild
Change-Id: I8c68888d6bf26926f5c2216abe147ccf28ddc2b8
2021-11-30 13:20:01 -08:00
Colin Cross
47cfffea79 Move java install rules into Soong
Remove the copy rules for LOCAL_SOONG_BUILT_INSTALLED, they will already
be created by Soong.

Also clean the soong host tools directory to remove any old copies of
java binaries.

Bug: 204136549
Test: m checkbuild
Change-Id: Ib6b5362ad59aa48770e48541430d6857846926c2
2021-11-08 15:23:32 -08:00
Colin Cross
fd54f03d1b Use the Soong output as the checkbuild target
Save disk space when building checkbuild by avoiding copying the Soong
output file into the Make intermediates directory.

All the same files in out/soong that were created by m checkbuild before
this patch are still created after this patch.  In the internal branch
the total size of the out directory after m checkbuild is reduced from
1320 GB to 965 GB.

Bug: 201816050
Test: m checkbuild
Change-Id: I6370df44f9baab00fcfe30c072600fe58109954d
2021-10-09 13:33:40 -07:00
Bob Badour
58c4535b7e Re-call BUILD_NOTICE_FILE for modules that add deps
The normal pattern is:

1. Set a bunch of variables like LOCAL_MODULE
2. Include a makefile specific to the module type
3. The included file in turn includes base_rules.mk
4. At the end of base_rules.mk, it include notice_files.mk
5. The included file declares a build rule and finishes.

The below files included for some module types add additional
dependencies after returning from base_rules.mk, which are not
reflected in the notice files.

Including notice_files.mk a 2nd time adds these dependencies.

Bug: 68860345
Bug: 151177513
Bug: 151953481

Test: m all
Test: m systemlicense

Change-Id: I030399ffb13a2cfb58cf583ae5a2e418f5dbc534
2021-09-09 20:09:13 +00:00
Colin Cross
db98001be1 Use order-only dependencies for symbols files
Use an order-only dependency from $(LOCAL_BUILT_MODULE) to the symbols
file so that wiping the symbols directory during installclean doesn't
force anything to rebuild.

Bug: 186507256
Test: m && rm -rf $OUT/symbols && m
Change-Id: Ic164819c71f9db6126ff91c58752c8727cde0d5e
2021-04-27 19:43:33 -07:00
Treehugger Robot
6edaa353b1 Merge "Store dexpreopt.config files to dexpreopt_config.zip" 2021-04-23 06:47:57 +00:00
Jeongik Cha
a8056d6cb9 Store dexpreopt.config files to dexpreopt_config.zip
To dexpreopt in post processing, store config files for dexpreopt

Bug: 158843648
Test: m dist and check dexpreopt_config.zip
Change-Id: I5c63a5ffc10023994b14e3a63f50defb9194739f
2021-04-23 01:01:31 +00:00
Colin Cross
330b1fef31 Package jacoco and proguard files out of a PACKAGING directory
Package jacoco-report-classes.jar, proguard_usage.zip and
proguard_dictionary out of directories in $OUT/obj/PACKAGING
so that they get cleared by m installclean.  This will make
incremental builds that package these files accurate as long
as installclean was run, which is much faster than a full clean
build.

Bug: 184583915
Test: m TARGET_BUILD_APPS=DeskClock EMMA_INSTRUMENT=true dist
Change-Id: I60c6a0fec1fbce26eab8d5adab25a2231b48e251
2021-04-07 18:52:02 -07:00
Colin Cross
a9b9e6e5ff Merged and dist lists of unused methods from R8
Merge all the proguard_usage.zip files produced by the R8 rules and
dist the result.

Bug: 151857441
Test: m TARGET_BUILD_APPS=DocumentsUI dist
Change-Id: I7e6d73241478016093a203dc7bd86407ab86a4ac
2020-08-17 19:31:22 +00:00
Dan Willemsen
a3f6632de9 Remove obsolete PDK build functionality
This hasn't worked for a couple years, and continues to bitrot. Just
remove it.

Test: treehugger
Change-Id: Iea6caf3c08252a560155e095135c5ddaad712991
Merged-In: Iea6caf3c08252a560155e095135c5ddaad712991
2020-08-11 01:12:01 +00:00
Colin Cross
d56abedb02 Merge "Dist lint reports for apps" 2020-07-16 23:06:22 +00:00
Colin Cross
b842952421 Dist lint reports for apps
Dist the transitive lint report for each unbundled app built by Soong
when lint-check is on the command line.

Bug: 153485543
Test: m TARGET_BUILD_APPS=Gallery2 lint-check dist
Change-Id: Icd2b6f884396fa5f743746099301c325ca82a324
2020-07-10 16:41:10 -07:00
Colin Cross
e926cab372 Install symbols for JNI libraries
When building an app in Soong with JNI libraries copy the unstripped
libraries to the symbols directory in directory that matches the
installed path of the APK.

Bug: 159726429
Test: forrest
Change-Id: If8e423c7cdf3afd518761b5ab6bc857321acda46
2020-07-10 13:44:21 -07:00
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