From d36c8d400c6fe78465e7ab690534ac83c61462aa Mon Sep 17 00:00:00 2001 From: Googler Date: Tue, 18 Jun 2019 00:21:29 -0700 Subject: [PATCH] Refactor rules_cc to follow https://docs.bazel.build/versions/master/skylark/deploying.html RELNOTES: None. PiperOrigin-RevId: 253736769 Change-Id: Ib13ecb077559f890aa3cc207b7ec1a53ac18d553 --- README.md | 2 +- WORKSPACE | 4 ++-- cc/{rules.bzl => defs.bzl} | 0 cc/{deps.bzl => repositories.bzl} | 4 +++- examples/my_c_archive/BUILD | 2 +- 5 files changed, 7 insertions(+), 5 deletions(-) rename cc/{rules.bzl => defs.bzl} (100%) rename cc/{deps.bzl => repositories.bzl} (87%) diff --git a/README.md b/README.md index fcd14f6..cbcd016 100644 --- a/README.md +++ b/README.md @@ -26,7 +26,7 @@ http_archive( Then, in your BUILD files, import and use the rules: ``` -load("@rules_cc//cc:rules.bzl", "cc_library") +load("@rules_cc//cc:defs.bzl", "cc_library") cc_library( ... ) diff --git a/WORKSPACE b/WORKSPACE index c457feb..4641008 100644 --- a/WORKSPACE +++ b/WORKSPACE @@ -81,5 +81,5 @@ load("@io_bazel_rules_go//go:deps.bzl", "go_rules_dependencies", "go_register_to go_rules_dependencies() go_register_toolchains() -load("//cc:deps.bzl", "rules_cc_deps") -rules_cc_deps() +load("//cc:repositories.bzl", "rules_cc_dependencies") +rules_cc_dependencies() diff --git a/cc/rules.bzl b/cc/defs.bzl similarity index 100% rename from cc/rules.bzl rename to cc/defs.bzl diff --git a/cc/deps.bzl b/cc/repositories.bzl similarity index 87% rename from cc/deps.bzl rename to cc/repositories.bzl index f4a6210..d892188 100644 --- a/cc/deps.bzl +++ b/cc/repositories.bzl @@ -1,6 +1,8 @@ +"""Repository rules entry point module for rules_cc.""" + load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive") -def rules_cc_deps(): +def rules_cc_dependencies(): _maybe( http_archive, name = "bazel_skylib", diff --git a/examples/my_c_archive/BUILD b/examples/my_c_archive/BUILD index a734c66..164ff65 100644 --- a/examples/my_c_archive/BUILD +++ b/examples/my_c_archive/BUILD @@ -17,7 +17,7 @@ licenses(["notice"]) load("//examples/my_c_compile:my_c_compile.bzl", "my_c_compile") load("//examples/my_c_archive:my_c_archive.bzl", "my_c_archive") -load("//cc:rules.bzl", "cc_binary") +load("//cc:defs.bzl", "cc_binary") cc_binary( name = "main",