| # Copyright 2024 The Fuchsia Authors. All rights reserved. |
| # Use of this source code is governed by a BSD-style license that can be |
| # found in the LICENSE file. |
| |
| # Macros to be used as part of the retirement of API levels. |
| # |
| # C++ code in non-fuchsia.git repositories that are part of the GN build graph |
| # (e.g., vendor/*) can reference these to disable code atomically with the |
| # retirement of these API levels. |
| # |
| # Note that these macros are not part of the proper "platform versioning model" |
| # and must never be exported via the IDK. They should only exist briefly (on |
| # the order of a few days) for coordinating changes between repositories. See |
| # https://fxbug.dev/331691736 for more discussion of this technique. |
| # |
| # In such situations, follow these steps: |
| # |
| # 1. File a bug for the API level retirement process. |
| # 2. Submit a CL in fuchsia.git that defines a macro like this in this build |
| # rule: |
| # |
| # defines = [ |
| # # TODO(https://fxbug.dev/NNNN): Remove this once N is retired. |
| # "FUCHSIA_API_LEVEL_N_STILL_SUPPORTED" |
| # ] |
| # |
| # 3. Submit a CL in the other repository that removes the functionality as soon |
| # as the macro is deleted: |
| # |
| # In the non-fuchsia.git code's BUILD.gn rule, add: |
| # |
| # # TODO(https://fxbug.dev/NNNN): Remove this once N is retired. |
| # configs += ["//src/lib/versioning/version-history/cpp:level_retirement_macros"] |
| # |
| # In the C++ code itself add: |
| # |
| # // TODO(https://fxbug.dev/NNNN): Remove this once N is retired. |
| # #ifdef FUCHSIA_API_LEVEL_N_STILL_SUPPORTED |
| # UseASymbolFromApiLevelN(); |
| # #endif |
| # |
| # 4. Submit a CL in fuchsia.git that removes support for API level N _and_ |
| # deletes the macro from step (2). |
| # 5. Submit a CL in the other repository that removes the now-dead code and |
| # `config` argument. |
| # 6. Mark the bug from step (1) as fixed. |
| config("level_retirement_macros") { |
| defines = [] |
| } |