Commit graph

1696 commits

Author SHA1 Message Date
Yumi Yukimura
f84254ef1b
build: Add phony package to build enforce RRO packages
This allows one to build *__auto_generated_rro_(product|vendor).apk
under $(PRODUCT_OUT)/(product|vendor)/overlay/ without having to
build the full partition image or do full android build.

Change-Id: I0c215ed7968e0cba348d344e00a014470ac37b6e
2024-10-24 19:31:52 +02:00
Treehugger Robot
3dcc84df5c Merge "Convert appcompat.sh to a Python binary" into main 2024-06-13 00:51:27 +00:00
Nelson Li
fd6406c066 Convert appcompat.sh to a Python binary
Previously, to use `appcompat.sh`, we hardcoded absolute paths for many
dependencies in the `build/core/definitions.mk` file, and the same was
done in `art/tools/veridex/Android.mk`.

This change converts `appcompat.sh` to `appcompat.py` and packages the
necessary files into a `Python binary`. This not only resolves the
issue of hardcoding absolute dependency paths but also allows users to
use the tool directly without having to specify dependency paths,
making it more convenient.

Bug: 343105310
Test: 1. m appcompat
      2. m CarrierConfig (any module with appcompat)
      3. appcompat --dex-file=<apk path>

Change-Id: I6215f42241f58ba7fc6f4ae5846c4b71d9c1be4f
2024-06-04 03:34:27 +00:00
Ronald Braunstein
b86f9ef159 Reapply "Add soong installed files to general-tests.zip"
This reverts commit f2685e5ccf.

Original commit broke building sdk/ndk in post submit.
Fixed with small patch in build/soong

Test: m general-tests
Test: IST_DIR=/usr/local/google/dist/bug TARGET_RELEASE=trunk_staging TARGET_BUILD_VARIANT=userdebug UNBUNDLED_BUILD_SDKS_FROM_SOURCE=true packages/modules/common/build/mainline_modules_sdks.sh
Change-Id: I47e39913878219adec6471a474e3c238c4bdeed1
2024-06-02 07:21:37 -07:00
Priyanka Advani
f2685e5ccf Revert "Add soong installed files to general-tests.zip"
Revert submission 3060229-ron-tmc-symlinks

Reason for revert: Droidmonitor created revert due to b/344045516

Reverted changes: /q/submissionid:3060229-ron-tmc-symlinks

Change-Id: Ic471df68c3ebdeb368eac9549446ee50b17d7c2f
2024-05-31 23:31:17 +00:00
Ronald Braunstein
523696e964 Add soong installed files to general-tests.zip
The module `test_module_config` will be installing symlinks in the
testcases directory pointing back to the `base` test for .apk files.
This saves a gigs of space on disk and in suite zip files.

However, the .mk files were using  LOCAL_COMPATIBILITY_SUPPORT_FILE to
do two things:
  1) copy the file from intermediates to testcases
  2) package the testcases files in zips.

Because the test_module_config rule is taking care of 1), we need a new
variable to do just 2)

Test: m general-tests device-tests
Change-Id: Icdad4401cde27d8edd5e13e486b96c62817a4bbb
2024-05-31 08:23:08 -07:00
Yihan Dong
f55cd66417 Collect xTS jar/apk packages from soong intermediate dirs
These data will be used in API map analysis.

Test: m
Bug: 328699028

Change-Id: Ie95d8fd46ecb3b2eec4441b91c5ad5297558f3ee
2024-05-29 17:52:21 +08:00
Kiyoung Kim
454265c233 Reapply "Rename LOCAL_USE_VNDK"
LOCAL_USE_VNDK property refers if the module uses VNDK, and this
property is being used to check if the module is installed in vendor or
product. However, the term no longer makes sense with VNDK deprecation,
so it should be renamed. Similar to change in aosp/2897612, rename
LOCAL_USE_VNDK as LOCAL_IN_VENDOR or LOCAL_IN_PRODUCT.

Bug: 316829758
Test: AOSP CF build succeeded
Change-Id: I2da2e2027ccabbcfbb444abc6828addeb3b22e13
2024-02-05 11:01:41 +09:00
Kiyoung Kim
0bf6c284e0 Revert "Rename LOCAL_USE_VNDK"
Revert submission 2931430-local_use_vndk

Reason for revert: build fails with barbet targets

Reverted changes: /q/submissionid:2931430-local_use_vndk

Change-Id: I40277cfb26bb4da5dc398b99fc4ab009d91405fc
2024-02-02 08:06:57 +00:00
Kiyoung Kim
f4c9330e24 Rename LOCAL_USE_VNDK
LOCAL_USE_VNDK property refers if the module uses VNDK, and this
property is being used to check if the module is installed in vendor or
product. However, the term no longer makes sense with VNDK deprecation,
so it should be renamed. Similar to change in aosp/2897612, rename
LOCAL_USE_VNDK as LOCAL_IN_VENDOR or LOCAL_IN_PRODUCT.

Bug: 316829758
Test: AOSP CF build succeeded
Change-Id: Icfd1707953eba2e29044468ab6728b39d7998048
2024-01-30 17:10:39 +09:00
Cole Faust
a4e395b2af Merge "Revert "symlink_outputs: Add .KATI_SYMLINK_OUTPUTS to build/make..."" into main 2024-01-19 19:38:57 +00:00
Cole Faust
8f2283e6f2 Revert "symlink_outputs: Add .KATI_SYMLINK_OUTPUTS to build/make..."
Revert submission 1433935-symlink_outputs

Reason for revert: symlink_outputs was added so bazel could run ninja files, but we abanoned that approach in roboleaf, and then roboleaf was cancelled entirely. Remove this feature so we're more compatible with upstream ninja / n2.

Reverted changes: /q/submissionid:1433935-symlink_outputs

Change-Id: I5a779695689148ed32037f7f82887c458a3587cd
2024-01-18 20:12:12 +00:00
Colin Cross
3b89c6532a Support Soong-generated module-info.json entries
Allow Soong modules to generate their own module-info.json entries
by merging Soong's module-info.json file into the one generated in
Make.

Skip collecting unnecessary ALL_MODULES.$(my_register_name).*
that are only used for module-info.json if the module was already
handled by Soong via the LOCAL_SOONG_MODULE_INFO_JSON property.

Bug: 309006256
Test: Compare module-info.json
Change-Id: I2c9db3c7c7bae7bd6cb889d7ebc2e383c278c82d
2024-01-02 17:21:22 -08:00
Colin Cross
b2063049f8 Don't install vintf and init.rc from Soong
Soong is now handling installing init.rc and vintf fragment files,
don't install them in Make for Soong modules.

Bug: 309006256
Test: Compare installed files
Change-Id: Ied43c207c6ae158d3f41d81c7fe16688331bf13c
2024-01-02 14:33:20 -08:00
Colin Cross
93e1e702a4 Remove ALL_DEPS.MODULES
Nothing reads it any more.

Test: m checkbuild
Change-Id: I6f11a5273b0c2cc92a3b0c49bbefbf084cb734a1
2023-11-14 11:03:08 -08:00
Colin Cross
710c3cb5fb Remove code related to unused LOCAL_* variables
LOCAL_JETIFIER_ENABLED, LOCAL_NO_PIC, LOCAL_PREBUILT_STRIP_COMMENTS,
LOCAL_RMTYPEDEFS, and *.vts sources are never used.  Remove them
and the code related to them.

Test: no change to out/build-aosp_cf_x86_64_phone.ninja
Change-Id: I2ca9e674602057cc163b8bc28b0c57a0b7cc4361
2023-11-02 10:45:33 -07:00
Colin Cross
aed37d79f2 Remove obsolete uses of LOCAL_MODULE_TAGS
Only LOCAL_MODULE_TAGS := tests is used is meaningful in the current
implementation.  "optional" and "samples" both exist in the tree, but
are meaningless.  "gnu", "user", "eng" and "debug" are  no longer used,
and are already forbidden by the unusual tags check.  The info from the
"module" target is now available in module-info.json.  Delete all the
irrelevant code.

Test: no change to out/build-aosp_cf_x86_64_phone.ninja
Change-Id: I04e8178a362e382a1a4bd997c1b4c3a480db7714
2023-11-02 10:10:06 -07:00
Elliott Hughes
707142007b Microoptimize package name extraction.
Since there's only one, and it appears early, we can stop when we find
it rather than trawl through megabytes of localized strings we don't
need to see.

Bug: https://github.com/onetrueawk/awk/issues/199#issuecomment-1756885708
Test: treehugger
Change-Id: If4d7c63da7df76c23fca417a4b727189f79e3ce6
2023-10-11 22:56:22 +00:00
Cole Faust
206971459d Fix $(PROGUARD_DICT_ZIP) builds
Previously, when building the proguard dict zip, we got a lot of
warnings like these, and the files were always rebuilt:

```
[ 39% 9/23] Copy symbols with mapping: out/target/common/obj/APPS/HTMLViewer_intermediates/proguard_dictionary
ninja: Missing `restat`? An output file is older than the most recent input:
 output: out/target/common/obj/APPS/HTMLViewer_intermediates/proguard_dictionary.textproto
  input: out/soong/.intermediates/packages/apps/HTMLViewer/HTMLViewer/android_common/e10894d3da5db41239526c9048962355/proguard_dictionary
```

For some reason kati wasn't adding `restat=true` on these ninja rules.
Adding $(4) to KATI_RESTAT fixes it for some reason.

Test: m dist repeatedly doesn't give the restat warnings
Change-Id: Ie02526b3ab127f42bdc2db350d2dc468e7888fe2
2023-09-06 18:13:27 -07:00
Cole Faust
c67e769b8c Install LOCAL_SOONG_INSTALL_SYMLINKS even if LOCAL_SOONG_INSTALLED_MODULE isn't set
LOCAL_SOONG_INSTALL_SYMLINKS can now be set by the install_symlink
module type. The install_symlink module type doesn't set
LOCAL_SOONG_INSTALLED_MODULE because make tries to copy that file
around, which doesn't work with a symlink.

Bug: 205632228
Test: built and ran the emulator observed the /system/bin/hwservicemanager symlink is still there
Change-Id: I1ec355b5ae057d0b7fe167674d70da6a4d03f6b5
2023-09-05 14:16:38 -07:00
Cole Faust
b35231ece0 Build the proguard dict zip without PACKAGING intermediates
Before, as each module was built, it would dump its proguard-related
files into the PACKAGING folder. Then the rule for the final distable
zip would zip up this whole folder. This means that if you built a
module that was not part of the system, and then rebuilt the final
zip, it would erronously include more proguard files than necessary.
This problem was worked around by relying on CI to run `m installclean`
every time.

Now, the zip proguard files always include the same information.

This also makes it so that when you build a module, its proguard files
are not copied to the PACKAGING folder, making builds that don't
build the final proguard zips slightly faster.

Bug: 205632228
Test: diff'd proguard-dict.zip, proguard-dict-mapping.textproto, and proguard-usage.zip before/after this cl on sdk_phone_x86_64. They have diffs, but only in the order of files / lines.

Change-Id: I98c02e1eb117c337ba9b98f04ad486597eb9bb86
2023-08-30 17:17:19 -07:00
Cole Faust
8e4024c872 Rename some variables in definitions.mk
Sublime text has an issue with their syntax highlighting, where it
looks for \s*define\b to indicate the start of a define block.
We had some variables that started with "define-", which match this
regex, which causes Sublime to be confused about where the defines
start and end. Rename the variables to work around this issue.

Test: m nothing
Change-Id: I997929606e2b0a8b086ad3b67a7ce1b5e99a7385
2023-08-14 15:28:05 -07:00
Devin Moore
c33aec868b Let assemble_vintf create the output fragments
Instead of checking, then copying the fragments into the out directory,
we pass in the output file and let assemble_vintf create the output
file.

Test: m
Bug: 290265210
Change-Id: I65c2ee826de73b805b48dc95f20c2405250587f8
2023-07-31 16:10:59 +00:00
Treehugger Robot
08d991834d Merge "Support transitive resource packages from Soong" into main 2023-07-26 00:34:57 +00:00
Colin Cross
d9d5c2a95e Support transitive resource packages from Soong
Soong is improving resource handling by not squashing resources from
all dependencies into every android_library.  This causes problems
when the android_library is exported to Make, as Make is still using
the old squashing behavior.

Add a file to every static java library that lists the resource packages
of its transitive dependencies.  For modules defined in Andorid.mk files
leave the file empty, but for Soong modules populate it with the list
of transtiive dependencies.  Pass the contents all of the files from
direct dependencies to aapt2 link to include any transitive dependencies.

Bug: 284023594
Test: m Dialer
Change-Id: I4e8ace497d701a9645a62dd5a6ac12e9a6830dcf
Merged-In: I4e8ace497d701a9645a62dd5a6ac12e9a6830dcf
2023-07-25 21:30:38 +00:00
Elliott Hughes
97ad120adb Switch from minigzip to gzip.
Bug: http://b/288169261
Test: treehugger
Change-Id: I404cbcb850734ed8291c2215a4329fb372806d63
2023-06-27 15:39:05 -07:00
Treehugger Robot
913c41caf5 Merge "Use Z_BEST_COMPRESSION for compress-package" 2023-06-13 10:09:54 +00:00
Bob Badour
2191b9db82 Note ability to annotate dependencies.
Test: m droid dist
Change-Id: If3a0d032caf7801196117d7c4d4d21cb67c826bf
2023-05-16 10:52:12 -07:00
Gregory Montoir
91721868ec Use Z_BEST_COMPRESSION for compress-package
Saves a few extra KBs with LOCAL_COMPRESSED_MODULE

Bug: 191841942
Bug: 282617419
Test: boot && apks uncompressed
Change-Id: I1a8c6cdfc194b68b2f2c9fb398851a7a4b7440bf
2023-05-15 06:25:57 +00:00
Cole Faust
ab4f856bbc Remove gpl_source.tgz
This file was an archive of all the gpl files that could be found
in the source tree. Because it looks for gpl files using $(wildcard),
kati had to rerun the wildcards every single build to see if they had
changed. These GPL wildcards made up 30294 of 63996 wildcards present
on aosp-master. Removing these wildcards saves (aosp/internal) ~0.2/~0.1
seconds from every build, and ~0.4/~0.6 seconds from the wildcard
checking portion of kati. (The whole build sees <0.4s/0.6s of
improvement because it's parallelized with the shell checking, but
improvements here mean that we can now improve the shell commands as
well and get more fruitful results)

We don't actually use gpl_source.tgz anywhere, so we can just remove it.

Bug: 282079550
Test: m nothing
Change-Id: I77141dbb39b2d8ebd96bc258fe7dbdff5a372977
2023-05-11 18:00:38 -07:00
Joe Onorato
735320a9d7 Merge "Save approx 18GB of RAM by not having a bazillion copies of the same modules names" 2023-04-24 21:06:57 +00:00
Joe Onorato
9ba2f4d022 Save approx 18GB of RAM by not having a bazillion copies of the same modules names
Bug: 278864904
Test: treehugger, m, manual inspection
Change-Id: Ib564b3edf4a0523fc8231b8e57a5ba9c42a73294
2023-04-24 01:11:40 -07:00
Inseob Kim
168ab6af74 Remove lunch target from appcompat log
This is to reduce build rule divergence among targets. We only need the
path under PRODUCT_OUT.

Bug: 277662244
Test: build and boot
Change-Id: Ica8776d1779c47305c3c74015be2b3597cbdf95c
2023-04-18 14:02:52 +09:00
Bob Badour
0bd9a626bd Increase dump-words-to-file capacity
Test: m droid dsit
Change-Id: I092e032a8d8f943dbb2eddd4bb7c57df40bbcfba
2023-03-24 13:12:45 -07:00
Bob Badour
e5b7a4205e Fix copy+paste error
Fix declare-copy-target-license-metadata

Test: m droid reportmissinglicenses

Change-Id: I5c8ee1109f9b83232bf66218d44ed05f97377a98
2022-12-01 17:56:33 -08:00
Colin Cross
af7ac3986e Add basic musl support to make
There are still devices that set BUILD_BROKEN_USES_BUILD_HOST_* and
build host modules in Make.  Add basic support for building against
libc_musl in Make when USE_HOST_MUSL is set.

Bug: 258535366
Test: build a host tool defined in Android.mk file in internal branch
Change-Id: I9150be749bbeaac2ac5a33b2cf915004aa3033df
2022-11-09 16:40:25 -08:00
Cole Faust
6a75c4f782 Delete java-layers.py
There are no usages of LOCAL_JAVA_LAYERS_FILE,
and java-layers.py was written in python 2.

Bug: 203436762
Test: Presubmits
Change-Id: I1be0f2547757a853e20811f28529479487037e94
2022-10-24 18:15:54 -07:00
Bob Badour
4f4c75fba9 Add module name argument to build_license_metadata.
Test: m droid dist

Change-Id: I40b9f403a3d17cc202844f4cebf336de40e5defe
2022-10-13 13:50:35 -07:00
Bob Badour
54b325df14 Normalize target path for license dependencies.
If not normalized the same as declare-license-metadata, two rules get
generated instead of one rule with both license text and deps.

Test: m droid dist

Test: build/soong/soong_ui.bash --make-mode TARGET_PRODUCT=sdk TARGET_BUILD_VARIANT=userdebug sdk dist sdk_repo

Change-Id: I3a8f2d3825c8c0183049fa12b14ace9b54066a01
Merged-in: I3a8f2d3825c8c0183049fa12b14ace9b54066a01
2022-09-13 17:21:40 +00:00
Bob Badour
28078172fe Put host license metadata in OUT_DIR.
Test: m droid dist

Test: build/soong/soong_ui.bash --make-mode TARGET_PRODUCT=sdk TARGET_BUILD_VARIANT=userdebug sdk dist sdk_repo

Change-Id: I9f5d9c1b70eb8469031d49818c32770dcf34fad2
Merged-in: I9f5d9c1b70eb8469031d49818c32770dcf34fad2
2022-09-13 17:20:20 +00:00
Yihan Dong
9b75c9ee1a Assign each xts test package a copy license metadata
Use a copy license metadata instead of module_license_metadata to make each xts test package names shown in the final xts notice file.

Test: m gts reportmissinglicenses
Bug: 245474938
Change-Id: Ic5e28763bc4e8448d3e04a80e89db147387164a6
2022-09-07 08:12:37 +00:00
Greg Kaiser
85518aceab Add project specific definitions.mk files
Just like we do with build/tasks/*.mk, we also look for project
specific definitions.mk files.

Test: TreeHugger
Bug: 243024627
Change-Id: I7f07546582eb02bba245a1f927a11efc1ddc3c6f
2022-08-18 12:22:15 -07:00
Treehugger Robot
79e45e727a Merge "Append built and installed when copying metadata." am: 3fe9459268
Original change: https://android-review.googlesource.com/c/platform/build/+/2169434

Change-Id: Ib2e6411981a213d7e477e105d8efd6783c346f07
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-08-02 17:47:13 +00:00
Bob Badour
04fbe29669 Append built and installed when copying metadata.
Soong doesn't always have the built and installed available.

Bug: 239638693

Test: m droid dist

Change-Id: Id18201da488e3b16d60957c9a298a52345595c5b
2022-07-29 17:16:25 -07:00
Anton Hansson
ce02daa32b Merge "Fix typo" am: 0f079826a1 am: a00e17c412
Original change: https://android-review.googlesource.com/c/platform/build/+/2129256

Change-Id: I560cbea327b27a96639d1b7a49a6d149da0cad58
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-06-21 13:46:30 +00:00
jiajia tang
7c8dd8c3d4 Fix typo
As title

Signed-off-by: jiajia tang <tangjiajia@xiaomi.com>
Change-Id: I40b155ceed8e88fecf25da5dd13a2fb146faf263
2022-06-21 00:21:45 +00:00
Treehugger Robot
67fa5b53f4 Merge "Revert "Revert "Revert "Revert "Create lists of projects to share per dist target""""" am: 6f30351970 am: 7660d6a3a7
Original change: https://android-review.googlesource.com/c/platform/build/+/2124807

Change-Id: I0b6ebdce2ed8243bfed7c7ef1f19e37ceebaf367
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-06-15 17:01:46 +00:00
Bob Badour
d227fac95b Revert "Revert "Revert "Revert "Create lists of projects to share per dist target""""
This reverts commit 398bd87950.

Reason for revert: Rolling forward again without 'all' target.

Bug: 151177513
Bug: 210912771
Bug: 235333302
Bug: 232138105

Test: build/soong/soong_ui.bash --make-mode TARGET_PRODUCT=aosp_coral_hwasan TARGET_BUILD_VARIANT=userdebug droid dist with-license platform_tests continuous_instrumentation_tests continuous_native_tests

Test: tapas google-tradefed-all && m dist

Change-Id: I1e5f5639ebf1fa61060124a5183f6f0a2ece04b5
2022-06-14 11:33:54 -07:00
Treehugger Robot
e759d23d01 Merge "Revert "Revert "Revert "Create lists of projects to share per dist target"""" am: 6ebfaa453b am: 388494bd87
Original change: https://android-review.googlesource.com/c/platform/build/+/2124432

Change-Id: Iccbe21894f0f7d1098f87f9f512fe5226a0eb67a
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-06-14 09:48:18 +00:00
Bob Badour
398bd87950 Revert "Revert "Revert "Create lists of projects to share per dist target"""
This reverts commit 82040d9882.

Reason for revert: Advised to switch to using TARGET_BUILD_APPS

Change-Id: If56a1fceb5da66b90b7b0ec2275ec429661515b4
2022-06-14 00:03:23 +00:00