Skip to content
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

Split rust_library and add //rust:defs.bzl #592

Merged
merged 1 commit into from
Feb 19, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 5 additions & 2 deletions docs/BUILD
Original file line number Diff line number Diff line change
Expand Up @@ -31,9 +31,12 @@ PAGES = {
"cargo_build_script": [
"cargo_build_script",
],
"rust": [
"rust_library",
"defs": [
"rust_binary",
"rust_library",
"rust_static_library",
"rust_shared_library",
"rust_proc_macro",
"rust_benchmark",
"rust_test",
],
Expand Down
24 changes: 15 additions & 9 deletions docs/all.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -30,23 +30,26 @@ load(
_rust_proto_toolchain = "rust_proto_toolchain",
)
load(
"@rules_rust//rust:repositories.bzl",
_rust_repositories = "rust_repositories",
_rust_repository_set = "rust_repository_set",
_rust_toolchain_repository = "rust_toolchain_repository",
_rust_toolchain_repository_proxy = "rust_toolchain_repository_proxy",
)
load(
"@rules_rust//rust:rust.bzl",
"@rules_rust//rust:defs.bzl",
_rust_analyzer = "rust_analyzer",
_rust_benchmark = "rust_benchmark",
_rust_binary = "rust_binary",
_rust_clippy = "rust_clippy",
_rust_doc = "rust_doc",
_rust_doc_test = "rust_doc_test",
_rust_library = "rust_library",
_rust_proc_macro = "rust_proc_macro",
_rust_shared_library = "rust_shared_library",
_rust_static_library = "rust_static_library",
_rust_test = "rust_test",
)
load(
"@rules_rust//rust:repositories.bzl",
_rust_repositories = "rust_repositories",
_rust_repository_set = "rust_repository_set",
_rust_toolchain_repository = "rust_toolchain_repository",
_rust_toolchain_repository_proxy = "rust_toolchain_repository_proxy",
)
load(
"@rules_rust//rust:toolchain.bzl",
_rust_toolchain = "rust_toolchain",
Expand All @@ -61,8 +64,11 @@ load(
_rust_wasm_bindgen_toolchain = "rust_wasm_bindgen_toolchain",
)

rust_library = _rust_library
rust_binary = _rust_binary
rust_library = _rust_library
rust_static_library = _rust_static_library
rust_shared_library = _rust_shared_library
rust_proc_macro = _rust_proc_macro
rust_test = _rust_test
rust_doc = _rust_doc
rust_doc_test = _rust_doc_test
Expand Down
372 changes: 245 additions & 127 deletions docs/rust.md → docs/defs.md

Large diffs are not rendered by default.

370 changes: 244 additions & 126 deletions docs/flatten.md

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion docs/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ supported in certain environments.

## Rules

- [rust](rust.md): standard rust rules for building and testing libraries and binaries.
- [defs](defs.md): standard rust rules for building and testing libraries and binaries.
- [rust_doc](rust_doc.md): rules for generating and testing rust documentation.
- [rust_proto](rust_proto.md): rules for generating [protobuf](https://developers.google.com/protocol-buffers).
and [gRPC](https://grpc.io) stubs.
Expand Down
1 change: 1 addition & 0 deletions rust/BUILD
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ exports_files([
"known_shas.bzl",
"repositories.bzl",
"rust.bzl",
"defs.bzl",
"toolchain.bzl",
])

Expand Down
98 changes: 98 additions & 0 deletions rust/defs.bzl
Original file line number Diff line number Diff line change
@@ -0,0 +1,98 @@
# Copyright 2021 The Bazel Authors. All rights reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

"""Public entry point to all Rust rules and supported APIs."""

load(
"//rust/private:clippy.bzl",
_rust_clippy = "rust_clippy",
_rust_clippy_aspect = "rust_clippy_aspect",
)
load("//rust/private:common.bzl", _rust_common = "rust_common")
load(
"//rust/private:rust.bzl",
_rust_benchmark = "rust_benchmark",
_rust_binary = "rust_binary",
_rust_library = "rust_library",
_rust_proc_macro = "rust_proc_macro",
_rust_shared_library = "rust_shared_library",
_rust_static_library = "rust_static_library",
_rust_test = "rust_test",
_rust_test_binary = "rust_test_binary",
)
load(
"//rust/private:rust_analyzer.bzl",
_rust_analyzer = "rust_analyzer",
_rust_analyzer_aspect = "rust_analyzer_aspect",
)
load(
"//rust/private:rustc.bzl",
_error_format = "error_format",
)
load(
"//rust/private:rustdoc.bzl",
_rust_doc = "rust_doc",
)
load(
"//rust/private:rustdoc_test.bzl",
_rust_doc_test = "rust_doc_test",
)

rust_library = _rust_library
# See @rules_rust//rust/private:rust.bzl for a complete description.

rust_static_library = _rust_static_library
# See @rules_rust//rust/private:rust.bzl for a complete description.

rust_shared_library = _rust_shared_library
# See @rules_rust//rust/private:rust.bzl for a complete description.

rust_proc_macro = _rust_proc_macro
# See @rules_rust//rust/private:rust.bzl for a complete description.

rust_binary = _rust_binary
# See @rules_rust//rust/private:rust.bzl for a complete description.

rust_test = _rust_test
# See @rules_rust//rust/private:rust.bzl for a complete description.

rust_test_binary = _rust_test_binary
# See @rules_rust//rust/private:rust.bzl for a complete description.

rust_benchmark = _rust_benchmark
# See @rules_rust//rust/private:rust.bzl for a complete description.

rust_doc = _rust_doc
# See @rules_rust//rust/private:rustdoc.bzl for a complete description.

rust_doc_test = _rust_doc_test
# See @rules_rust//rust/private:rustdoc_test.bzl for a complete description.

rust_clippy_aspect = _rust_clippy_aspect
# See @rules_rust//rust/private:clippy.bzl for a complete description.

rust_clippy = _rust_clippy
# See @rules_rust//rust/private:clippy.bzl for a complete description.

error_format = _error_format
# See @rules_rust//rust/private:rustc.bzl for a complete description.

rust_common = _rust_common
# See @rules_rust//rust/private:common.bzl for a complete description.

rust_analyzer_aspect = _rust_analyzer_aspect
# See @rules_rust//rust:private/rust_analyzer.bzl for a complete description.

rust_analyzer = _rust_analyzer
# See @rules_rust//rust:private/rust_analyzer.bzl for a complete description.
Loading