This is needed for creating registry index entries.
readme: Option<&'a str>,
repository: Option<&'a str>,
edition: &'a str,
+ links: Option<&'a str>,
#[serde(skip_serializing_if = "Option::is_none")]
metabuild: Option<&'a Vec<String>>,
}
readme,
repository,
edition: &self.manifest.edition().to_string(),
+ links: self.manifest.links(),
metabuild: self.manifest.metabuild(),
}
.serialize(s)
/* The default edition of the package.
Note that individual targets may have different editions.
*/
- "edition": "2018"
+ "edition": "2018",
+ /* Optional string that is the name of a native library the package
+ is linking to.
+ */
+ "links": null,
}
],
/* Array of members of the workspace.
/* The default edition of the package.
Note that individual targets may have different editions.
*/
- "edition": "2018"
+ "edition": "2018",
+ /* Optional string that is the name of a native library the package
+ is linking to.
+ */
+ "links": null,
}
],
/* Array of members of the workspace.
.\" Title: cargo-metadata
.\" Author: [see the "AUTHOR(S)" section]
.\" Generator: Asciidoctor 1.5.8
-.\" Date: 2018-12-18
+.\" Date: 2018-12-23
.\" Manual: \ \&
.\" Source: \ \&
.\" Language: English
.\"
-.TH "CARGO\-METADATA" "1" "2018-12-18" "\ \&" "\ \&"
+.TH "CARGO\-METADATA" "1" "2018-12-23" "\ \&" "\ \&"
.ie \n(.g .ds Aq \(aq
.el .ds Aq '
.ss \n[.ss] 0
/* The default edition of the package.
Note that individual targets may have different editions.
*/
- "edition": "2018"
+ "edition": "2018",
+ /* Optional string that is the name of a native library the package
+ is linking to.
+ */
+ "links": null,
}
],
/* Array of members of the workspace.
"edition": "2015",
"license": null,
"license_file": null,
+ "links": null,
"description": null,
"readme": null,
"repository": null,
"edition": "2015",
"license": null,
"license_file": null,
+ "links": null,
"description": null,
"targets": [
{
"edition": "2015",
"license": null,
"license_file": null,
+ "links": null,
"description": null,
"targets": [
{
"keywords": [],
"license": null,
"license_file": null,
+ "links": null,
"manifest_path": "[..]Cargo.toml",
"metadata": null,
"name": "baz",
"keywords": [],
"license": "MIT",
"license_file": null,
+ "links": null,
"manifest_path": "[..]Cargo.toml",
"metadata": null,
"name": "foo",
"keywords": [],
"license": null,
"license_file": null,
+ "links": null,
"manifest_path": "[..]Cargo.toml",
"metadata": null,
"name": "foobar",
"keywords": [],
"license": null,
"license_file": null,
+ "links": null,
"manifest_path": "[..]Cargo.toml",
"metadata": null,
"name": "bar",
"keywords": [],
"license": null,
"license_file": null,
+ "links": null,
"description": null,
"edition": "2015",
"source": null,
"keywords": [],
"license": null,
"license_file": null,
+ "links": null,
"description": null,
"edition": "2015",
"source": null,
"dependencies": [],
"license": null,
"license_file": null,
+ "links": null,
"description": null,
"edition": "2015",
"targets": [
"dependencies": [],
"license": null,
"license_file": null,
+ "links": null,
"description": null,
"edition": "2015",
"targets": [
"dependencies": [],
"license": null,
"license_file": null,
+ "links": null,
"description": null,
"edition": "2015",
"targets": [
"dependencies": [],
"license": null,
"license_file": null,
+ "links": null,
"description": null,
"edition": "2015",
"targets": [
"keywords": [],
"license": null,
"license_file": null,
+ "links": null,
"description": null,
"edition": "2015",
"targets":[{
"edition": "2015",
"license": null,
"license_file": null,
+ "links": null,
"description": null,
"targets": [
{
"keywords": [],
"license": null,
"license_file": null,
+ "links": null,
"manifest_path": "[..]Cargo.toml",
"metadata": null,
"name": "bar",
"keywords": [],
"license": null,
"license_file": null,
+ "links": null,
"manifest_path": "[..]Cargo.toml",
"metadata": null,
"name": "foo",
"keywords": [],
"license": null,
"license_file": null,
+ "links": null,
"manifest_path": "[..]Cargo.toml",
"metadata": null,
"name": "foo",
"keywords": [],
"license": null,
"license_file": null,
+ "links": null,
"manifest_path": "[..]",
"metadata": null,
"name": "foo",
"keywords": [],
"license": null,
"license_file": null,
+ "links": null,
"manifest_path": "[..]",
"metadata": null,
"name": "bar",
"keywords": [],
"license": null,
"license_file": null,
+ "links": null,
"manifest_path": "[..]",
"metadata": null,
"name": "bar",
)
.run();
}
+
+#[test]
+fn metadata_links() {
+ let p = project()
+ .file(
+ "Cargo.toml",
+ r#"
+ [project]
+ name = "foo"
+ version = "0.5.0"
+ links = "a"
+ "#,
+ )
+ .file("src/lib.rs", "")
+ .file("build.rs", "fn main() {}")
+ .build();
+
+ p.cargo("metadata")
+ .with_json(r#"
+{
+ "packages": [
+ {
+ "authors": [],
+ "categories": [],
+ "dependencies": [],
+ "description": null,
+ "edition": "2015",
+ "features": {},
+ "id": "foo 0.5.0 [..]",
+ "keywords": [],
+ "license": null,
+ "license_file": null,
+ "links": "a",
+ "manifest_path": "[..]/foo/Cargo.toml",
+ "metadata": null,
+ "name": "foo",
+ "readme": null,
+ "repository": null,
+ "source": null,
+ "targets": [
+ {
+ "crate_types": [
+ "lib"
+ ],
+ "edition": "2015",
+ "kind": [
+ "lib"
+ ],
+ "name": "foo",
+ "src_path": "[..]/foo/src/lib.rs"
+ },
+ {
+ "crate_types": [
+ "bin"
+ ],
+ "edition": "2015",
+ "kind": [
+ "custom-build"
+ ],
+ "name": "build-script-build",
+ "src_path": "[..]/foo/build.rs"
+ }
+ ],
+ "version": "0.5.0"
+ }
+ ],
+ "resolve": {
+ "nodes": [
+ {
+ "dependencies": [],
+ "deps": [],
+ "features": [],
+ "id": "foo 0.5.0 [..]"
+ }
+ ],
+ "root": "foo 0.5.0 [..]"
+ },
+ "target_directory": "[..]/foo/target",
+ "version": 1,
+ "workspace_members": [
+ "foo 0.5.0 [..]"
+ ],
+ "workspace_root": "[..]/foo"
+}
+"#)
+ .run()
+}
"keywords": [],
"license": null,
"license_file": null,
+ "links": null,
"description": null,
"edition": "2015",
"source":null,