This new test rule compares two files and passes
if the files match.
On Linux/macOS/non-Windows, the test compares
files using 'diff'.
On Windows, the test compares files using
'fc.exe'. This utility is available on all Windows
versions I tried (Windows 2008 Server, Windows
2016 Datacenter Core).
See https://github.com/bazelbuild/bazel/issues/5508
See https://github.com/bazelbuild/bazel/issues/4319
Move maprule() to a private directory, to
discourage use of it. I (@laszlocsomor) am
planning breaking changes to it.
Also move private files (rule implementations) to
a subdirectory "rules/private/", to clean up the
"rules/" directory.
This PR adds two new rules: write_file and
write_xfile.
Both rules solve a common problem: to write a text
file with user-defined contents.
The problem is routinely solved using a genrule.
That however requires Bash, since genrules execute
Bash commands. Requiring Bash is a problem on
Windows.
The new rules do not require any shell.
The only difference between the rules is that
write_xfile creates an executable file while
write_file doesn't.
See https://github.com/bazelbuild/bazel/issues/4319
This PR adds two new rules: copy_file and
copy_xfile.
Both rules solve a common problem: to copy one
file to another location. The problem is routinely
solved using a genrule. That however requires
Bash, since genrules execute Bash commands.
Requiring Bash is a problem on Windows.
The new rules do not require Bash on Windows (only
on other platforms).
The only difference between the rules is that
copy_xfile creates an executable file while
copy_file doesn't.
See https://github.com/bazelbuild/bazel/issues/4319