Skip to content

Instantly share code, notes, and snippets.

@ashi009
Last active December 7, 2018 13:59
Show Gist options
  • Save ashi009/bf09b61d7a076aa8ed59d9c06cc6b378 to your computer and use it in GitHub Desktop.
Save ashi009/bf09b61d7a076aa8ed59d9c06cc6b378 to your computer and use it in GitHub Desktop.
diff --git a/README.md b/README.md
index 20d88da..ffb8457 100644
--- a/README.md
+++ b/README.md
@@ -1 +1 @@
-# This is not patched
+# THIS IS PATCHED
genrule(
name = "readme",
srcs = ["@com_github_ashi009_bazel_repo_rule_test//:README.md"],
outs = ["readme"],
cmd = "cat $(location @com_github_ashi009_bazel_repo_rule_test//:README.md) | tee $@",
)
load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive")
def test_patched_dependency():
http_archive(
name = "com_github_ashi009_bazel_repo_rule_test",
patch_args = ["-p1"],
patches = ["//:readme.patch"],
strip_prefix = "bazel-repo-rule-test-5689dd63c35cef83099a270970aad889f22a2909",
type = "zip",
urls = ["https://codeload.github.com/ashi009/bazel-repo-rule-test/zip/5689dd63c35cef83099a270970aad889f22a2909"],
)
load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive")
def test_dependency():
http_archive(
name = "com_github_ashi009_bazel_repo_rule_test",
strip_prefix = "bazel-repo-rule-test-5689dd63c35cef83099a270970aad889f22a2909",
type = "zip",
urls = ["https://codeload.github.com/ashi009/bazel-repo-rule-test/zip/5689dd63c35cef83099a270970aad889f22a2909"],
)
load("//:test.bzl", "test_dependency", "test_patched_dependency")
test_dependency()
load("//:test-patched.bzl", "test_patched_dependency")
test_patched_dependency()
# bazel build //:readme
# # This is not patched
load("//:test-patched.bzl", "test_patched_dependency")
test_patched_dependency()
load("//:test.bzl", "test_dependency")
test_dependency()
# bazel build //:readme
# # THIS IS PATCHED
@ashi009
Copy link
Author

ashi009 commented Dec 7, 2018

The repository being loaded is at https://github.com/ashi009/bazel-repo-rule-test

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment