summaryrefslogtreecommitdiff
path: root/android/singleton.go
AgeCommit message (Collapse)Author
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-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-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-11Allow calling ctx.DistForGoal from Singletons Cole Faust
Right now singletons have to dist files in either in MakeVars providers. Allow dist from GenerateBuildActions so that we can further remove our reliance on make. Bug: 395184523 Test: m nothing --no-skip-soong-tests Change-Id: Ie3004c2b038b45754279dfadcb7f7455ae740136
2024-11-07Replace FinalModule with IsFinalModule. Yu Liu
Bug: 377723687 Test: Compare generated mk and ninja files. Change-Id: I287b5a56aebf5fed0911bf8fbfc968d7aebc0dea
2024-11-06Collect kythe, obj and tidy files using ModuleProxy. Yu Liu
Bug: 358427516 Test: Manually compare the generated mk and ninja files. Change-Id: Ibee605372b1fae48ee9fbd8872b4ea0f6b1d5a7d
2024-09-11Add HasMutatorFinished Cole Faust
To enforce that selects are only evaluated after a certain point in a followup cl. Bug: 323382414 Test: m nothing --no-skip-soong-tests Change-Id: Ib215fedb904aa2e5f4d65cfd26a23f527eb4983e
2024-08-19Add phonies as provider instead of updaing a global map. Yu Liu
Bug: 358425833 Test: Manually compare the generated mk and ninja files. Change-Id: Ie74b620fc680ca2fc0d7836e88361ab3bdb87c49
2024-08-12Merge SingletonProviderContext with OtherModuleProviderContext Yu Liu
Bug: 358425833 Test: CI Change-Id: I8e3f40dc3cfc5337008b419801f8e6bf2d48e8b2
2024-05-02Make the enabled property configurable Cole Faust
This allows using select statements with it. Bug: 323382414 Test: m nothing --no-skip-soong-tests Change-Id: I6f3efaaa3d82505e38a91ee4ba0e18e404360191 Merged-In: If355d24506e3f117d27b21442a6c02bca3402dc7
2024-03-25Implement OtherModulePropertyErrorf proxies Cole Faust
Also move EvaluateConfiguration() to a standalone configurationEvalutor object, which can be constructed from a ModuleBase and a minimial context. This allows us to evaluate configurable properties in scenarios where we don't have much more than the module. Bug: 323382414 Test: m nothing --no-skip-soong-tests Change-Id: I2d1c9f42a469c399f34c759410509aeae095becb
2024-03-20Add more specific partition visibility rules Cole Faust
//visibility:any_system_partition, //visibility:any_vendor_partition, etc. Then, if a partition visibility rule is not specificed, but the module is installed on a non-system partition via the `vendor: true` or other properties, the visibility rule for that partition will be added by default. This is so that "any_partition" doesn't imply that modules could be put on the vendor partition when they weren't designed for that, and so that modules that do need to go on the vendor partition don't need to specify both vendor: true and visibility:any_vendor_partition. Eventually, the partition properties should be deprecated, and replaced with just these visibility rules. Bug: 321000103 Test: go tests Change-Id: I24dba36bbc20921941f892480bf7c050e93827c6
2024-02-07Add //visibility:any_partition Cole Faust
When we convert the partitions to be built with soong, there will likely be separate partition modules per product. This means that a lot of installable modules will have to be visible to a lot of partitions. To make this easier, add the //visibility:any_partition visibility spec, which allows the module to be used from any module of type android_filesystem or android_system_image. Fixes: 321000103 Test: go test Change-Id: Iea1f1ab7d88dfdb1fd00f19eb8c9941693a2375f
2024-01-18Remove SymlinkOutputs Cole Faust
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. Bug: 160568334 Test: Presubmits Change-Id: Ic368c48dd01b68e51c471c3fe90d0c02c55956e9
2023-12-14Convert ModuleProvder to generic providers API Colin Cross
Convert all of the callers of ModuleProvider/ModuleHasProvider to use the type-safe android.SingletonModuleProvider API. Bug: 316410648 Test: builds Change-Id: I6f11638546b64749e451cebbf33140248dc1d193
2023-12-14Use generics for providers API Colin Cross
Using generics for the providers API allows a type to be associated with a ProviderKey, resulting in a type-safe API without that doesn't require runtime type assertions by every caller. Unfortunately, Go does not allow generic types in methods, only in functions [1]. This prevents a type-safe API on ModuleContext, and requires moving the API to be functions that take a ModuleContext as a parameter. This CL creates the new API, but doesn't convert all of the callers. [1] https://go.googlesource.com/proposal/+/refs/heads/master/design/43651-type-parameters.md#no-parameterized-methods) Bug: 316410648 Test: builds Change-Id: I3e30d68b966b730efd968166a38a25cc144bd6de
2022-05-20Fix bug: allow multiple gen_notice modules. Bob Badour
Test: m cts dist reportmissinglicenses Change-Id: I07963c83eaddfe363a04871e813b56fe7f1465ad
2022-05-18Add gen_notice module. Bob Badour
Refactor notices to support notices for multiple modules. Enforce visibility and handle missing dependencies. Bug: 213388645 Change-Id: Id6a81987f087419ad37d0cce57a71e8a7c4cd6e0
2021-08-27Rename BuildDir and NinjaBuildDir. Lukacs T. Berki
These are just out/ and out/soong/ and the old names were quite confusing. Test: Presubmits. Merged-In: I999ca62162062f27e449f83ffb00fa580d4065b8 Merged-In: I2fcd80a9e376a6842a06aa104a9f6f5c5e16f8c7 Change-Id: Ib481d2aac40df8da1b74174dc8ec576c1cb48be0
2020-10-19Add symlink_outputs support to Soong. Jingwen Chen
This CL adds symlink_outputs to various locations in Soong that creates actions that creates symlink outputs, and explicitly mark them as such. Test: m Bug: 160568334 Change-Id: I322751bada52a9f49011c74731d84761586e03e7
2020-09-17Add providers support Colin Cross
Propagate the providers methods from https://github.com/google/blueprint/pull/309 to Soong. Test: m checkbuild Change-Id: Iad7a9023df4421cd01dbb0518be0e85382097481
2020-06-09Define Soong phony rules in Make Colin Cross
To support dist-for-goals in Soong, we need to define all phony rules in Make so that dist-for-goals can insert additional dependencies on them. Collect all the phony rules in phonySingleton and write them out as Make rules when Soong is embedded in Make, or as blueprint.Phony rules when Soong is run standalone. Test: m checkbuild Change-Id: I68201eff30744b0f487fc4f11f033767b53a627d
2020-03-31Fix RuleBuilder remoteable actions running in the local pool. Ramy Medhat
This CL fixes a bug with RuleBuilder's handling of remoteable actions. It adds a new type of pool to identify remoteable rules by the android module context. The pool is then set to nil to actually run actions at NINJA_REMOTE_NUM_JOBS parallelism. Test: built aosp crosshatch userdebug Change-Id: I29452f6fc7a161b94189731e3e3cc1f34907b80c
2020-01-24Create a highmem pool and put metalava into it Colin Cross
Create a highmem pool based on the total RAM and the number of CPUs, with an override via the NINJA_HIGHMEM_NUM_JOBS variable. Put metalava into the highmem pool. Ninja does not support nested pools, and when goma or RBE is enabled the maximum ninja parallelism is set very high with local jobs in a local pool. When both the local pool and highmem pool are enabled, the total number of local jobs will be as high as the sum of the sizes of the two pools. Keep the highmem pool limited to 1/16th of the local pool when remote builds are enabled to try to minimize the effect while still limiting highmem jobs. Fixes: 142644983 Test: m nothing, examine pools Test: m USE_GOMA=true nothing, examine pools Change-Id: Id79f11f44948992960ac34ecf831dacbe21bd332
2020-01-11Sandbox soong_build by changing to root directory Colin Cross
This relands I12a0f907753fefd1997ab8b4ea2ac331234093cf along with a fix to blueprint for absolute paths. Store the current working directory and then change to the root directory so that all file accesses must go through helpers in the android package that properly track dependencies. Change-Id: I24ac485677aa102eec1a2521d16820da6ee1ae77 Fixes: 146437378 Test: m checkbuild Test: m OUT_DIR=/tmp/out nothing
2020-01-10Revert "Sandbox soong_build by changing to root directory" Colin Cross
This reverts commit 05c25ccb4adb5329add700b533416c226cdbfa96. Reason for revert: broke absolute OUT_DIR Bug: 146437378 Change-Id: I523ed79d40e1c1ef040212ba794a7a084abea75d
2020-01-09Sandbox soong_build by changing to root directory Colin Cross
Store the current working directory and then change to the root directory so that all file accesses must go through helpers in the android package that properly track dependencies. Fixes: 146437378 Test: m checkbuild Change-Id: I12a0f907753fefd1997ab8b4ea2ac331234093cf
2019-11-05Run non-RBE supported actions in the local pool when USE_RBE is set. Ramy Medhat
Bug: 143938974 Test: ran CTS build at -j500 successfully. Change-Id: I55074bd67308cd716972e24fb56a20bc393d5d9d
2019-10-17Merge "Add SingletonContext::VisitDirectDepths[If] to Android proxy." Treehugger Robot
2019-10-16Add SingletonContext::VisitDirectDepths[If] to Android proxy. Mitch Phillips
Adds the VisitDirectDepths[If] function from blueprint to the Android SingletonContext proxy. Bug: N/A Test: N/A Change-Id: I4037364ef11b545abc9a383db7e1e818854db68f
2019-10-01Use localPool consistently for UseGoma() == true Colin Cross
Remove the distinction between pctx.StaticRule and pctx.AndroidStaticRule so that all of the local rules correctly get assigned to the localPool. Also put Module and Singleton rules into the localPool. Test: compare out/soong/build.ninja Change-Id: Id2bb38eff3c7209340fe55bc9006f00bd3661d81
2019-03-05Support testing Rules in Modules and Rules and Builds in Singletons Colin Cross
Add support for TestingModule to return RuleParams for rules created by the module. Refactor TestingModule to use helpers, and use the helpers to implement a similar TestingSingleton. Use the new functionality to test RuleBuilder's module and singleton rules. Test: none Change-Id: I8348c56ff5086d0c49401f5a00faf7c864e6b6f3
2019-02-07Make MakeVarsContext a PathContext Colin Cross
Expose all of SingletonContext to makeVarsContext, and then export the subset of it that is used through MakeVarsContext.SingletonContext, plus what is necessary for PathContext, directly through MakeVarsContext. Test: m checkbuild Change-Id: Ie00f36e577fe110b6fa03b901da489d8547773c6
2018-09-28Add phony targets for go binary modules Colin Cross
Add custom handling to androidmk.go for the bootstrap.GoBinaryTool interface in order to create .PHONY targets for each tool written in go. Bug: 64539926 Test: m checkbuild Test: m androidmk Test: m multiproduct_kati Change-Id: Ic65faa27a6ee4dfbd54ed6d208091db7c1d657a2
2018-06-22Use WalkDeps instead of VisitDepsDepthFirst Colin Cross
VisitDepsDepthFirst is almost never correct, as it can't query dependency tags of multiple dependencies between the same two modules. Replace VisitDepsDepthFirst with WalkDeps in sanitize.go and python.go. Also verify the dependency tag before continuing to recurse to ensure that they don't recurse through genrules and into unrelated modules. Test: m checkbuild Change-Id: I2f7560126f56b51a40ec39dfbdcc18b5891489f7
2017-12-12Make SingletonContext.Rule take a blueprint.RuleParams Colin Cross
Make the currently-unused SingletonContext.Rule match ModuleContext.Rule and take a blueprint.RuleParams instead of an android.RuleParams, and delete android.RuleParams. Test: m checkbuild Change-Id: I018685a3dc13f60825b5ba383ef365df2bc98dfc
2017-11-30Make *Context.Config return a Config instead of a interface{} Colin Cross
In Soong, a Config() method will always return a Config. Make ModuleContext, SingletonContext, TopDownMutatorContext and BottomUpMutatorContext's Config() methods explictly return a Config to avoid having to type-assert everywhere. Overriding the Config method requires duplicating the list of methods in blueprint.BaseModuleContext and blueprint.BottomUpMutatorContext, following the same pattern used by the other *Contexts. Config() obsoletes the AConfig() method used in some places, which will be cleaned up in the next patch. Test: m checkbuild Change-Id: Ibe21efde933959811d52443496967ab8ce71215e
2017-11-29Wrap PackageContext and SingletonContext Colin Cross
Wrap blueprint.PackageContext so that the *Func methods can provide an android.Config instead of an interface{}. The modified signatures means that every method in ModuleContext and SingletonContext that takes a blueprint.PackageContext now needs to be wrapped to take an android.PackageContext. SingletonContext wasn't previously wrapped at all, but as long as it is, wrap everything like ModuleContext does. This requires updating every Singleton to use the android-specific methods. Test: builds, all Soong tests pass Change-Id: I4f22085ebca7def6c5cde49e8210b59d994ba625