summaryrefslogtreecommitdiff
path: root/android/module.go
AgeCommit message (Collapse)Author
2025-03-22Add prepend_artifact_with_product attribute for dist Bill Yang
Add the new attribute to feet what test_package's requirement, moving the dist output naming logic from test_package to dist. Also add 4 allowed module names for the rest of the continuous_* test packages. Ignore-AOSP-First: Because the platform_tests conversion is in internal branch currently. Bug: 399246722 Test: m dist platform_tests Change-Id: I96e690f23e801c22fe66f0f234be8a1f9a84062f
2025-03-19Clear as much of cc.Module as possible after GenerateBuildActions Colin Cross
Reduce peak memory usage by adding a CleanupAfterBuildActions method that is called at the end GenerateBuidlActions, nad use it to clear as much of cc.Module as possible. This is a temporary measure, eventually the entire module should be released by blueprint once all interactions are performed through providers. Test: all soong tests pass Change-Id: Idc3390ae4506ff2eef3231691e1de7446067961a
2025-03-19Merge "Support ints in select() expressions" into main Cole Faust
2025-03-18Support ints in select() expressions Cole Faust
Both for the type of the condition, and the type of the property. Bug: 355539748 Test: soong tests Change-Id: Ia84ea9f9f43a4c44a96415aad06c9c3981bf217c
2025-03-18Generic configuration for generic system modules. Justin Yun
Config object includes a copy of itself for the generic configuration. The generic configuration replaces any product-specific configurations with the generic information. When a module context gets Config() object, it returns the generic configuration if the module sets use_generic_config to true. Otherwise, Config() returns the original config object as before. By adding `generic:"<value>"` annotation to the product variable, the variables will be initialized with the <value> for the generic configs. If the <value> is "unset", the variable will be unset. The generic modules can be included in the shared system image to be installed in multiple targets. Bug: 361816274 Test: m nothing --no-skip-soong-tests Change-Id: I15e4ade17ad1a8969f8e0e91d994b60545dc412f
2025-03-14Merge "Move requiredDeps to OverridableDepsMutator" into main Inseob Kim
2025-03-14Merge "Change CommonModuleInfoProvider to a pointer." into main Yu Liu
2025-03-14Add always_use_prebuilt_sdks for soong selects Spandan Das
Test: presubmits Bug: 403514488 Change-Id: I3606d9cf1e958fd89f2804e0a40515092854f574
2025-03-14Move requiredDeps to OverridableDepsMutator Inseob Kim
Required properties can be overridden too. This adds requiredDeps in OverridablePropertiesDepsMutator for modules like override_apex. Bug: 398089235 Test: m nothing --no-skip-soong-tests Test: boot cuttlefish, TH Change-Id: I996543764b86136b8f8ae4427f5f977c7ac6553b
2025-03-13Change CommonModuleInfoProvider to a pointer. Yu Liu
Bug: 358427516 Test: Manually verified genereated ninja and mk files, unit tests. Change-Id: I53a6dd718232735decbeb93febfd269dd9449e86
2025-03-10Prevent smuggling modules through neverallow rules Cole Faust
Soong config module types would change the module type that neverallow sees, which can allow modules to get by the neverallow rules. Make the neverallow rules operate on the base module type instead of the soong config module type. Test: go test Change-Id: Icf8ef0d5c83f1027efe54ca21bbb6d5292921099
2025-03-07Rename CommonModuleInfoKey to be consistent with others. Yu Liu
Bug: 377723687 Test: Unit tests and compare the ninja and mk files generated. Change-Id: I1ce8bc782666586633ded9cfaf1b9590e3c0efde
2025-03-06Add PartitionTag to CommonModuleInfo Spandan Das
This will be used to generate apkcerts.txt, which contains an entry about the partition in which the app is installed. Bug: 399788149 Test: go build ./android Change-Id: I08c2e0d6619c941624b92b4fbe2a7349a696b62b
2025-03-05Merge "Fix -host and -target phonies building both variants" into main Treehugger Robot
2025-03-05Fix -host and -target phonies building both variants Cole Faust
The -install, -checkbuild, -outputs get deduped across all variants, so when the -host / -target phonies depended on them they were depending on all variants when they should've only depended on the host/target variants. Instead of depending on those phonies, depend on their dependencies for the current variant directly. Fixes: 400503755 Test: atest CtsCompilationTestCases:android.compilation.cts.CompilationTest Test: Ran all 4 of these commands, before they all had a successful path, now half of them show there's no path cross-variants: aninja -t path junit-params-test-host out/host/linux-x86/framework/junit-params-test.jar aninja -t path junit-params-test-host out/target/product/vsoc_x86_64/testcases/junit-params-test/x86_64/junit-params-test.jar aninja -t path junit-params-test-target out/host/linux-x86/framework/junit-params-test.jar aninja -t path junit-params-test-target out/target/product/vsoc_x86_64/testcases/junit-params-test/x86_64/junit-params-test.jar Change-Id: Iffec01948d7287f7e000ff17a4f65f883f46a87c
2025-03-04Build test_module_config modules' module_info_json in soong Cole Faust
To be able to run these tests in soong-only builds. This cl produces the following diff: https://paste.googleplex.com/4917659043627008 The diff is enitrely additional host dependencies. Without the line adding the ExtraHostRequired modules it becomes a diff of missing host dependencies. Of the two I chose the extras. It's difficult to get the required list exactly matching make. Fixes: 400731860 Test: The diff + atest CtsWifiTestCases_NoNonMainlineTest Change-Id: Idbbfbf7f74eb2eeaf68d64c0bcfbc97ddae3e2ea
2025-03-03Generate module targets per-variant Cole Faust
Previously, the module target was only generated for the final varinat, but it visited all its other variants to get output files from them. This was mostly fine, except for that now there's ctx.Device() and ctx.Target().HostCross checks in it. For a module with both device and host variants, only one of these checks would apply to all variants of the device, leading to missing -target or -host phonies. Instead, just create the phonies on all variants. We'll rely on the fact that phonies are merged/deduped, so saying `m foo` will still build all variants of foo. But now `m foo-host` or `m foo-target` will correctly only build the host or target variants. Fixes: 400503755 Test: atest CtsCompilationTestCases:android.compilation.cts.CompilationTest on a soong-only build Change-Id: I4896a6cb0461b373ec1853809fa862f9b852096c
2025-02-28Merge changes from topics "EqualModules", "tidyPhonySingleton" into main Yu Liu
* changes: Convert tidyPhonySingleton, jdepsGeneratorSingleton and genNoticeBuildRules to use ModuleProxy. Make EqualModules a free function.
2025-02-26Convert tidyPhonySingleton, jdepsGeneratorSingleton and Yu Liu
genNoticeBuildRules to use ModuleProxy. Bug: 377723687 Test: Unit tests and compare the ninja and mk files generated. Change-Id: I7507a580e3533b01f552778a7815bcc43d301e23
2025-02-26Make EqualModules a free function. Yu Liu
Bug: 377723687 Test: Unit tests and compare the ninja and mk files generated. Change-Id: I7e00f09a15f2857f58bea70bcedc4798630a40bc
2025-02-25Merge "Divorce disting from androidmk" into main Treehugger Robot
2025-02-25Divorce disting from androidmk Cole Faust
Change AndroidMkEntries.getDistContributions and AndroidMkInfo.getDistContributions into a freestanding getDistContributions. This enables us to not call the AndroidMk related functions in soong-only builds. Bug: 398938465 Test: Diff'd the ninja files from "m nothing dist" before/after this cl, no changes Change-Id: I2f9d537c0d66f0ae3715f083e2f55436e4c0a59f
2025-02-25Merge "Convert ndkSingleton, apexDepsInfoSingleton, allTeamsSingleton, ↵ Yu Liu
apexPrebuiltInfo to use ModuleProxy." into main
2025-02-25Merge "Convert the following singletons to use ModuleProxy:" into main Yu Liu
2025-02-25Convert ndkSingleton, apexDepsInfoSingleton, allTeamsSingleton, Yu Liu
apexPrebuiltInfo to use ModuleProxy. Bug: 377723687 Test: Unit tests and compare the ninja and mk files generated. Change-Id: I77b05e8b54843bfa8b91376a6796c2b5c69be3c1
2025-02-25Convert the following singletons to use ModuleProxy: Yu Liu
buildTargetSingleton exportedJavaDeclarationsLibrarySingleton javaFuzzPackager kytheExtractAllSingleton kytheExtractJavaSingleton kytheExtractRustSingleton lintSingleton logtagsSingleton makeVarsSingleton ndkAbiDiffSingleton ndkAbiDumpSingleton phonySingleton platformCompatConfigSingleton sdkSingleton Bug: 377723687 Test: Unit tests and compare the ninja and mk files generated. Change-Id: I625ac8a209ca93755b2ba232202cfb44ecefde0a
2025-02-24Remove DistFiles from AndroidMk datastructures Cole Faust
The code that collects dists also supports getting them from OutputFiles. Switch the few remaining usages of AndroidMk-based disted files over to OutputFiles, and remove DistFiles from the AndroidMk datastructures. This should allow us to clean up more AndroidMk code in a followup cl. Bug: 398938465 Test: Confirmed that the ninja files for "m nothing dist" don't change after this cl. Change-Id: I9eaed21018ef73ec36276556e7daa7201b272009
2025-02-20For modules that provide AndroidMkInfoProvider, only access modules' Yu Liu
internal data through providers. Eventually all module should be converted to provide this provider, and then we can change it to use VisitAllModuleProxies instead of VisitAllModules. Bug: 377723687 Test: Unit tests and compare the ninja and mk files generated. Change-Id: I83b55c20f971c619fa39613c1fb1cb525f56d20e
2025-02-19Convert stubLibraries, soongMetricsSingleton, sdkSingleton, Yu Liu
complianceMetadataSingleton, freezeApiSingleton and testSuiteFiles to use ModuleProxy. Bug: 377723687 Test: Unit tests and compare the ninja and mk files generated. Change-Id: I91789633ff0d4e0ab170717caf0a6b4f63c38593
2025-02-19Change depVisitor to use providers instead of type-asserting to Yu Liu
interfaces directly, the next step is to change it to use ModuleProxy once IsDepInSameApex is ready. Bug: 377723687 Test: Unit tests and compare the ninja and mk files generated. Change-Id: I13a4e256a26dbf7f9b3b746d628ac8f68b4e598e
2025-02-13Convert CheckMinSdkVersion to use providers. Yu Liu
Next step is to convert it to use ModuleProxy once IsDepInSameApex is converted to use providers. Bug: 377723687 Test: Unit tests and compare the ninja and mk files generated. Change-Id: I20cb052666fa95eb964e63e3302ac892d3324183
2025-02-13Merge "Provide min sdk version as ApiLevel instead of string." into main Yu Liu
2025-02-13Merge changes from topic "partial-compile-clean" into main Treehugger Robot
* changes: config: make partialCompileFlags visible Add partialcompileclean phony Add PhonyOutput to BuildParams
2025-02-13Add partialcompileclean phony LaMont Jones
When SOONG_USE_PARTIAL_COMPILE transitions from on to off, we need to remove all files that may have been built using partial compile. Bug: b/396145326 Test: manual, TH Change-Id: I1d91f95883fd8b1d92731a490244a898f25e614d
2025-02-12Provide min sdk version as ApiLevel instead of string. Yu Liu
Bug: 377723687 Test: Unit tests and compare the ninja and mk files generated. Change-Id: I8c7b3b493877a9857ca433b015e6e49ad8387f91
2025-02-10Install VINTF fragment modules in the APEX Kiyoung Kim
Currently APEX ignores vintf_fragments modules within the APEX, and all VINTF fragments are installed with prebuilt_etc modules. This change installs vintf_fragment modules in the APEX, so any additional prebuilt_etc modules are not required as long as binaries define vintf_fragment_modules references. Bug: 363105686 Test: AOSP CF x86_64 build succeeded Change-Id: I33b58178cd51dc2c4bb9226fdd68e7990dccd6a2 Merged-In: I33b58178cd51dc2c4bb9226fdd68e7990dccd6a2
2025-02-10Allow calling ctx.DistForGoal from GenerateAndroidBuildActions Cole Faust
Right now you have to dist files in either the AndroidMk stuff, or in MakeVars providers. Allow calling it from GenerateAndroidBuildActions so that we can further remove our reliance on make. Bug: 395184523 Test: m nothing --no-skip-soong-tests Change-Id: I6ad12fa89896b86c333fc2d23eaf4f77466e42a3
2025-01-28Merge "Clean up some of the code around effective license." into main Yu Liu
2025-01-28Convert java modules' module-info.json to Soong Jihoon Kang
This change converts the module-info.json of java_library and other java modules that call java_library's GenerateAndroidBuildActions() in its GenerateAndroidBuildActions() to Soong. Bug: 389720048 Test: Inspect module-info.json diff, CI Change-Id: I0db5ae3a5fb41bb60dc538aea2d8e614c9ae23d4
2025-01-27Merge "Move required out of common properties" into main Treehugger Robot
2025-01-27Move required out of common properties Cole Faust
Properties in commonProperties are inherited when creating a new module: https://cs.android.com/android/platform/superproject/main/+/main:build/soong/android/hooks.go;l=144;drc=b0aabb1f6559d6ae439adeb0691a0124527536cb This is problematic with required and the autogenerated rro modules. The autogenerated rro modules are created from an app module, so it will copy the app's required modules. The autogenerated rro modules are installed to different partitions from the origional app, so if you have an app that depends on another app, the second app will not be installed into two different partitions because we filter by partition, but the odex/vdex files will be installed from two different sources to the system_other image and conflict. Bug: 392702675 Test: m nothing on the failing product Change-Id: Icbe228a92187bea850908b79571b209475ede77a
2025-01-27Always generate -host phony target for host modules Spandan Das
HostCross variants will create an additional -host-cross phony. This matches the implementation in build/make/core/base_rules.mk With this CL, phony targets like `adb-host` will be created. Test: verified that adb-host phony exists in soong only build Change-Id: I9daf890bbde7e27c49a3f9f8ba78238991a8cf43
2025-01-24Create a host/target phony target for soong modules Spandan Das
This phony target will be responsible for building the specific device/host variant of a module. These phony targets are useful for local development as well as for atest. Test: m nothing Change-Id: Id3cd92f49bdc834866a8c2083ef5212ab7263bbc
2025-01-23Convert android_app and android_test's module-info.json to soong Cole Faust
This produces the following diffs, which I beleive are benign: https://paste.googleplex.com/5631028455276544 We need to convert these to soong so that you can run these tests with atest in soong-only builds. Bug: 389720048 Test: diff'd out/target/product/vsoc_x86_64/module-info.json Change-Id: Ic25e14d2cfbb56d9527302baefa6f69f55f113ee
2025-01-23Clean up some of the code around effective license. Yu Liu
Bug: 377723687 Test: Unit tests and compare the ninja and mk files generated. Change-Id: I01f0407e4eb6050b556bfebc1cc4d1abd29ad4a6
2025-01-22`m <module>` builds default output files as well Cole Faust
`m <module>` previously only built the installed files and the checkbuilded files. Also build the output files, because some modules like genrules don't have any installed/checkbuilded files, only output files, so before, they weren't able to be built with `m <module>` Bug: 376727180 Test: m trusty-x86_64.lk.elf.gen Change-Id: I8f4ce48f2c6c493b8a624b3be7b5238008272f90
2025-01-21Remove --skip-make Cole Faust
This should no longer be used. Bug: 376727180 Test: Presubmits Change-Id: Ib85902c2c9841e32660bc3879514b12175da438e
2025-01-15Convert dex2oatPathFromDep to use ModuleProxy. Yu Liu
Bug: 377723687 Test: Unit tests and compare the ninja and mk files generated. Change-Id: I99ffe88179991da8e5963605bf76666c8945d290
2025-01-15Convert collectDirectDepsProviders, collectTransitiveSrcFiles and Yu Liu
r8Flags to use ModuleProxy. Bug: 377723687 Test: Unit tests and compare the ninja and mk files generated. Change-Id: Ib3d45c317e1f2669808d0c785454fb8d8fb9cd3b
2025-01-15Convert collectJniDeps to use ModuleProxy. Yu Liu
Bug: 377723687 Test: Unit tests and compare the ninja and mk files generated. Change-Id: I36f8b339f70ab47be84c598231cb971145fc4ef7