Skip to content

Commit

Permalink
feat(cargo): crates with 'google-' prefix
Browse files Browse the repository at this point in the history
Fixes #23
  • Loading branch information
Byron committed Mar 19, 2015
1 parent cb5a0a3 commit 4a27ac7
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 3 deletions.
2 changes: 1 addition & 1 deletion src/mako/Cargo.toml.mako
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
</%block>
[package]
name = "${util.library_name()}"
name = "${util.crate_name()}"
version = "${cargo.build_version}"
authors = [${",\n ".join('"%s"' % a for a in cargo.authors)}]
description = "A complete library to interact with ${util.canonical_name()} (protocol ${version})"
Expand Down
2 changes: 1 addition & 1 deletion src/mako/lib/lib.mako
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,7 @@ To use this library, you would put the following lines into your `Cargo.toml` fi

```toml
[dependencies]
${util.library_name()} = "${cargo.build_version}"
${util.crate_name()} = "${cargo.build_version}"
```

${'##'} A complete example
Expand Down
6 changes: 5 additions & 1 deletion src/mako/lib/util.mako
Original file line number Diff line number Diff line change
Expand Up @@ -23,13 +23,17 @@ ${cargo.repo_base_url}/${OUTPUT_DIR}\
${util.library_name(name, version)}\
</%def>

<%def name="crate_name()" buffered="True">\
google-${self.library_name()}\
</%def>

## All crates and standard `use` declaration, required for all examples
## Must be outside of a test function
<%def name="test_prelude()">\
extern crate hyper;
extern crate "yup-oauth2" as oauth2;
extern crate "rustc-serialize" as rustc_serialize;
extern crate ${self.library_name()};
extern crate "${self.crate_name()}" as ${self.library_name()};
</%def>

## Define the canonical name, if present, or name otherwise
Expand Down

0 comments on commit 4a27ac7

Please sign in to comment.