2021-11-17 05:30:32 +00:00
|
|
|
# Copyright 2019 The Bazel Authors. All rights reserved.
|
|
|
|
#
|
|
|
|
# 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.
|
|
|
|
|
|
|
|
# LOCAL MODIFICATIONS
|
2022-04-05 20:38:54 +00:00
|
|
|
# this has a PR patched in on top of the original
|
2021-11-17 05:30:32 +00:00
|
|
|
# https://github.com/bazelbuild/bazel-skylib/blob/7b859037a673db6f606661323e74c5d4751595e6/rules/private/copy_file_private.bzl
|
2022-04-05 20:38:54 +00:00
|
|
|
# https://github.com/bazelbuild/bazel-skylib/pull/324
|
2021-11-17 05:30:32 +00:00
|
|
|
|
|
|
|
"""A rule that copies a file to another place.
|
|
|
|
|
2024-08-08 19:56:11 +00:00
|
|
|
`native.genrule()` is sometimes used to copy files (often wishing to rename them).
|
|
|
|
The `copy_file` rule does this with a simpler interface than genrule.
|
2021-11-17 05:30:32 +00:00
|
|
|
|
2024-08-08 19:56:11 +00:00
|
|
|
The rule uses a Bash command on Linux/macOS/non-Windows, and a `cmd.exe` command
|
2021-11-17 05:30:32 +00:00
|
|
|
on Windows (no Bash is required).
|
2022-04-01 03:04:35 +00:00
|
|
|
|
2024-08-08 19:56:11 +00:00
|
|
|
This fork of bazel-skylib's copy_file adds `DirectoryPathInfo` support and allows multiple
|
|
|
|
`copy_file` rules in the same package.
|
2021-11-17 05:30:32 +00:00
|
|
|
"""
|
|
|
|
|
|
|
|
load(
|
|
|
|
"//lib/private:copy_file.bzl",
|
2023-11-16 15:15:50 +00:00
|
|
|
_COPY_FILE_TOOLCHAINS = "COPY_FILE_TOOLCHAINS",
|
2021-11-17 05:30:32 +00:00
|
|
|
_copy_file = "copy_file",
|
2022-04-12 20:58:30 +00:00
|
|
|
_copy_file_action = "copy_file_action",
|
2021-11-17 05:30:32 +00:00
|
|
|
)
|
|
|
|
|
|
|
|
copy_file = _copy_file
|
2022-04-12 20:58:30 +00:00
|
|
|
copy_file_action = _copy_file_action
|
2023-11-16 15:15:50 +00:00
|
|
|
COPY_FILE_TOOLCHAINS = _COPY_FILE_TOOLCHAINS
|