Make -Zemit-artifact-notifications also emit the artifact type

This is easier for tooling to handle than trying to reverse-engineer it from the filename extension.
This commit is contained in:
Jeremy Fitzhardinge 2019-05-21 12:38:46 -07:00
parent 09189591c4
commit 6c38625942
7 changed files with 12 additions and 9 deletions

View file

@ -92,8 +92,8 @@ impl Emitter for JsonEmitter {
}
}
fn emit_artifact_notification(&mut self, path: &Path) {
let data = ArtifactNotification { artifact: path };
fn emit_artifact_notification(&mut self, path: &Path, artifact_type: &str) {
let data = ArtifactNotification { artifact: path, emit: artifact_type };
let result = if self.pretty {
writeln!(&mut self.dst, "{}", as_pretty_json(&data))
} else {
@ -185,6 +185,8 @@ struct DiagnosticCode {
struct ArtifactNotification<'a> {
/// The path of the artifact.
artifact: &'a Path,
/// What kind of artifact we're emitting.
emit: &'a str,
}
impl Diagnostic {