-
Notifications
You must be signed in to change notification settings - Fork 104
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
Add SHA-256 to the local_repositories #47
Changes from 3 commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Large diffs are not rendered by default.
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -133,6 +133,7 @@ pub enum GenMode { | |
Remote, | ||
} | ||
|
||
#[cfg(test)] | ||
pub mod testing { | ||
use super::*; | ||
|
||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -10,7 +10,10 @@ def {{workspace.gen_workspace_prefix}}_fetch_remote_crates(): | |
name = "{{workspace.gen_workspace_prefix}}__{{crate.pkg_name | slugify | replace(from="-", to="_")}}__{{crate.pkg_version | slugify | replace(from="-", to="_")}}", | ||
url = "https://crates-io.s3-us-west-1.amazonaws.com/crates/{{crate.pkg_name}}/{{crate.pkg_name}}-{{crate.pkg_version}}.crate", | ||
type = "tar.gz", | ||
strip_prefix = "{{crate.pkg_name}}-{{crate.pkg_version}}", | ||
{% if crate.sha256 | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Nit: use "{%-" to accomplish the same thing as you're accomplishing by splitting the tag. Example: https://github.com/google/cargo-raze/blob/master/impl/src/templates/crate.BUILD.template#L23 There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Much nicer. Done! |
||
%}sha256 = "{{crate.sha256}}", | ||
{% endif | ||
%}strip_prefix = "{{crate.pkg_name}}-{{crate.pkg_version}}", | ||
build_file = "{{workspace.workspace_path}}/remote:{{crate.pkg_name}}-{{crate.pkg_version}}.BUILD" | ||
) | ||
{% endfor %} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Two Nits:
s/
and_then(|x| Some(x.to_string()))
/map(ToString::to_string)
The
and_then
is only necessary when the mapping function yields an option.map
is similar but without the option.ToString::to_string
is the direct reference to the method (though|x| x.to_string()
is totally fine as well).There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done.