File tree 3 files changed +10
-2
lines changed
3 files changed +10
-2
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 @@ -61,8 +61,9 @@ let version = env!("CARGO_PKG_VERSION");
61
61
* ` CARGO_PKG_VERSION_PRE ` - The pre-release version of your package.
62
62
* ` CARGO_PKG_AUTHORS ` - Colon separated list of authors from the manifest of your package.
63
63
* ` CARGO_PKG_NAME ` - The name of your package.
64
- * ` CARGO_PKG_DESCRIPTION ` - The description of your package.
65
- * ` CARGO_PKG_HOMEPAGE ` - The home page of your package.
64
+ * ` CARGO_PKG_DESCRIPTION ` - The description from the manifest of your package.
65
+ * ` CARGO_PKG_HOMEPAGE ` - The home page from the manifest of your package.
66
+ * ` CARGO_PKG_REPOSITORY ` - The repository from the manifest 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 @@ -1368,6 +1368,7 @@ fn crate_env_vars() {
1368
1368
version = "0.5.1-alpha.1"
1369
1369
description = "This is foo"
1370
1370
homepage = "http://example.com"
1371
+ repository = "http://example.com/repo.git"
1371
1372
authors = ["wycats@example.com"]
1372
1373
"# ,
1373
1374
) . file (
@@ -1384,6 +1385,7 @@ fn crate_env_vars() {
1384
1385
static CARGO_MANIFEST_DIR: &'static str = env!("CARGO_MANIFEST_DIR");
1385
1386
static PKG_NAME: &'static str = env!("CARGO_PKG_NAME");
1386
1387
static HOMEPAGE: &'static str = env!("CARGO_PKG_HOMEPAGE");
1388
+ static REPOSITORY: &'static str = env!("CARGO_PKG_REPOSITORY");
1387
1389
static DESCRIPTION: &'static str = env!("CARGO_PKG_DESCRIPTION");
1388
1390
1389
1391
fn main() {
@@ -1394,6 +1396,7 @@ fn crate_env_vars() {
1394
1396
println!("{}", s);
1395
1397
assert_eq!("foo", PKG_NAME);
1396
1398
assert_eq!("http://example.com", HOMEPAGE);
1399
+ assert_eq!("http://example.com/repo.git", REPOSITORY);
1397
1400
assert_eq!("This is foo", DESCRIPTION);
1398
1401
let s = format!("{}.{}.{}-{}", VERSION_MAJOR,
1399
1402
VERSION_MINOR, VERSION_PATCH, VERSION_PRE);
You can’t perform that action at this time.
0 commit comments