Stop creating unnecessary Context objects
Previously, the Context object created in the main() method was initialized (ctx.Register()) for the main soong build. Build modes that did not want that build modes that did not want that (symlink, bp2build, apiBp2build) had to create their own context, or in the case of runSymlinkForestCreation its own EventHandler. That was very confusing. This change avoids that by simply pushing the call to ctx.Register() into the build modes that require it and that allows the other build modes to use the main context and its EventHandler. One point to note is that to ensure the exact same initialization as before the runApiBp2build has to explicitly call the following: ctx.SetAllowMissingDependencies(false) That is because the main context could have that set to true. Bug: 257650737 Test: m nothing Change-Id: Iee239fb87edf443fed65156fa14b8a30c89a2328
Loading
Please register or sign in to comment