-
Notifications
You must be signed in to change notification settings - Fork 105
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Restructured project to be buildable with Bazel (#340)
* Restructured project to be buildable with Bazel * Moved `dump_metadata` tool * Deleted smoke_test directory since examples are more authoritative now * Added bootstrapped cargo-raze outputs * Updated Bazel and rules_rust version * Addressed PR feedback
- Loading branch information
1 parent
c293230
commit 4779bd5
Showing
418 changed files
with
25,611 additions
and
4,454 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
examples |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
3.7.1 | ||
4.0.0 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,2 @@ | ||
**/bazel-* | ||
**/target/ | ||
examples/.bazelversion |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
load("@com_github_bazelbuild_buildtools//buildifier:def.bzl", "buildifier") | ||
|
||
alias( | ||
name = "cargo_raze", | ||
actual = "//impl:cargo_raze", | ||
visibility = ["//visibility:public"], | ||
) | ||
|
||
alias( | ||
name = "cargo_raze_bin", | ||
actual = "//impl:cargo_raze_bin", | ||
visibility = ["//visibility:public"], | ||
) | ||
|
||
alias( | ||
name = "bootstrap", | ||
actual = "//tools:bootstrap", | ||
visibility = ["//visibility:private"], | ||
) | ||
|
||
alias( | ||
name = "publish_new_version", | ||
actual = "//tools:publish_new_version", | ||
visibility = ["//visibility:private"], | ||
) | ||
|
||
test_suite( | ||
name = "examples_launch_tests", | ||
tests = [ | ||
"@cargo_raze_examples//tests:launch_tests", | ||
], | ||
visibility = ["//visibility:private"], | ||
) | ||
|
||
buildifier( | ||
name = "buildifier_check", | ||
mode = "check", | ||
visibility = ["//visibility:private"], | ||
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,87 @@ | ||
workspace(name = "cargo_raze") | ||
|
||
load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive") | ||
|
||
http_archive( | ||
name = "io_bazel_rules_rust", | ||
sha256 = "93df45afb39622e548f2e7fd1372ad93b0d9f482beed45140c22c9ab0b01fb57", | ||
strip_prefix = "rules_rust-2c678c1e224c03e077f7616baf127f970ddff14d", | ||
urls = [ | ||
# Master branch as of 2021-01-21 | ||
"https://github.com/bazelbuild/rules_rust/archive/2c678c1e224c03e077f7616baf127f970ddff14d.tar.gz", | ||
], | ||
) | ||
|
||
load("@io_bazel_rules_rust//rust:repositories.bzl", "rust_repositories") | ||
|
||
rust_repositories( | ||
edition = "2018", | ||
version = "1.49.0", | ||
) | ||
|
||
load("//third_party:third_party_repositories.bzl", "third_party_repositories") | ||
|
||
third_party_repositories() | ||
|
||
load("//third_party:third_party_deps.bzl", "third_party_deps") | ||
|
||
third_party_deps() | ||
|
||
load("//tools:examples_repository.bzl", "examples_repository") | ||
|
||
examples_repository() | ||
|
||
load("@cargo_raze_examples//:repositories.bzl", examples_repositories = "repositories") | ||
|
||
examples_repositories() | ||
|
||
############################################################################################# | ||
# Buildifier | ||
# Note: This should be removed in favor of the buildifier target that can be added in bazelci | ||
############################################################################################# | ||
|
||
# buildifier is written in Go and hence needs rules_go to be built. | ||
# See https://github.com/bazelbuild/rules_go for the up to date setup instructions. | ||
http_archive( | ||
name = "io_bazel_rules_go", | ||
sha256 = "d1ffd055969c8f8d431e2d439813e42326961d0942bdf734d2c95dc30c369566", | ||
urls = [ | ||
"https://mirror.bazel.build/github.com/bazelbuild/rules_go/releases/download/v0.24.5/rules_go-v0.24.5.tar.gz", | ||
"https://github.com/bazelbuild/rules_go/releases/download/v0.24.5/rules_go-v0.24.5.tar.gz", | ||
], | ||
) | ||
|
||
load("@io_bazel_rules_go//go:deps.bzl", "go_register_toolchains", "go_rules_dependencies") | ||
|
||
go_rules_dependencies() | ||
|
||
go_register_toolchains() | ||
|
||
http_archive( | ||
name = "bazel_gazelle", | ||
sha256 = "b85f48fa105c4403326e9525ad2b2cc437babaa6e15a3fc0b1dbab0ab064bc7c", | ||
urls = [ | ||
"https://mirror.bazel.build/github.com/bazelbuild/bazel-gazelle/releases/download/v0.22.2/bazel-gazelle-v0.22.2.tar.gz", | ||
"https://github.com/bazelbuild/bazel-gazelle/releases/download/v0.22.2/bazel-gazelle-v0.22.2.tar.gz", | ||
], | ||
) | ||
|
||
load("@bazel_gazelle//:deps.bzl", "gazelle_dependencies") | ||
|
||
gazelle_dependencies(go_repository_default_config = "@//:WORKSPACE.bazel") | ||
|
||
http_archive( | ||
name = "com_google_protobuf", | ||
strip_prefix = "protobuf-master", | ||
urls = ["https://github.com/protocolbuffers/protobuf/archive/master.zip"], | ||
) | ||
|
||
load("@com_google_protobuf//:protobuf_deps.bzl", "protobuf_deps") | ||
|
||
protobuf_deps() | ||
|
||
http_archive( | ||
name = "com_github_bazelbuild_buildtools", | ||
strip_prefix = "buildtools-master", | ||
url = "https://github.com/bazelbuild/buildtools/archive/master.zip", | ||
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
4.0.0 |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,37 +1,21 @@ | ||
workspace(name = "com_github_google_cargo_raze_examples") | ||
workspace(name = "cargo_raze_examples") | ||
|
||
load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive") | ||
|
||
http_archive( | ||
name = "io_bazel_rules_rust", | ||
sha256 = "0e2e633bf0f7f25392ffb477d677c88eb34fe70ffae05e3ad92fdd9f8d6579db", | ||
strip_prefix = "rules_rust-bc0578798f50d018ca4278ad5610598c400992c9", | ||
sha256 = "8e1bae501e0df40e8feb2497ebab37c84930bf00b332f8f55315dfc08d85c30a", | ||
strip_prefix = "rules_rust-df18ddbece5b68f86e63414ea4b50d691923039a", | ||
urls = [ | ||
# Master branch as of 2020-12-05 | ||
"https://github.com/bazelbuild/rules_rust/archive/bc0578798f50d018ca4278ad5610598c400992c9.tar.gz", | ||
# Master branch as of 2021-01-01 | ||
"https://github.com/bazelbuild/rules_rust/archive/df18ddbece5b68f86e63414ea4b50d691923039a.tar.gz", | ||
], | ||
) | ||
|
||
load("@io_bazel_rules_rust//rust:repositories.bzl", "rust_repositories") | ||
|
||
rust_repositories() | ||
|
||
load("//remote/binary_dependencies/cargo:crates.bzl", "remote_binary_dependencies_fetch_remote_crates") | ||
load("//:repositories.bzl", "repositories") | ||
|
||
remote_binary_dependencies_fetch_remote_crates() | ||
|
||
load("//remote/cargo_workspace/cargo:crates.bzl", "remote_cargo_workspace_fetch_remote_crates") | ||
|
||
remote_cargo_workspace_fetch_remote_crates() | ||
|
||
load("//remote/complicated_cargo_library/cargo:crates.bzl", "remote_complicated_cargo_library_fetch_remote_crates") | ||
|
||
remote_complicated_cargo_library_fetch_remote_crates() | ||
|
||
load("//remote/no_deps/cargo:crates.bzl", "remote_no_deps_fetch_remote_crates") | ||
|
||
remote_no_deps_fetch_remote_crates() | ||
|
||
load("//remote/non_cratesio/cargo:crates.bzl", "remote_non_cratesio_fetch_remote_crates") | ||
|
||
remote_non_cratesio_fetch_remote_crates() | ||
repositories() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
"""This module is the single location for all dependencies for the Cargo Raze examples""" | ||
|
||
load("@cargo_raze_examples//remote/binary_dependencies/cargo:crates.bzl", "remote_binary_dependencies_fetch_remote_crates") | ||
load("@cargo_raze_examples//remote/cargo_workspace/cargo:crates.bzl", "remote_cargo_workspace_fetch_remote_crates") | ||
load("@cargo_raze_examples//remote/complicated_cargo_library/cargo:crates.bzl", "remote_complicated_cargo_library_fetch_remote_crates") | ||
load("@cargo_raze_examples//remote/no_deps/cargo:crates.bzl", "remote_no_deps_fetch_remote_crates") | ||
load("@cargo_raze_examples//remote/non_cratesio/cargo:crates.bzl", "remote_non_cratesio_fetch_remote_crates") | ||
|
||
def repositories(): | ||
"""Defines all the cargo dependencies of the Cargo-raze examples""" | ||
remote_binary_dependencies_fetch_remote_crates() | ||
remote_cargo_workspace_fetch_remote_crates() | ||
remote_complicated_cargo_library_fetch_remote_crates() | ||
remote_no_deps_fetch_remote_crates() | ||
remote_non_cratesio_fetch_remote_crates() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.