File tree 3 files changed +8
-0
lines changed
3 files changed +8
-0
lines changed Original file line number Diff line number Diff line change @@ -236,6 +236,10 @@ impl<'cfg> Compilation<'cfg> {
236
236
"CARGO_PKG_HOMEPAGE" ,
237
237
metadata. homepage . as_ref ( ) . unwrap_or ( & String :: new ( ) ) ,
238
238
)
239
+ . env (
240
+ "CARGO_PKG_REPOSITORY" ,
241
+ metadata. repository . as_ref ( ) . unwrap_or ( & String :: new ( ) ) ,
242
+ )
239
243
. env ( "CARGO_PKG_AUTHORS" , & pkg. authors ( ) . join ( ":" ) )
240
244
. cwd ( pkg. root ( ) ) ;
241
245
Ok ( cmd)
Original file line number Diff line number Diff line change @@ -63,6 +63,7 @@ let version = env!("CARGO_PKG_VERSION");
63
63
* ` CARGO_PKG_NAME ` - The name of your package.
64
64
* ` CARGO_PKG_DESCRIPTION ` - The description of your package.
65
65
* ` CARGO_PKG_HOMEPAGE ` - The home page of your package.
66
+ * ` CARGO_PKG_REPOSITORY ` - The repository of your package.
66
67
* ` OUT_DIR ` - If the package has a build script, this is set to the folder where the build
67
68
script should place its output. See below for more information.
68
69
Original file line number Diff line number Diff line change @@ -1338,6 +1338,7 @@ fn crate_env_vars() {
1338
1338
version = "0.5.1-alpha.1"
1339
1339
description = "This is foo"
1340
1340
homepage = "http://example.com"
1341
+ repository = "http://example.com/repo.git"
1341
1342
authors = ["wycats@example.com"]
1342
1343
"# ,
1343
1344
) . file (
@@ -1354,6 +1355,7 @@ fn crate_env_vars() {
1354
1355
static CARGO_MANIFEST_DIR: &'static str = env!("CARGO_MANIFEST_DIR");
1355
1356
static PKG_NAME: &'static str = env!("CARGO_PKG_NAME");
1356
1357
static HOMEPAGE: &'static str = env!("CARGO_PKG_HOMEPAGE");
1358
+ static REPOSITORY: &'static str = env!("CARGO_PKG_REPOSITORY");
1357
1359
static DESCRIPTION: &'static str = env!("CARGO_PKG_DESCRIPTION");
1358
1360
1359
1361
fn main() {
@@ -1364,6 +1366,7 @@ fn crate_env_vars() {
1364
1366
println!("{}", s);
1365
1367
assert_eq!("foo", PKG_NAME);
1366
1368
assert_eq!("http://example.com", HOMEPAGE);
1369
+ assert_eq!("http://example.com/repo.git", REPOSITORY);
1367
1370
assert_eq!("This is foo", DESCRIPTION);
1368
1371
let s = format!("{}.{}.{}-{}", VERSION_MAJOR,
1369
1372
VERSION_MINOR, VERSION_PATCH, VERSION_PRE);
You can’t perform that action at this time.
0 commit comments