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

Moved template header into it's own file #279

Merged
merged 2 commits into from
Nov 4, 2020
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
2 changes: 1 addition & 1 deletion examples/remote/binary_dependencies/cargo/BUILD.bazel
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
"""
@generated
cargo-raze workspace build file.
cargo-raze generated Bazel file.

DO NOT EDIT! Replaced on runs of cargo-raze
"""
Expand Down
2 changes: 1 addition & 1 deletion examples/remote/binary_dependencies/cargo/crates.bzl
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
"""
@generated
cargo-raze crate workspace functions
cargo-raze generated Bazel file.

DO NOT EDIT! Replaced on runs of cargo-raze
"""
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
"""
@generated
cargo-raze workspace build file.
cargo-raze generated Bazel file.

DO NOT EDIT! Replaced on runs of cargo-raze
"""
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
"""
@generated
cargo-raze crate workspace functions
cargo-raze generated Bazel file.

DO NOT EDIT! Replaced on runs of cargo-raze
"""
Expand Down
2 changes: 1 addition & 1 deletion examples/remote/no_deps/cargo/BUILD.bazel
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
"""
@generated
cargo-raze workspace build file.
cargo-raze generated Bazel file.

DO NOT EDIT! Replaced on runs of cargo-raze
"""
Expand Down
2 changes: 1 addition & 1 deletion examples/remote/no_deps/cargo/crates.bzl
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
"""
@generated
cargo-raze crate workspace functions
cargo-raze generated Bazel file.

DO NOT EDIT! Replaced on runs of cargo-raze
"""
Expand Down
2 changes: 1 addition & 1 deletion examples/remote/non_cratesio/cargo/BUILD.bazel
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
"""
@generated
cargo-raze workspace build file.
cargo-raze generated Bazel file.

DO NOT EDIT! Replaced on runs of cargo-raze
"""
Expand Down
2 changes: 1 addition & 1 deletion examples/remote/non_cratesio/cargo/crates.bzl
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
"""
@generated
cargo-raze crate workspace functions
cargo-raze generated Bazel file.

DO NOT EDIT! Replaced on runs of cargo-raze
"""
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
"""
@generated
cargo-raze workspace build file.
cargo-raze generated Bazel file.

DO NOT EDIT! Replaced on runs of cargo-raze
"""
Expand Down
2 changes: 1 addition & 1 deletion examples/vendored/hello_cargo_library/cargo/BUILD.bazel
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
"""
@generated
cargo-raze workspace build file.
cargo-raze generated Bazel file.

DO NOT EDIT! Replaced on runs of cargo-raze
"""
Expand Down
2 changes: 1 addition & 1 deletion examples/vendored/non_cratesio_library/cargo/BUILD.bazel
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
"""
@generated
cargo-raze workspace build file.
cargo-raze generated Bazel file.

DO NOT EDIT! Replaced on runs of cargo-raze
"""
Expand Down
36 changes: 20 additions & 16 deletions impl/src/rendering/bazel.rs
Original file line number Diff line number Diff line change
Expand Up @@ -37,41 +37,45 @@ impl BazelRenderer {
internal_renderer
.add_raw_templates(vec![
(
"templates/partials/build_script.template",
include_str!("templates/partials/build_script.template"),
),
(
"templates/partials/rust_binary.template",
include_str!("templates/partials/rust_binary.template"),
"templates/crate.BUILD.template",
include_str!("templates/crate.BUILD.template"),
),
(
"templates/partials/rust_library.template",
include_str!("templates/partials/rust_library.template"),
"templates/partials/build_script.template",
include_str!("templates/partials/build_script.template"),
),
(
"templates/partials/common_attrs.template",
include_str!("templates/partials/common_attrs.template"),
),
(
"templates/workspace.BUILD.template",
include_str!("templates/workspace.BUILD.template"),
"templates/partials/header.template",
include_str!("templates/partials/header.template"),
),
(
"templates/crate.BUILD.template",
include_str!("templates/crate.BUILD.template"),
"templates/partials/remote_crates_patch.template",
include_str!("templates/partials/remote_crates_patch.template"),
),
(
"templates/remote_crates.bzl.template",
include_str!("templates/remote_crates.bzl.template"),
"templates/partials/rust_binary.template",
include_str!("templates/partials/rust_binary.template"),
),
(
"templates/partials/remote_crates_patch.template",
include_str!("templates/partials/remote_crates_patch.template"),
"templates/partials/rust_library.template",
include_str!("templates/partials/rust_library.template"),
),
(
"templates/partials/targeted_dependencies.template",
include_str!("templates/partials/targeted_dependencies.template"),
),
(
"templates/remote_crates.bzl.template",
include_str!("templates/remote_crates.bzl.template"),
),
(
"templates/workspace.BUILD.template",
include_str!("templates/workspace.BUILD.template"),
),
])
.unwrap();

Expand Down
6 changes: 6 additions & 0 deletions impl/src/rendering/templates/partials/header.template
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
"""
@generated
cargo-raze generated Bazel file.

DO NOT EDIT! Replaced on runs of cargo-raze
"""
8 changes: 1 addition & 7 deletions impl/src/rendering/templates/remote_crates.bzl.template
Original file line number Diff line number Diff line change
@@ -1,10 +1,4 @@
"""
@generated
cargo-raze crate workspace functions

DO NOT EDIT! Replaced on runs of cargo-raze
"""

{%- include "templates/partials/header.template" %}
load("@bazel_tools//tools/build_defs/repo:git.bzl", "new_git_repository") # buildifier: disable=load
load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive") # buildifier: disable=load
load("@bazel_tools//tools/build_defs/repo:utils.bzl", "maybe") # buildifier: disable=load
Expand Down
8 changes: 1 addition & 7 deletions impl/src/rendering/templates/workspace.BUILD.template
Original file line number Diff line number Diff line change
@@ -1,10 +1,4 @@
"""
@generated
cargo-raze workspace build file.

DO NOT EDIT! Replaced on runs of cargo-raze
"""

{%- include "templates/partials/header.template" %}
package(default_visibility = ["//visibility:public"])

licenses([
Expand Down