Commit graph

3435 commits

Author SHA1 Message Date
Justin Yun
40182b6ff3 Remove duplicated CollectDependencyAconfigFiles()
android.ModuleBase already calls aconfigUpdateAndroidBuildActions()
that is the same with CollectDependencyAconfigFiles(). Remove the
CollectDependencyAconfigFiles() to avoid duplication with
aconfigUpdateAndroidBuildActions().

To make the aconfig information available in
GenerateAndroidBuildActions() of all modules, call
aconfigUpdateAndroidBuildActions() before calling
GenerateAndroidBuildActions() of each module.

Also, we don't need SetAconfigFileMkEntries(), which is a duplicate
of aconfigUpdateAndroidMkData()

Bug: 335363964
Test: diff `adb shell printflags` before and after the change.
Change-Id: I52808e442e9fed7db1eae7b7c5ed0b1c5ba74f5d
2024-05-10 10:00:14 +09:00
Treehugger Robot
7eaf503cfd Merge "Revert^2 "Remove compilation actions from java sdk library"" into main 2024-05-08 22:28:05 +00:00
Jihoon Kang
a3a05460b4 Revert^2 "Remove compilation actions from java sdk library"
This change modifies the build actions of java_sdk_library module type
so that it does not perform any compilation actions (i.e. does not
create the top level java_sdk_library jar file). Instead, it delegates
the build actions the top level jar file was performing to the
dynamically created ".impl"-suffixed java library module. The build
actions that are delegated to the impl library module include hiddenapi
processing, dexing, and dexpreopt.

This change relands https://r.android.com/3035972. Implementation
changes from the original change:
- "all_apex_contributions" is added as a dependecy to the implementation
  library modules where the parent sdk_library module has a prebuilt
  equivalent. This allows the source apex variant to be hidden from make
  when the prebuilt is active.

Test: patch in internal main, lunch barbet-ap2a-userdebug && m nothing
Test: m nothing --no-skip-soong-tests
Bug: 332785297
Change-Id: I017938e5567aef82e428e7ceb557d9c9090e0257
2024-05-08 17:46:31 +00:00
Cole Faust
3f01580c04 Merge "Make the enabled property configurable" into main 2024-05-07 17:49:10 +00:00
Jihoon Kang
5284ad3b33 Merge "Revert "Remove compilation actions from java sdk library"" into main 2024-05-07 00:03:05 +00:00
Jihoon Kang
8f25d296b5 Revert "Remove compilation actions from java sdk library"
Revert submission 3070882-sdk_lib_remove_compilation

Reason for revert: Potential culprit for build breakage of barbet-ap2a-userdebug in git_main

Reverted changes: /q/submissionid:3070882-sdk_lib_remove_compilation

Change-Id: I5135760e13e0152480c68fe91a3c88564e9bc7cb
2024-05-06 22:40:22 +00:00
Treehugger Robot
f91daab1ab Merge "Remove compilation actions from java sdk library" into main 2024-05-06 21:06:54 +00:00
Jihoon Kang
d831af4267 Remove compilation actions from java sdk library
This change modifies the build actions of java_sdk_library module type
so that it does not perform any compilation actions (i.e. does not
create the top level java_sdk_library jar file). Instead, it delegates
the build actions the top level jar file was performing to the
dynamically created ".impl"-suffixed java library module. The build
actions that are delegated to the impl library module include hiddenapi
processing, dexing, and dexpreopt.

Test: m nothing --no-skip-soong-tests
Bug: 332785297
Change-Id: I7534f9eaacf6d9f72fbf8d540b1e26af84106c20
2024-05-03 20:51:11 +00:00
Oriol Prieto Gascó
a874e94bab Merge "Make container mandatory in aconfig_declarations." into main 2024-05-03 14:09:48 +00:00
Cole Faust
a963b94cde Make the enabled property configurable
This allows using select statements with it.

Bug: 323382414
Test: m nothing --no-skip-soong-tests
Change-Id: I6f3efaaa3d82505e38a91ee4ba0e18e404360191
Merged-In: If355d24506e3f117d27b21442a6c02bca3402dc7
2024-05-02 15:41:24 -07:00
Kiyoung Kim
973cb6f555 Move LLNDK related logic to llndk_library
Currently VNDK contains some logic for LLNDK libraries as they are
treated in a similar way with VNDK. However, those logics should stay from
VNDK deprecation. To keep the logic, this change moves LLNDK related
logic into llndk_library.

Bug: 330100430
Test: Soong tests passed
Test: llndk.libraries.txt did not change from CF build
Change-Id: I1d02a3c2a398f1b1060b4f2bdd23af32310503bb
2024-04-30 13:05:19 +09:00
Ted Bauer
1e96f8c622 Switch to static deps
Bug: 328444881
Test: m
Change-Id: I53ad95ca281031ec98d5df66ada0ed69749da312
2024-04-26 13:46:09 +00:00
Yu Liu
315a53c5cb Make container mandatory in aconfig_declarations.
Bug: 330354107
Test: Unit test and CI.

Ignore-AOSP-First: It is easier to detect all the missing ones in internal
master.
(cherry picked from https://googleplex-android-review.googlesource.com/q/commit:e916a2c758d2a95037d1d366e7cd0e10d241d510)
Merged-In: I4ab4271c67a35d0fdcc0b57c27260e29fb7dea56
Change-Id: I4ab4271c67a35d0fdcc0b57c27260e29fb7dea56
2024-04-24 16:41:57 +00:00
Ted Bauer
f0f18591a5 Add aconfig storage API deps to codegened lib
Change-Id: I4991c9fccb0a0bab15457883cf20aacb3142c4cf
2024-04-23 18:25:26 +00:00
Colin Cross
7c035064db Convert apex mutator to a TransitionMutator
Replace the apex mutator with a TransitionMutator.  Requires moving the
base.apexInfo value into a provider so that it is still present for the
Mutate pass.

Test: go test ./...
Test: no change to out/soong/build-${TARGET_PRODUCT}.ninja
Change-Id: I1c898eaf30b4021f0f96f439cc0b3b3173710fc7
2024-04-18 15:08:43 -07:00
Treehugger Robot
1065ed8fbd Merge "java_sdk_library: Use WriteFileRule for writing permissions.xml" into main 2024-04-11 20:55:30 +00:00
Jihoon Kang
033ffb9533 Merge "Collect aconfig_declarations of the dependent java_aconfig_library modules" into main 2024-04-11 17:37:58 +00:00
Paul Duffin
1816cde8ce java_sdk_library: Use WriteFileRule for writing permissions.xml
Use the `WriteFileRule` to write the permissions file for shared
libraries instead of generating a custom bash rule.

Test: TH
Change-Id: I904cf0742bfec46ed45ec7801bb9bd3dc3047185
2024-04-10 13:21:28 +01:00
Jiyong Park
39011ef40c Merge "APEX can depend on non-APEX module and vice versa" into main 2024-04-08 22:28:26 +00:00
Treehugger Robot
ed2adb879f Merge "Remove Device VNDK version usage from Soong" into main 2024-04-08 19:24:36 +00:00
Jiyong Park
fc095e6796 APEX can depend on non-APEX module and vice versa
Previously, an APEX module (also called apexBundle inside of Soong) had
only one "apex" variant which has the same name as the module. This
prevented an APEX from depending on another module which is outside of
the APEX (ex: another APEX). Similarily, a module outside of an APEX
(ex: a shared lib or a test) couldn't depend on an APEX.

This CL fixes the issue by creating the "" variant as the alias of the
"<apex_name>" variant, and also by setting the "" variant as the default
dependency variant.

Bug: 321626681
Test: m
Change-Id: Ie3e57a96530c25e966cfd551676d819c442bb0d5
2024-04-05 14:39:23 +09:00
Treehugger Robot
fe66e13714 Merge "Deprecate Snapshot build" into main 2024-04-05 04:59:43 +00:00
Treehugger Robot
133a6d9e6f Merge "Return the header jar of the implementation library in SdkHeaderJars()" into main 2024-04-05 03:23:34 +00:00
Kiyoung Kim
4e765b1bfc Remove Device VNDK version usage from Soong
As of VNDK deprecation, Device VNDK version should no longer be used
from build. This change removes all references on Device VNDK version
and related logic with it.

Bug: 330100430
Test: AOSP CF build succeeded
Change-Id: Ibc290f0b41e8321f80c75c69f810223989af68dc
2024-04-05 01:57:32 +00:00
Kiyoung Kim
37693d0a27 Deprecate Snapshot build
Existing snapshot code will no longer work from VNDK deprecation, but it
can give confusion to users if we keep code for the snapshot - and it
adds complexity on existing code while it is not in use. This change
removes all snapshot definition except host snapshot and its usage.

Bug: 330100430
Bug: 332986564
Test: AOSP CF build succeeded
Change-Id: Ieb6fa43d5e38315c662ce997bc305b744b367c24
2024-04-05 01:56:56 +00:00
Jihoon Kang
8479dea802 Return the header jar of the implementation library in SdkHeaderJars()
As part of the process to remove the compilation action in the top level
java sdk library, this change modifies SdkHeaderJars(...) (i.e. the
"magic") to return the header jar of the implementation library instead
of the header jar of the top level java sdk library when the
implementation jar is returned from the "magic".

This change also removes `SdkImplementationJars()` from the
SdkLibraryDependency interface, as it is not currently used anywhere
else.

Test: m nothing --no-skip-soong-tests
Bug: 332785297
Change-Id: Icc00af4b1485dc2b1b0981a3e56758d0306dea69
2024-04-05 00:37:37 +00:00
Kiyoung Kim
6954bd2337 Merge "Remove PlatformVndkVersion property" into main 2024-04-03 00:48:04 +00:00
Jesse Melhuish
219ce55481 Merge "Allow Multilib in override_apex" into main 2024-04-01 14:01:59 +00:00
Kiyoung Kim
fa13ff194c Remove PlatformVndkVersion property
Platform VNDK version is no longer available based on VNDK deprecation.
Remove all code using Platform VNDK version.

Bug: 330100430
Test: AOSP CF build succeeded
Change-Id: I7d0f7e23eff5d153346890f242a94b78bad6736b
2024-04-01 16:37:20 +09:00
Jesse Melhuish
ec60e25a1c Allow Multilib in override_apex
Test: m nothing --no-skip-soong-tests
Test: go test apex_text.go
Bug: 246854990
Change-Id: Id6e31c63acd87466a4436288d550ce6b298c677d
2024-03-29 21:13:57 +00:00
Ted Bauer
6ef40dbce6 Add logging dependencies to Rust aconfig APIs
Test: go test
Change-Id: I17c098f6b83c442554e49b6b802f11c97f94ec76
2024-03-29 14:05:05 +00:00
Kiyoung Kim
82488ca457 Merge "Remove VNDK information from CC and APEX tests" into main 2024-03-29 04:37:25 +00:00
Jooyung Han
3520b9488e Merge "VINTF manifests in apex don't require extension" into main 2024-03-29 02:37:19 +00:00
Jihoon Kang
3921f0b356 Collect aconfig_declarations of the dependent java_aconfig_library modules
droidstubs module require aconfig_declarations modules to be specified
when the module depends on the java_aconfig_library module in order to
generate the "exportable" stubs. This adds burden to the droidstubs or
java_sdk_library module owners, as module should specify both the
java_aconfig_library and aconfig_declarations modules to genreate the
"exportable" stubs, although the necessary information from the
aconfig_declarations module can be provided from the
java_aconfig_library modules.

In order to resolve such burden, this change enables the intermediate
cache files from the associated aconfig_declarations module of a
java_aconfig_library module to be propagated to its reverse dependencies
without having the specify the aconfig_declarations modules in the
droidstubs or java_sdk_library modules definitions.

This does not mean that the intermediate cache files of every transitive
dependencies of the java_sdk_library or the droidstubs will be passed to
aconfig to retrieve the state of the aconfig flags.

Specifically, only the java_aconfig_library modules or the java_library
modules that have static dependency on java_aconfig_library modules that
are passed to droidstubs via `libs` or `srcs` (using
":module_name{.tag}" syntax) will provide the intermediate cache files
to generate the "exportable" stubs. For java_sdk_library, all modules
listed as `libs`, `static_libs`, `stub_only_libs`, and `apiScope.libs`
are passed as `libs` and all modules listed as `api_srcs` and `srcs` are
passed as `srcs` to the droidstubs modules dynamically generated in
java_sdk_library module per api scope, thus these properties will be
affected.

Note that the test is being added in the apex package. This is because
trying to register the codegen package build components in the java
package leads to circular dependency between the codegen and the java
package, as codegen package imports the java package.

Test: m nothing --no-skip-soong-tests
Bug: 329284345
Change-Id: I7953ab64776f6947808321ce8a3598154501bcfe
2024-03-29 01:11:32 +00:00
Ted Bauer
02d475c3d8 Add storage API as dependency to Rust codegen
Test: m
Bug: 328444881
Change-Id: Id1ef9276adb9f9b990a05b910937e96ab0a5ac50
2024-03-28 18:38:32 +00:00
Kiyoung Kim
0d1c1e6aef Remove VNDK information from CC and APEX tests
VNDK is deprecated in 24Q2, so soong should be tested with no device and
platform vndk versions. This change removes all VNDK related tests and
VNDK versions from soong-cc and soong-apex tests.

Bug: 330100430
Test: m nothing --no-skip-soong-tests passed
Change-Id: I45e6c13e6c0a6bc9710b120e8d5b167e2051631e
2024-03-28 15:15:01 +09:00
Jooyung Han
262f73c831 VINTF manifests in apex don't require extension
libvintf reads all entries from vintf directory. The apex build rule
should match with it.

Bug: 331474817
Test: build with aosp/3017012/1
Change-Id: Ida5fce2436ec5985e2fb4c2a3608bf20f4933582
2024-03-28 11:29:47 +09:00
Treehugger Robot
e58af3da5a Merge "Add required, host_required, and target_required as dependencies" into main 2024-03-25 04:10:50 +00:00
Thiébaud Weksteen
d3348dbaaa Merge "Support multiple sources for prebuilt_etc" into main 2024-03-21 23:14:48 +00:00
Thiébaud Weksteen
00e8b31ee6 Support multiple sources for prebuilt_etc
Keep the Src attribute for compatibility. The new attribute (Srcs) is
mutually exclusive with Src.

Keep SourceFilePath and OutputFile for compatibility with other modules.
These can be removed in a follow up change.

Bug: 328313691
Test: presubmit
Test: m blueprint_tests
Test: prebuilts/build-tools/build-prebuilts.sh (on build-tools branch)
Change-Id: I5d5b2657715a7180a829c7ed0f501872d561b662
2024-03-21 11:30:15 +11:00
Jiyong Park
8bcf3c64f1 Add required, host_required, and target_required as dependencies
So far, the installation of required modules were handled by Make. This
prevents us from implementing the module installation and packaging
entirely in Soong.

This CL is the first step towards that goal. Soong now correctly tracks
the dependencies and they are correctly returned by
TransitivePackagingSpecs(), which is used by packaging modules like
android_system_image.

Bug: 321626681
Test: build
Change-Id: I9192b5333ceaa0b7d1c5c4abeec2af62febcd976
2024-03-20 17:05:17 +09:00
Yu Liu
c888460e5d Support rust in aconfig mode validation.
Bug: 323071835
Test: Unit tests
Change-Id: I6de2a6fe1618e21c9aab728e6d77c6b0c6ce33df
2024-03-15 18:48:38 +00:00
Cole Faust
b9ae285b55 Merge changes from topic "import_make_staging_dir" into main
* changes:
  Add include_make_built_files
  Don't use zip files when creating filesystems
2024-03-15 17:34:26 +00:00
Cole Faust
3b806d3b88 Don't use zip files when creating filesystems
The end result is a directory that's passed to build_image, so zipping
and then unzipping image contents will unnecessarily slow things down.

Bug: 329146343
Test: m microdroid --no-skip-soong-tests
Change-Id: I98223c60e8144d6c707832fcc03ba8fe94467e7b
2024-03-14 16:40:30 -07:00
Treehugger Robot
4e4939665e Merge "Generate info about the selected app variant in platform builds" into main 2024-03-14 22:05:43 +00:00
Yu Liu
f509eba41d Merge "Validate aconfig libs are built with the correct modes." into main 2024-03-14 18:39:12 +00:00
Spandan Das
3490dfd23f Generate info about the selected app variant in platform builds
This is a followup to aosp/2999198 and adds information about apps.

Each app will have an entry in this file with the following properties
- Name, mandatory
- Is_prebuilt, mandatory
- Prebuilt_info_file_path, optional

Implementation details
- Move prebuiltInfoProvider out of build/soong/apex to
  build/soong/android. This allows build/soong/java to use it.
- Introduce a new `prebuilt_info` prop to `android_app_set` and
  `android_app_import`
- All app module types will set a prebuiltInfoProvider in
  GenerateAndroidBuildActions, including the source app module types

Test: m nothing --no-skip-soong-tests
Test: m out/soong/prebuilt_info.json
Test: ls -l out/soong/prebuilt_info.json --human-readable
-rw------- 1 spandandas primarygroup 317K Mar 11 23:46 out/soong/prebuilt_info.json

Test: #modified trunk_staging.locally to select prebuilts of some
mainline apps. Spot-checked that `is_prebuilt` and
`prebuilt_info_file_path` get populated appropriately

Bug: 327480225
Change-Id: I5078e0ec26c9568194550909962b90111a5223f7
2024-03-14 18:12:30 +00:00
Jooyung Han
ed9005b556 Merge "Clean up LLNDK stubs" into main 2024-03-14 03:58:14 +00:00
Spandan Das
a747d2ec48 Generate info about the selected apex variant in platform builds
out/soong/prebuilt_info.json will contain information about whether
source or prebuilt of an apex was used. If prebuilt is used, it will
print the path to its prebuilt_info file. This file will be
used to pick a matching set of MTS test prebuilts.

Each apex will have an entry in this file with the following properties
- Name, mandatory
- Is_prebuilt, mandatory
- Prebuilt_info_file_path, optional

Implementation details
- Introduce a new `prebuilt_info` prop to `apex_set` and `prebuilt_apex`
- All apex module types will set a prebuiltInfoProvider in
  GenerateAndroidBuildActions, including the source apex module types
- Create a `apex_prebuiltinfo_singleton` that visits all apex modules.
  It uses `IsHideFromMake` to filter out the unselected variants of a
  specific apex. This new singleton will create prebuilt_info.json
- Dist prebuilt_info.json for droidcore

Test: m nothing --no-skip-soong-tests
Test: m out/soong/prebuilt_info.json
Test: ls -l out/soong/prebuilt_info.json --human-readable
-rw------- 1 spandandas primarygroup 25K Mar 11 23:46 out/soong/prebuilt_info.json

Test: #modified trunk_staging.locally to select prebuilts of some
mainline modules. Spot-checked that `is_prebuilt` and
`prebuilt_info_file_path` get populated appropriately

Bug: 327480225

Change-Id: I65c73010142b034ad1d2b3d05ef493be034e8d74
2024-03-12 18:04:55 +00:00
Jooyung Han
5e8994e5ed Clean up LLNDK stubs
So far we created {"", "current"} stubs for LLNDK modules. But we don't
need "current" because "" itself is a stub.

This change only removes unused LLNDK stub modules with "current"
version, which aren't used at all.

Bug: 329183083
Test: m blueprint_tests
Change-Id: Ib8e880b6d88952b489657ea1ac557a48afe562a4
2024-03-12 16:26:18 +09:00