Skip to content

Commit 9c8c738

Browse files
authored
fix bazel files (.bzl BUILD WORKSPACE) format with buildifier (#102)
1 parent 7276428 commit 9c8c738

File tree

9 files changed

+312
-313
lines changed

9 files changed

+312
-313
lines changed

bazel/repositories.bzl

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

33
def cpp2sky_dependencies():
4-
rules_proto()
5-
skywalking_data_collect_protocol()
6-
com_github_grpc_grpc()
7-
com_google_googletest()
8-
com_google_protobuf()
9-
com_github_httplib()
10-
com_github_fmtlib_fmt()
11-
com_google_abseil()
12-
com_github_gabime_spdlog()
4+
rules_proto()
5+
skywalking_data_collect_protocol()
6+
com_github_grpc_grpc()
7+
com_google_googletest()
8+
com_google_protobuf()
9+
com_github_httplib()
10+
com_github_fmtlib_fmt()
11+
com_google_abseil()
12+
com_github_gabime_spdlog()
1313

1414
def skywalking_data_collect_protocol():
15-
http_archive(
16-
name = "skywalking_data_collect_protocol",
17-
sha256 = "4cf7cf84a9478a09429a7fbc6ad1e1b10c70eb54999438a36eacaf539a39d343",
18-
urls = [
19-
"https://github.com/apache/skywalking-data-collect-protocol/archive/v9.1.0.tar.gz"
20-
],
21-
strip_prefix = "skywalking-data-collect-protocol-9.1.0",
22-
)
15+
http_archive(
16+
name = "skywalking_data_collect_protocol",
17+
sha256 = "4cf7cf84a9478a09429a7fbc6ad1e1b10c70eb54999438a36eacaf539a39d343",
18+
urls = [
19+
"https://github.com/apache/skywalking-data-collect-protocol/archive/v9.1.0.tar.gz",
20+
],
21+
strip_prefix = "skywalking-data-collect-protocol-9.1.0",
22+
)
2323

2424
def com_github_grpc_grpc():
25-
http_archive(
26-
name = "com_github_grpc_grpc",
27-
sha256 = "1ccc2056b68b81ada8df61310e03dfa0541c34821fd711654d0590a7321db9c8",
28-
urls = ["https://github.com/grpc/grpc/archive/a3ae8e00a2c5553c806e83fae83e33f0198913f0.tar.gz"],
29-
strip_prefix = "grpc-a3ae8e00a2c5553c806e83fae83e33f0198913f0",
30-
)
25+
http_archive(
26+
name = "com_github_grpc_grpc",
27+
sha256 = "1ccc2056b68b81ada8df61310e03dfa0541c34821fd711654d0590a7321db9c8",
28+
urls = ["https://github.com/grpc/grpc/archive/a3ae8e00a2c5553c806e83fae83e33f0198913f0.tar.gz"],
29+
strip_prefix = "grpc-a3ae8e00a2c5553c806e83fae83e33f0198913f0",
30+
)
3131

3232
def rules_proto():
33-
http_archive(
34-
name = "rules_proto",
35-
sha256 = "66bfdf8782796239d3875d37e7de19b1d94301e8972b3cbd2446b332429b4df1",
36-
strip_prefix = "rules_proto-4.0.0",
37-
urls = [
38-
"https://github.com/bazelbuild/rules_proto/archive/refs/tags/4.0.0.tar.gz",
39-
],
40-
)
33+
http_archive(
34+
name = "rules_proto",
35+
sha256 = "66bfdf8782796239d3875d37e7de19b1d94301e8972b3cbd2446b332429b4df1",
36+
strip_prefix = "rules_proto-4.0.0",
37+
urls = [
38+
"https://github.com/bazelbuild/rules_proto/archive/refs/tags/4.0.0.tar.gz",
39+
],
40+
)
4141

4242
def com_google_googletest():
43-
http_archive(
44-
name = "com_google_googletest",
45-
sha256 = "7897bfaa5ad39a479177cfb5c3ce010184dbaee22a7c3727b212282871918751",
46-
strip_prefix = "googletest-a4ab0abb93620ce26efad9de9296b73b16e88588",
47-
urls = ["https://github.com/google/googletest/archive/a4ab0abb93620ce26efad9de9296b73b16e88588.tar.gz"],
48-
)
43+
http_archive(
44+
name = "com_google_googletest",
45+
sha256 = "7897bfaa5ad39a479177cfb5c3ce010184dbaee22a7c3727b212282871918751",
46+
strip_prefix = "googletest-a4ab0abb93620ce26efad9de9296b73b16e88588",
47+
urls = ["https://github.com/google/googletest/archive/a4ab0abb93620ce26efad9de9296b73b16e88588.tar.gz"],
48+
)
4949

5050
def com_google_protobuf():
51-
http_archive(
52-
name = "com_google_protobuf",
53-
sha256 = "89ac31a93832e204db6d73b1e80f39f142d5747b290f17340adce5be5b122f94",
54-
strip_prefix = "protobuf-3.19.4",
55-
urls = ["https://github.com/protocolbuffers/protobuf/releases/download/v3.19.4/protobuf-cpp-3.19.4.tar.gz"],
56-
)
51+
http_archive(
52+
name = "com_google_protobuf",
53+
sha256 = "89ac31a93832e204db6d73b1e80f39f142d5747b290f17340adce5be5b122f94",
54+
strip_prefix = "protobuf-3.19.4",
55+
urls = ["https://github.com/protocolbuffers/protobuf/releases/download/v3.19.4/protobuf-cpp-3.19.4.tar.gz"],
56+
)
5757

5858
def com_github_httplib():
59-
http_archive(
60-
name = "com_github_httplib",
61-
sha256 = "0e424f92b607fc9245c144dada85c2e97bc6cc5938c0c69a598a5b2a5c1ab98a",
62-
strip_prefix = "cpp-httplib-0.7.15",
63-
build_file = "//bazel:httplib.BUILD",
64-
urls = ["https://github.com/yhirose/cpp-httplib/archive/v0.7.15.tar.gz"]
65-
)
59+
http_archive(
60+
name = "com_github_httplib",
61+
sha256 = "0e424f92b607fc9245c144dada85c2e97bc6cc5938c0c69a598a5b2a5c1ab98a",
62+
strip_prefix = "cpp-httplib-0.7.15",
63+
build_file = "//bazel:httplib.BUILD",
64+
urls = ["https://github.com/yhirose/cpp-httplib/archive/v0.7.15.tar.gz"],
65+
)
6666

6767
def com_github_fmtlib_fmt():
68-
http_archive(
69-
name = "com_github_fmtlib_fmt",
70-
sha256 = "23778bad8edba12d76e4075da06db591f3b0e3c6c04928ced4a7282ca3400e5d",
71-
strip_prefix = "fmt-8.1.1",
72-
build_file = "//bazel:fmtlib.BUILD",
73-
urls = ["https://github.com/fmtlib/fmt/releases/download/8.1.1/fmt-8.1.1.zip"],
74-
)
68+
http_archive(
69+
name = "com_github_fmtlib_fmt",
70+
sha256 = "23778bad8edba12d76e4075da06db591f3b0e3c6c04928ced4a7282ca3400e5d",
71+
strip_prefix = "fmt-8.1.1",
72+
build_file = "//bazel:fmtlib.BUILD",
73+
urls = ["https://github.com/fmtlib/fmt/releases/download/8.1.1/fmt-8.1.1.zip"],
74+
)
7575

7676
def com_github_gabime_spdlog():
77-
http_archive(
78-
name = "com_github_gabime_spdlog",
79-
sha256 = "6fff9215f5cb81760be4cc16d033526d1080427d236e86d70bb02994f85e3d38",
80-
strip_prefix = "spdlog-1.9.2",
81-
build_file = "//bazel:spdlog.BUILD",
82-
urls = ["https://github.com/gabime/spdlog/archive/v1.9.2.tar.gz"]
83-
)
77+
http_archive(
78+
name = "com_github_gabime_spdlog",
79+
sha256 = "6fff9215f5cb81760be4cc16d033526d1080427d236e86d70bb02994f85e3d38",
80+
strip_prefix = "spdlog-1.9.2",
81+
build_file = "//bazel:spdlog.BUILD",
82+
urls = ["https://github.com/gabime/spdlog/archive/v1.9.2.tar.gz"],
83+
)
8484

8585
def com_google_abseil():
86-
http_archive(
87-
name = "com_google_absl",
88-
sha256 = "5ca73792af71ab962ee81cdf575f79480704b8fb87e16ca8f1dc1e9b6822611e",
89-
strip_prefix = "abseil-cpp-6f43f5bb398b6685575b36874e36cf1695734df1",
90-
urls = ["https://github.com/abseil/abseil-cpp/archive/6f43f5bb398b6685575b36874e36cf1695734df1.tar.gz"],
91-
)
86+
http_archive(
87+
name = "com_google_absl",
88+
sha256 = "5ca73792af71ab962ee81cdf575f79480704b8fb87e16ca8f1dc1e9b6822611e",
89+
strip_prefix = "abseil-cpp-6f43f5bb398b6685575b36874e36cf1695734df1",
90+
urls = ["https://github.com/abseil/abseil-cpp/archive/6f43f5bb398b6685575b36874e36cf1695734df1.tar.gz"],
91+
)

cpp2sky/BUILD

Lines changed: 36 additions & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -4,49 +4,49 @@ load("@rules_proto//proto:defs.bzl", "proto_library")
44
licenses(["notice"]) # Apache 2
55

66
proto_library(
7-
name = "config_proto_lib",
8-
srcs = ["config.proto"],
7+
name = "config_proto_lib",
8+
srcs = ["config.proto"],
99
)
1010

1111
cc_proto_library(
12-
name = "config_cc_proto",
13-
deps = [":config_proto_lib"],
14-
visibility = ["//visibility:public"],
12+
name = "config_cc_proto",
13+
visibility = ["//visibility:public"],
14+
deps = [":config_proto_lib"],
1515
)
1616

1717
cc_library(
18-
name = "cpp2sky_interface",
19-
hdrs = [
20-
"tracer.h",
21-
"tracing_context.h",
22-
"propagation.h",
23-
"well_known_names.h",
24-
"exception.h",
25-
"time.h",
26-
"assert.h",
27-
"trace_log.h",
28-
],
29-
deps = [
30-
":config_cc_proto",
31-
],
32-
visibility = ["//visibility:public"],
18+
name = "cpp2sky_interface",
19+
hdrs = [
20+
"assert.h",
21+
"exception.h",
22+
"propagation.h",
23+
"time.h",
24+
"trace_log.h",
25+
"tracer.h",
26+
"tracing_context.h",
27+
"well_known_names.h",
28+
],
29+
visibility = ["//visibility:public"],
30+
deps = [
31+
":config_cc_proto",
32+
],
3333
)
3434

3535
cc_library(
36-
name = "cpp2sky_data_interface",
37-
hdrs = [
38-
"tracing_context.h",
39-
"propagation.h",
40-
"well_known_names.h",
41-
"exception.h",
42-
"time.h",
43-
"assert.h",
44-
],
45-
deps = [
46-
":config_cc_proto",
47-
"@com_google_absl//absl/memory:memory",
48-
"@com_google_absl//absl/strings:strings",
49-
"@com_google_absl//absl/types:optional",
50-
],
51-
visibility = ["//visibility:public"],
36+
name = "cpp2sky_data_interface",
37+
hdrs = [
38+
"assert.h",
39+
"exception.h",
40+
"propagation.h",
41+
"time.h",
42+
"tracing_context.h",
43+
"well_known_names.h",
44+
],
45+
visibility = ["//visibility:public"],
46+
deps = [
47+
":config_cc_proto",
48+
"@com_google_absl//absl/memory",
49+
"@com_google_absl//absl/strings",
50+
"@com_google_absl//absl/types:optional",
51+
],
5252
)

cpp2sky/internal/BUILD

Lines changed: 20 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -4,33 +4,33 @@ load("@rules_proto//proto:defs.bzl", "proto_library")
44
licenses(["notice"]) # Apache 2
55

66
cc_library(
7-
name = "async_client_interface",
8-
hdrs = [
9-
"async_client.h",
10-
],
11-
deps = [
12-
"@com_github_grpc_grpc//:grpc++",
13-
"@skywalking_data_collect_protocol//language-agent:tracing_protocol_cc_grpc",
14-
],
15-
visibility = ["//visibility:public"],
7+
name = "async_client_interface",
8+
hdrs = [
9+
"async_client.h",
10+
],
11+
visibility = ["//visibility:public"],
12+
deps = [
13+
"@com_github_grpc_grpc//:grpc++",
14+
"@skywalking_data_collect_protocol//language-agent:tracing_protocol_cc_grpc",
15+
],
1616
)
1717

1818
cc_library(
19-
name = "random_generator_interface",
20-
hdrs = [
21-
"random_generator.h",
22-
],
23-
visibility = ["//visibility:public"],
19+
name = "random_generator_interface",
20+
hdrs = [
21+
"random_generator.h",
22+
],
23+
visibility = ["//visibility:public"],
2424
)
2525

2626
cc_library(
27-
name = "stream_builder_interface",
28-
hdrs = ["stream_builder.h"],
29-
visibility = ["//visibility:public"],
27+
name = "stream_builder_interface",
28+
hdrs = ["stream_builder.h"],
29+
visibility = ["//visibility:public"],
3030
)
3131

3232
cc_library(
33-
name = "matcher_interface",
34-
hdrs = ["matcher.h"],
35-
visibility = ["//visibility:public"],
33+
name = "matcher_interface",
34+
hdrs = ["matcher.h"],
35+
visibility = ["//visibility:public"],
3636
)

example/BUILD

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,21 @@
11
load("@rules_cc//cc:defs.bzl", "cc_binary")
22

33
cc_binary(
4-
name = "sample",
5-
srcs = ["sample.cc"],
6-
deps = [
7-
"//cpp2sky:cpp2sky_interface",
8-
"//source:cpp2sky_lib",
9-
"@com_github_httplib//:httplib",
10-
],
4+
name = "sample",
5+
srcs = ["sample.cc"],
6+
deps = [
7+
"//cpp2sky:cpp2sky_interface",
8+
"//source:cpp2sky_lib",
9+
"@com_github_httplib//:httplib",
10+
],
1111
)
1212

1313
cc_binary(
14-
name = "sample_client",
15-
srcs = ["sample_client.cc"],
16-
deps = [
17-
"//cpp2sky:cpp2sky_interface",
18-
"//source:cpp2sky_lib",
19-
"@com_github_httplib//:httplib",
20-
],
14+
name = "sample_client",
15+
srcs = ["sample_client.cc"],
16+
deps = [
17+
"//cpp2sky:cpp2sky_interface",
18+
"//source:cpp2sky_lib",
19+
"@com_github_httplib//:httplib",
20+
],
2121
)

0 commit comments

Comments
 (0)