-
Notifications
You must be signed in to change notification settings - Fork 621
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #8859 from Turbo87/lib-or-bin
Add `has_lib` and `bin_names` fields to the versions API
- Loading branch information
Showing
29 changed files
with
438 additions
and
9 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
28 changes: 28 additions & 0 deletions
28
crates/crates_io_tarball/src/snapshots/crates_io_tarball__tests__app.snap
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
--- | ||
source: crates/crates_io_tarball/src/lib.rs | ||
expression: tarball_info.manifest.bin | ||
--- | ||
[ | ||
Product { | ||
path: Some( | ||
"src/main.rs", | ||
), | ||
name: Some( | ||
"foo", | ||
), | ||
test: true, | ||
doctest: true, | ||
bench: true, | ||
doc: true, | ||
plugin: false, | ||
proc_macro: false, | ||
harness: true, | ||
edition: None, | ||
required_features: [], | ||
crate_type: Some( | ||
[ | ||
"bin", | ||
], | ||
), | ||
}, | ||
] |
26 changes: 26 additions & 0 deletions
26
crates/crates_io_tarball/src/snapshots/crates_io_tarball__tests__lib.snap
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
--- | ||
source: crates/crates_io_tarball/src/lib.rs | ||
expression: lib | ||
--- | ||
Product { | ||
path: Some( | ||
"src/lib.rs", | ||
), | ||
name: Some( | ||
"foo", | ||
), | ||
test: true, | ||
doctest: true, | ||
bench: true, | ||
doc: true, | ||
plugin: false, | ||
proc_macro: false, | ||
harness: true, | ||
edition: None, | ||
required_features: [], | ||
crate_type: Some( | ||
[ | ||
"lib", | ||
], | ||
), | ||
} |
50 changes: 50 additions & 0 deletions
50
...rates_io_tarball/src/snapshots/crates_io_tarball__tests__lib_with_bins_and_example-2.snap
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,50 @@ | ||
--- | ||
source: crates/crates_io_tarball/src/lib.rs | ||
expression: tarball_info.manifest.bin | ||
--- | ||
[ | ||
Product { | ||
path: Some( | ||
"src/bin/bar.rs", | ||
), | ||
name: Some( | ||
"bar", | ||
), | ||
test: true, | ||
doctest: true, | ||
bench: true, | ||
doc: true, | ||
plugin: false, | ||
proc_macro: false, | ||
harness: true, | ||
edition: None, | ||
required_features: [], | ||
crate_type: Some( | ||
[ | ||
"bin", | ||
], | ||
), | ||
}, | ||
Product { | ||
path: Some( | ||
"src/bin/foo.rs", | ||
), | ||
name: Some( | ||
"foo", | ||
), | ||
test: true, | ||
doctest: true, | ||
bench: true, | ||
doc: true, | ||
plugin: false, | ||
proc_macro: false, | ||
harness: true, | ||
edition: None, | ||
required_features: [], | ||
crate_type: Some( | ||
[ | ||
"bin", | ||
], | ||
), | ||
}, | ||
] |
28 changes: 28 additions & 0 deletions
28
...rates_io_tarball/src/snapshots/crates_io_tarball__tests__lib_with_bins_and_example-3.snap
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
--- | ||
source: crates/crates_io_tarball/src/lib.rs | ||
expression: tarball_info.manifest.example | ||
--- | ||
[ | ||
Product { | ||
path: Some( | ||
"examples/how-to-use-foo.rs", | ||
), | ||
name: Some( | ||
"how-to-use-foo", | ||
), | ||
test: true, | ||
doctest: true, | ||
bench: true, | ||
doc: true, | ||
plugin: false, | ||
proc_macro: false, | ||
harness: true, | ||
edition: None, | ||
required_features: [], | ||
crate_type: Some( | ||
[ | ||
"bin", | ||
], | ||
), | ||
}, | ||
] |
26 changes: 26 additions & 0 deletions
26
.../crates_io_tarball/src/snapshots/crates_io_tarball__tests__lib_with_bins_and_example.snap
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
--- | ||
source: crates/crates_io_tarball/src/lib.rs | ||
expression: lib | ||
--- | ||
Product { | ||
path: Some( | ||
"src/lib.rs", | ||
), | ||
name: Some( | ||
"foo", | ||
), | ||
test: true, | ||
doctest: true, | ||
bench: true, | ||
doc: true, | ||
plugin: false, | ||
proc_macro: false, | ||
harness: true, | ||
edition: None, | ||
required_features: [], | ||
crate_type: Some( | ||
[ | ||
"lib", | ||
], | ||
), | ||
} |
3 changes: 3 additions & 0 deletions
3
migrations/2024-06-14-081653_add-lib-and-bins-columns/down.sql
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
alter table versions | ||
drop column has_lib, | ||
drop column bin_names; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
alter table versions | ||
add has_lib boolean, | ||
add bin_names text[]; | ||
|
||
comment on column versions.has_lib is 'TRUE if the version has a library (e.g. `src/lib.rs`), FALSE if no library was detected, or NULL if the version has not been analyzed yet.'; | ||
comment on column versions.bin_names is 'list of the names of all detected binaries in the version. the list may be empty which indicates that no binaries were detected in the version. the column may be NULL is the version has not been analyzed yet.'; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.