summaryrefslogtreecommitdiff
path: root/android/hooks.go
AgeCommit message (Collapse)Author
2020-06-04Add SrcPath to InstallHookContext David Srbecky
Needed by ART to find the intermediate files so that it can also install them in testcases directory for tests. Change-Id: If1b2ad132632c5dc7c6c7573b56680e2f422594a
2020-05-06Add hook to be called after defaults have been applied Paul Duffin
Previously, the only way for a module type to create modules (other than defining its own mutator) was to register a LoadHook. However, that is called before defaults are applied so any properties used in that hook cannot take advantage of defaults, e.g. java_sdk_library cannot use defaults to set its sdk_version property and have that affect its child modules. This change adds a new SetDefaultableHook() to DefaultableModule to register a hook that is called after any defaults have been applied. Also adds some tests to ensure that errors in the visibility property introduced in a DefaultableHook are reported in the gather phase of visibility processing. A follow up change will switch java_sdk_library to use that instead of the AddLoadHook() mechanism. Bug: 155295806 Test: m checkapi Change-Id: I13df3115f9e225f7324b6725eaeb16a78cc2538a
2020-01-28Follow input changes to proptools.CloneEmptyProperties Colin Cross
Test: m checkbuild Change-Id: I1fd53d03722d134009f7ed663f05bd6dc5980dd1
2020-01-24Simplify vendor conditionals Colin Cross
Support vendor conditionals with no Go code. Test: TestSoongConfigModule Change-Id: I42546e7f17324921ada80f4d8e1cd399830f8dfc
2020-01-06Use blueprint's load hooks Colin Cross
Make android.AddLoadHook wrap blueprint.AddLoadHook. Also pass the config object to ParseBlueprintsFiles. Test: all soong tests Change-Id: I60c988b717d395f52498ec23ef7c9046d9861a6e
2020-01-04Add EarlyModuleContext for LoadHookContext Colin Cross
Make LoadHookContext embed a new EarlyModuleContext instead of BaseModuleContext to reduce its API surface in preparation for moving it to run during parsing instead of mutators. Test: m checkbuild Change-Id: I1cd3ff3b636e7e24991a9184d7521903473e505a
2020-01-03Delete arch hooks Colin Cross
They are not used anywhere. Test: m checkbuild Change-Id: Ice7d68b97ca894c0c4c9efc6dc55c0870a132b9c
2019-10-03Separate InstallPath from OutputPath Colin Cross
Create a new type InstallPath that is similar to OutputPath to differentiate intermediates output paths from installed output paths. RelPathString is a poorly defined, undocumented function that is primarily used to get an install path relative to out/soong to generate an equivalent install path for Make relative to $(OUT_DIR). Move it to InstallPath for now, and fix the one remaining user on OutputPath. Add a method to create an NDK install path so that ndk_sysroot.go doesn't have to do it manually with PathForOutput. Bug: 141877526 Test: m checkbuild Change-Id: I83c5a0bd1fd6c3dba8d3b6d20d039f64f353ddd5
2019-09-26Make CreateModule return the newly created module Colin Cross
Allow mutators to modify properties of the newly created module by returning it. Test: m checkbuild Change-Id: I682caca86c0c8f7c3ae815a494d4c75962c8e2e8
2019-09-26Make CreateModule take an android.ModuleFactory Colin Cross
Reduce the boilerplate required to call CreateModule by taking an android.ModuleFactory instead of a blueprint.ModuleFactory. Test: m checkbuild Change-Id: I1259d2dd3f7893b5319c333bc180727ac40f9e91
2019-07-03Add a String() method to android.Module Colin Cross
Add a String() method to android.Module for use in debugging. Store the name and variations of the module as they are mutated. Test: TestModuleString Bug: 136473661 Change-Id: I74e393703dcfc96ed4e21ac4a4419a7858b59216
2019-06-06Consolidate baseContext, BaseContext, and BaseModuleContext Colin Cross
blueprint.BaseModuleContext is the set of methods available to all module-specific calls (GenerateBuildActions or mutators). The android package split the same functionality across baseContext (nee androidBaseContext), BaseModuleContext, and BaseContext. Consolidate all of them into android.BaseModuleContext. Test: m checkbuild Change-Id: I2d7f5c56fd4424032cb93edff6dc730ff33e4f1e
2019-06-06Remove repetition in android package names Colin Cross
Types in the android package don't need to be prefixed with 'android'. Test: m checkbuild Change-Id: Ieefcfc1a2c4161d9c412f40ef31867149ec21aec
2019-04-16Use LoadHook to create modules in java_sdk_library Colin Cross
Creating new modules in a mutator is dangerous, as other mutators that need to see the new modules may already have run, in this case the prebuilts mutator. Move SdkLibraryMutator to a LoadHook instead. Also moves registering the LoadHook mutator to testing.go so it is registered for all tests. Test: m checkbuild Change-Id: I08bd76a0e6205d2ca27861058067a1562c339eed
2019-02-13Create sysprop_library soong module Inseob Kim
A newly introduced sysprop_library soong module will generate a java_sdk_library and a cc_library from .sysprop description files. Both Java modules and C++ modules can link against sysprop_library module, thus giving consistency for using generated sysprop API. As Java controls accessibility of Internal / System properties with @hide and @SystemApi, 2 different header files will be created. And build system will selectively expose depending on the property owner and the place where the client libraries go into. Bug: 80125326 Bug: 122170616 Test: 1) Create sysprop_library module. Test: 2) Create empty txt files under prebuilts/sdk. Test: 3) Create api directory, make update-api, and see changes. Test: 4) Try to link against sysprop_library with various clients. Test: 5) Soc_specific, Device_specific, Product_specific, recovery flags work as intended. Change-Id: I78dc5780ccfbb4b69e5c61dec26b94e92d43c333
2017-11-30Replace ModuleContext.AConfig() with Config() Colin Cross
AConfig() now duplicates Config(). Replace the uses of AConfig() with Config(). Leave AConfig() for now until code in other projects is cleaned up. Test: m checkbuild Change-Id: Ic88be643049d21dba45dbd1a65588ed94bf43bdc
2017-11-07Let LoadHooks call CreateModule Colin Cross
Move AppendProperties and PrependProperties into TopDownMutatorContext so that LoadHooks can be a subset of TopDownMutatorContext that also includes CreateModule. Test: m checkbuild Bug: 35570956 Change-Id: Iffa6a6aec96f08821c2446e0e0f4622ab772b54c
2016-09-13Replace PropertyCustomizer with hooks Colin Cross
Replace PropertyCustomizer with a more extensible hooks mechanism. Instead of passing an object that satisifies an interface, pass a function pointer that takes a context interface as an argument. Callers can use lambdas to capture any other necessary parameters like property structs. Also add two new hooks, arch hooks that occur after splitting modules into arch variants, and install hooks that occur each time a file is installed to the output directory. Change-Id: I3a3e34aa97f1a92d3a31e5004b4b1ba68869d242