-
-
Notifications
You must be signed in to change notification settings - Fork 88
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fix(write_source_files): fix writing to workspace root #53
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
- Loading branch information
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1,2 @@ | ||
bazel-* | ||
test-out/ |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -20,3 +20,17 @@ bzl_library( | |
"@bazel_tools//tools/build_defs/repo:utils.bzl", | ||
], | ||
) | ||
|
||
# write_source_files() to a git ignored subdirectory of the root | ||
load("//lib:write_source_files.bzl", "write_source_files") | ||
genrule( | ||
name = "write_source_file_root", | ||
outs = ["write_source_file-root_directory"], | ||
cmd = "mkdir -p $@ && echo 'test' > $@/test.txt", | ||
visibility = ["//visibility:private"], | ||
) | ||
write_source_files( | ||
name = "write_source_file_root-test", | ||
diff_test = False, | ||
files = {"test-out/dist/write_source_file_root-test": ":write_source_file_root"}, | ||
) | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Want to add There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Shouldn't tests be public? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Hm, the angle I was gettting at was whether this should be available to anyone who depends on our repository. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. It is private by default unless there is a default_visiblity in the BUILD to set another default |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
#!/bin/bash | ||
|
||
set -e | ||
|
||
bazel run //:write_source_file_root-test |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@gregmagolan did you actually get your
write_dist
running as a test? This only failed previously when doingbazel run
and notbazel test
...There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Needs an integration test but I'd prefer to avoid the added complexity of bazel-in-bazel