def _xcodeproj_transition_impl(settings, attr):
    """Transition that applies command-line settings for the xcodeproj rule."""
    features = settings.get("//command_line_option:features", [])

    if attr.build_mode == "bazel":
        archived_bundles_allowed = attr.archived_bundles_allowed
        compilation_mode = "dbg"
        features = [
            "oso_prefix_is_pwd",
            "relative_ast_path",
        ] + features
    else:
        archived_bundles_allowed = True
        compilation_mode = settings["//command_line_option:compilation_mode"]

    return {
        "//command_line_option:compilation_mode": compilation_mode,
        "//command_line_option:features": features,
        "//xcodeproj/internal:archived_bundles_allowed": (
            archived_bundles_allowed
        ),
        "//xcodeproj/internal:build_mode": attr.build_mode,
    }