features: &'a FeatureMap,
manifest_path: &'a Path,
metadata: Option<&'a toml::Value>,
+ publish: Option<&'a Vec<String>>,
authors: &'a [String],
categories: &'a [String],
keywords: &'a [String],
edition: &self.manifest.edition().to_string(),
links: self.manifest.links(),
metabuild: self.manifest.metabuild(),
+ publish: self.publish().as_ref(),
}
.serialize(s)
}
"features": {},
"manifest_path": "[..]/foo/Cargo.toml",
"metadata": null,
+ "publish": null,
"authors": [],
"categories": [],
"keywords": [],
"features": {},
"manifest_path": "[..]/altdep2-0.0.1/Cargo.toml",
"metadata": null,
+ "publish": null,
"authors": [],
"categories": [],
"keywords": [],
"features": {},
"manifest_path": "[..]/altdep-0.0.1/Cargo.toml",
"metadata": null,
+ "publish": null,
"authors": [],
"categories": [],
"keywords": [],
"features": {},
"manifest_path": "[..]/foo/Cargo.toml",
"metadata": null,
+ "publish": null,
"authors": [],
"categories": [],
"keywords": [],
"features": {},
"manifest_path": "[..]/iodep-0.0.1/Cargo.toml",
"metadata": null,
+ "publish": null,
"authors": [],
"categories": [],
"keywords": [],
"features": {},
"manifest_path": "[..]/bar-0.0.1/Cargo.toml",
"metadata": null,
+ "publish": null,
"authors": [],
"categories": [],
"keywords": [],
"features": {},
"manifest_path": "[..]",
"metadata": null,
+ "publish": null,
"authors": [],
"categories": [],
"keywords": [],
"features": {},
"manifest_path": "[..]/foo/Cargo.toml",
"metadata": null,
+ "publish": null,
"authors": [],
"categories": [],
"keywords": [],
"features": {},
"manifest_path": "[..]",
"metadata": null,
+ "publish": null,
"authors": [],
"categories": [],
"keywords": [],
],
"features": {},
"manifest_path": "[..]Cargo.toml",
- "metadata": null
+ "metadata": null,
+ "publish": null
}
],
"workspace_members": ["foo 0.5.0 (path+file:[..]foo)"],
],
"features": {},
"manifest_path": "[..]Cargo.toml",
- "metadata": null
+ "metadata": null,
+ "publish": null
}
],
"workspace_members": ["foo 0.5.0 (path+file:[..]foo)"],
"optional_feat": []
},
"manifest_path": "[..]Cargo.toml",
- "metadata": null
+ "metadata": null,
+ "publish": null
}
],
"workspace_members": ["foo 0.5.0 (path+file:[..]foo)"],
"links": null,
"manifest_path": "[..]Cargo.toml",
"metadata": null,
+ "publish": null,
"name": "baz",
"readme": null,
"repository": null,
"links": null,
"manifest_path": "[..]Cargo.toml",
"metadata": null,
+ "publish": null,
"name": "foo",
"readme": null,
"repository": null,
"links": null,
"manifest_path": "[..]Cargo.toml",
"metadata": null,
+ "publish": null,
"name": "foobar",
"readme": null,
"repository": null,
"links": null,
"manifest_path": "[..]Cargo.toml",
"metadata": null,
+ "publish": null,
"name": "bar",
"readme": null,
"repository": null,
],
"features": {},
"manifest_path": "[..]Cargo.toml",
- "metadata": null
+ "metadata": null,
+ "publish": null
}
],
"workspace_members": [
],
"features": {},
"manifest_path": "[..]Cargo.toml",
- "metadata": null
+ "metadata": null,
+ "publish": null
}
],
"workspace_members": [
],
"features": {},
"manifest_path": "[..]bar/Cargo.toml",
- "metadata": null
+ "metadata": null,
+ "publish": null
},
{
"authors": [
],
"features": {},
"manifest_path": "[..]baz/Cargo.toml",
- "metadata": null
+ "metadata": null,
+ "publish": null
}
],
"workspace_members": ["baz 0.5.0 (path+file:[..]baz)", "bar 0.5.0 (path+file:[..]bar)"],
],
"features": {},
"manifest_path": "[..]bar/Cargo.toml",
- "metadata": null
+ "metadata": null,
+ "publish": null
},
{
"authors": [
],
"features": {},
"manifest_path": "[..]baz/Cargo.toml",
- "metadata": null
+ "metadata": null,
+ "publish": null
}
],
"workspace_members": ["baz 0.5.0 (path+file:[..]baz)", "bar 0.5.0 (path+file:[..]bar)"],
"features":{},
"manifest_path":"[..]Cargo.toml",
"metadata": null,
+ "publish": null,
"readme": null,
"repository": null
}],
"bar": {
"baz": "quux"
}
- }
+ },
+ "publish": null
+ }
+ ],
+ "workspace_members": ["foo[..]"],
+ "resolve": null,
+ "target_directory": "[..]foo/target",
+ "version": 1,
+ "workspace_root": "[..]/foo"
+ }"#,
+ )
+ .run();
+}
+
+#[cargo_test]
+fn package_publish() {
+ let p = project()
+ .file(
+ "Cargo.toml",
+ r#"
+ [package]
+ name = "foo"
+ version = "0.1.0"
+ authors = ["wycats@example.com"]
+ categories = ["database"]
+ keywords = ["database"]
+ readme = "README.md"
+ repository = "https://github.com/rust-lang/cargo"
+ publish = ["my-registry"]
+ "#,
+ )
+ .file("src/lib.rs", "")
+ .build();
+
+ p.cargo("metadata --no-deps")
+ .with_json(
+ r#"
+ {
+ "packages": [
+ {
+ "authors": ["wycats@example.com"],
+ "categories": ["database"],
+ "name": "foo",
+ "readme": "README.md",
+ "repository": "https://github.com/rust-lang/cargo",
+ "version": "0.1.0",
+ "id": "foo[..]",
+ "keywords": ["database"],
+ "source": null,
+ "dependencies": [],
+ "edition": "2015",
+ "license": null,
+ "license_file": null,
+ "links": null,
+ "description": null,
+ "targets": [
+ {
+ "kind": [ "lib" ],
+ "crate_types": [ "lib" ],
+ "doctest": true,
+ "edition": "2015",
+ "name": "foo",
+ "src_path": "[..]foo/src/lib.rs"
+ }
+ ],
+ "features": {},
+ "manifest_path": "[..]foo/Cargo.toml",
+ "metadata": null,
+ "publish": ["my-registry"]
}
],
"workspace_members": ["foo[..]"],
"links": null,
"manifest_path": "[..]Cargo.toml",
"metadata": null,
+ "publish": null,
"name": "bar",
"readme": null,
"repository": null,
"links": null,
"manifest_path": "[..]Cargo.toml",
"metadata": null,
+ "publish": null,
"name": "foo",
"readme": null,
"repository": null,
"links": null,
"manifest_path": "[..]Cargo.toml",
"metadata": null,
+ "publish": null,
"name": "foo",
"readme": null,
"repository": null,
"links": null,
"manifest_path": "[..]",
"metadata": null,
+ "publish": null,
"name": "foo",
"readme": null,
"repository": null,
"links": null,
"manifest_path": "[..]",
"metadata": null,
+ "publish": null,
"name": "bar",
"readme": null,
"repository": null,
"links": null,
"manifest_path": "[..]",
"metadata": null,
+ "publish": null,
"name": "bar",
"readme": null,
"repository": null,
"links": "a",
"manifest_path": "[..]/foo/Cargo.toml",
"metadata": null,
+ "publish": null,
"name": "foo",
"readme": null,
"repository": null,