diff options
author | Yifan Hong <elsk@google.com> | 2024-04-03 16:14:00 -0700 |
---|---|---|
committer | Yifan Hong <elsk@google.com> | 2024-04-03 16:14:11 -0700 |
commit | ce02d491b0e73168097c6ea899db6556a67fed09 (patch) | |
tree | da539b8d14fd69491b5ba5311ce1717526ebe243 | |
parent | 94480f0018262e293e810b7d3a682c0ddb62c294 (diff) | |
download | bazel_common_rules-ce02d491b0e73168097c6ea899db6556a67fed09.tar.gz |
Delete test_mappings/.
Usages have been cleaned up.
Test: TH
Bug: 329305827
Bug: 330775243
Change-Id: I9055e3d6fbe58fdaa7cbf3a2155c0bde27abec93
-rw-r--r-- | test_mappings/BUILD | 17 | ||||
-rw-r--r-- | test_mappings/test_mappings.bzl | 75 | ||||
-rwxr-xr-x | test_mappings/test_mappings.sh | 75 |
3 files changed, 0 insertions, 167 deletions
diff --git a/test_mappings/BUILD b/test_mappings/BUILD deleted file mode 100644 index 24c5e7d..0000000 --- a/test_mappings/BUILD +++ /dev/null @@ -1,17 +0,0 @@ -# Copyright (C) 2022 The Android Open Source Project -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -exports_files([ - "test_mappings.sh", -]) diff --git a/test_mappings/test_mappings.bzl b/test_mappings/test_mappings.bzl deleted file mode 100644 index cef9fc3..0000000 --- a/test_mappings/test_mappings.bzl +++ /dev/null @@ -1,75 +0,0 @@ -# Copyright (C) 2022 The Android Open Source Project -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -"""**DEPRECATED.** Declares an executable with test mapping archive.""" - -load("//build/bazel_common_rules/exec:embedded_exec.bzl", "embedded_exec") - -# TODO(b/330775243): Delete the whole package. -def test_mappings_dist( - name, - dist_dir = None, - **kwargs): - """**DEPRECATED.** Declares an executable with test mapping archive. - - Run this target to generate test mapping archive to the location given - by `--dist_dir` command-line argument. If `--dist_dir` command-line argument - is not specified, default to the `dist_dir` argument of this rule. - - For example: - - ``` - test_mappings( - name = "my_test_mappings", - dist_dir = "out/dist", - ) - ``` - - ``` - # generate to <workspace_root>/out/dist - $ bazel run my_test_mappings - - # generate to <workspace_root>/path - $ bazel run my_test_mappings -- --dist_dir=path - - # generate to /tmp/path - $ bazel run my_test_mappings -- --dist_dir=/tmp/path - ``` - - Args: - name: name of this target. - dist_dir: distribution directory - **kwargs: Additional arguments to the internal rule, e.g. `visibility`. - - Deprecated: - Use `//kernel/tests/test_mappings:test_mappings_zip` instead. - """ - - # buildifier: disable=print - print("""\ -WARNING: //build/bazel_common_rules/test_mappings is deprecated. - Use //kernel/tests/test_mappings:test_mappings_zip instead.""") - - native.sh_binary( - name = name + "_internal", - srcs = ["//build/bazel_common_rules/test_mappings:test_mappings.sh"], - data = ["//prebuilts/build-tools:linux-x86"], - args = ["--dist_dir", dist_dir] if dist_dir else None, - **kwargs - ) - - embedded_exec( - name = name, - actual = name + "_internal", - ) diff --git a/test_mappings/test_mappings.sh b/test_mappings/test_mappings.sh deleted file mode 100755 index dad3828..0000000 --- a/test_mappings/test_mappings.sh +++ /dev/null @@ -1,75 +0,0 @@ -#!/bin/bash -e - -# Copyright (C) 2022 The Android Open Source Project -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -echo "**DEPRECATED.** Use //kernel/tests/test_mappings:test_mappings_zip instead." >&2 - -# Ensure hermeticity. -PATH="$PWD/prebuilts/build-tools/path/linux-x86/:$PWD/prebuilts/build-tools/linux-x86/bin/" - -while [[ $# -gt 0 ]]; do - case $1 in - --dist_dir) - DIST_DIR="$2" - shift # past argument - shift # past value - ;; - --dist_dir=*) - DIST_DIR=$1 - DIST_DIR="${DIST_DIR#*=}" - shift # past argument=value - ;; - -*|--*) - # There may be additional arguments passed to copy_to_dist_dir. Ignore them. - shift - ;; - *) - # There may be additional arguments passed to copy_to_dist_dir. Ignore them. - shift - ;; - esac -done - -# BUILD_WORKSPACE_DIRECTORY is the root of the Bazel workspace containing -# this binary target. -# https://docs.bazel.build/versions/main/user-manual.html#run -ROOT_DIR=$BUILD_WORKSPACE_DIRECTORY -if [[ -z "$ROOT_DIR" ]]; then - echo "ERROR: Only execute this script with bazel run." >&2 - exit 1 -fi - -if [[ -z "$DIST_DIR" ]]; then - echo "ERROR: --dist_dir is not specified." >&2 - exit 1 -fi - -if [[ ! "$DIST_DIR" == /* ]]; then - DIST_DIR=${ROOT_DIR}/${DIST_DIR} -fi -mkdir -p ${DIST_DIR} - -OUTPUT_FILE=${DIST_DIR}/test_mappings.zip -echo "Generating ${OUTPUT_FILE}" - -trap 'rm -f "$TMPFILE"' EXIT -TEST_MAPPING_FILES=$(mktemp) -find ${ROOT_DIR} -path "${ROOT_DIR}/out*" -prune -o \ - -name TEST_MAPPING -type f \ - -not -path "${ROOT_DIR}/\.git*" \ - -not -path "${ROOT_DIR}/\.repo*" \ - -print > ${TEST_MAPPING_FILES} -soong_zip -o ${OUTPUT_FILE} -C ${ROOT_DIR} -l ${TEST_MAPPING_FILES} -rm -f ${TEST_MAPPING_FILES} |