Skip to content

Commit d3c702d

Browse files
authored
Run buildifier to add missing loads (#581)
Run `buildifier --lint=fix -r -v .` Manually add dependencies to rules_cc where they are missing. See: bazelbuild/bazel#25755
1 parent 1935ada commit d3c702d

File tree

53 files changed

+113
-43
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

53 files changed

+113
-43
lines changed

android/firebase-cloud-messaging/WORKSPACE

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,12 +10,13 @@ http_archive(
1010
sha256 = RULES_JVM_EXTERNAL_SHA,
1111
strip_prefix = "rules_jvm_external-%s" % RULES_JVM_EXTERNAL_TAG,
1212
url =
13-
"https://github.com/bazelbuild/rules_jvm_external/releases/download/%s/rules_jvm_external-%s.tar.gz" % (RULES_JVM_EXTERNAL_TAG, RULES_JVM_EXTERNAL_TAG)
13+
"https://github.com/bazelbuild/rules_jvm_external/releases/download/%s/rules_jvm_external-%s.tar.gz" % (RULES_JVM_EXTERNAL_TAG, RULES_JVM_EXTERNAL_TAG),
1414
)
1515

1616
load("@rules_jvm_external//:defs.bzl", "maven_install")
1717

1818
maven_install(
19+
aar_import_bzl_label = "@rules_android//rules:rules.bzl",
1920
artifacts = [
2021
"com.google.firebase:firebase-messaging:17.0.0",
2122
"com.android.support:appcompat-v7:26.1.0",
@@ -30,9 +31,8 @@ maven_install(
3031
"https://maven.google.com",
3132
"https://repo1.maven.org/maven2",
3233
],
33-
version_conflict_policy = "pinned",
3434
use_starlark_android_rules = True,
35-
aar_import_bzl_label = "@rules_android//rules:rules.bzl",
35+
version_conflict_policy = "pinned",
3636
)
3737

3838
load("@maven//:compat.bzl", "compat_repositories")
@@ -61,11 +61,15 @@ http_archive(
6161
)
6262

6363
load("@rules_android//:prereqs.bzl", "rules_android_prereqs")
64+
6465
rules_android_prereqs()
66+
6567
load("@rules_android//:defs.bzl", "rules_android_workspace")
68+
6669
rules_android_workspace()
6770

6871
load("@rules_android//rules:rules.bzl", "android_sdk_repository")
72+
6973
# Requires that the ANDROID_HOME environment variable is set to the Android SDK path.
7074
android_sdk_repository(
7175
name = "androidsdk",

android/jetpack-compose/WORKSPACE

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,4 +40,3 @@ kotlin_repositories(
4040
load("@io_bazel_rules_kotlin//kotlin:core.bzl", "kt_register_toolchains")
4141

4242
kt_register_toolchains()
43-

android/ndk/MODULE.bazel

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ bazel_dep(name = "rules_android", version = "0.5.1")
77

88
maven = use_extension("@rules_jvm_external//:extensions.bzl", "maven")
99
maven.install(
10+
aar_import_bzl_label = "@rules_android//rules:rules.bzl",
1011
artifacts = [
1112
"androidx.appcompat:appcompat:1.5.1",
1213
"androidx.constraintlayout:constraintlayout:2.1.4",
@@ -25,6 +26,5 @@ maven.install(
2526
"https://repo1.maven.org/maven2",
2627
],
2728
use_starlark_android_rules = True,
28-
aar_import_bzl_label = "@rules_android//rules:rules.bzl",
2929
)
3030
use_repo(maven, "maven")

android/ndk/WORKSPACE

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,11 +10,15 @@ http_archive(
1010
)
1111

1212
load("@rules_android//:prereqs.bzl", "rules_android_prereqs")
13+
1314
rules_android_prereqs()
15+
1416
load("@rules_android//:defs.bzl", "rules_android_workspace")
17+
1518
rules_android_workspace()
1619

1720
load("@rules_android//rules:rules.bzl", "android_sdk_repository")
21+
1822
# Requires that the ANDROID_HOME environment variable is set to the Android SDK path.
1923
android_sdk_repository(
2024
name = "androidsdk",

android/robolectric-testing/MODULE.bazel

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ bazel_dep(name = "rules_jvm_external", version = "5.3")
55

66
maven = use_extension("@rules_jvm_external//:extensions.bzl", "maven")
77
maven.install(
8-
artifacts = [
8+
artifacts = [
99
"org.robolectric:robolectric:4.9",
1010
"junit:junit:4.13.2",
1111
"com.google.truth:truth:1.1.3",
@@ -19,5 +19,4 @@ maven.install(
1919
"https://repo1.maven.org/maven2",
2020
],
2121
)
22-
2322
use_repo(maven, "maven")

bzlmod/01-depend_on_bazel_module/BUILD

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
load("@rules_cc//cc:cc_binary.bzl", "cc_binary")
2+
13
cc_binary(
24
name = "main",
35
srcs = ["main.cc"],

bzlmod/01-depend_on_bazel_module/MODULE.bazel

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,8 @@ module(
33
version = "0.0.1",
44
)
55

6+
bazel_dep(name = "rules_cc", version = "0.0.17")
7+
68
# 1. The metadata of glog is fetched from the BCR, including its dependencies (gflags).
79
# 2. The `repo_name` attribute allows users to reference this dependency via the `com_github_google_glog` repo name.
810
bazel_dep(name = "glog", version = "0.5.0", repo_name = "com_github_google_glog")

bzlmod/01-depend_on_bazel_module/WORKSPACE

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,12 @@
11
load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive")
22

3+
http_archive(
4+
name = "rules_cc",
5+
sha256 = "abc605dd850f813bb37004b77db20106a19311a96b2da1c92b789da529d28fe1",
6+
strip_prefix = "rules_cc-0.0.17",
7+
urls = ["https://github.com/bazelbuild/rules_cc/releases/download/0.0.17/rules_cc-0.0.17.tar.gz"],
8+
)
9+
310
http_archive(
411
name = "com_github_google_glog",
512
sha256 = "eede71f28371bf39aa69b45de23b329d37214016e2055269b3b5e7cfd40b59f5",

bzlmod/02-override_bazel_module/BUILD

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
load("@bazel_skylib//:version.bzl", "hello_msg")
2+
load("@rules_cc//cc:cc_binary.bzl", "cc_binary")
23

34
# buildifier: disable=print
45
print(hello_msg)

bzlmod/02-override_bazel_module/MODULE.bazel

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ module(
33
version = "0.0.1",
44
)
55

6+
bazel_dep(name = "rules_cc", version = "0.0.17")
67
bazel_dep(name = "glog", version = "0.5.0", repo_name = "com_github_google_glog")
78

89
# Override glog to a fork version with archive_override.

0 commit comments

Comments
 (0)