commit | 2d8e6397bdbe210d4cf7e54257b6b9502535f08f | [log] [tgz] |
---|---|---|
author | schmitt <schmitt@google.com> | Thu Jan 16 06:30:44 2020 -0800 |
committer | Copybara-Service <copybara-worker@google.com> | Thu Jan 16 06:31:43 2020 -0800 |
tree | 81db7f594dc80452b90baeb28289d70dd5afea87 | |
parent | a3ef825641049681ab42295523eac0fb6a545377 [diff] |
Don't expose used contexts for searching, instead use a callback. A context (or strategy) implementation is considered "used" if it is not only registered but also reachable from at least one mnemonic or set as a default. Some logic requires this information, for example to conditionally do some setup/cleanup if one of a set of strategies ended up being used. To localize the impact of the "used information propagation" this change removes the global way to inspect all registered contexts. Instead it introduces a callback mechanism where each context gets notified if it is used and can then invoke a callback which is listened to by the same logic that previously inspected all contexts. This approach can further be simplified in the future when the explicit notification is no longer necessary (contexts/strategies will only be instantiated if used, giving an implicit callback location). This is a precondition for disentangling context registration and context lifecycle management which will be concluded in a future change. RELNOTES: None PiperOrigin-RevId: 290055330
{Fast, Correct} - Choose two
Build and test software of any size, quickly and reliably.
Speed up your builds and tests: Bazel rebuilds only what is necessary. With advanced local and distributed caching, optimized dependency analysis and parallel execution, you get fast and incremental builds.
One tool, multiple languages: Build and test Java, C++, Android, iOS, Go, and a wide variety of other language platforms. Bazel runs on Windows, macOS, and Linux.
Scalable: Bazel helps you scale your organization, codebase, and continuous integration solution. It handles codebases of any size, in multiple repositories or a huge monorepo.
Extensible to your needs: Easily add support for new languages and platforms with Bazel's familiar extension language. Share and re-use language rules written by the growing Bazel community.
Follow our tutorials:
See CONTRIBUTING.md