Skip to content

Commit

Permalink
refactor(xtask): collect artifact paths
Browse files Browse the repository at this point in the history
Signed-off-by: Martin Kröning <[email protected]>
  • Loading branch information
mkroening committed Sep 1, 2023
1 parent 701042c commit 293fb15
Showing 1 changed file with 27 additions and 15 deletions.
42 changes: 27 additions & 15 deletions xtask/src/artifact.rs
Original file line number Diff line number Diff line change
Expand Up @@ -45,26 +45,38 @@ impl Artifact {
}

pub fn builtins_archive(&self) -> Archive {
let mut builtins_archive = self.target_dir().to_path_buf();
builtins_archive.push(self.arch.hermit_triple());
builtins_archive.push("release");
builtins_archive.push("libhermit_builtins.a");
builtins_archive.into()
[
self.target_dir(),
self.arch.hermit_triple().as_ref(),
"release".as_ref(),
"libhermit_builtins.a".as_ref(),
]
.iter()
.collect::<PathBuf>()
.into()
}

pub fn build_archive(&self) -> Archive {
let mut built_archive = self.target_dir().to_path_buf();
built_archive.push(self.arch.triple());
built_archive.push(self.profile_path_component());
built_archive.push("libhermit.a");
built_archive.into()
[
self.target_dir(),
self.arch.triple().as_ref(),
self.profile_path_component().as_ref(),
"libhermit.a".as_ref(),
]
.iter()
.collect::<PathBuf>()
.into()
}

pub fn dist_archive(&self) -> Archive {
let mut dist_archive = self.target_dir().to_path_buf();
dist_archive.push(self.arch.name());
dist_archive.push(self.profile_path_component());
dist_archive.push("libhermit.a");
dist_archive.into()
[
self.target_dir(),
self.arch.name().as_ref(),
self.profile_path_component().as_ref(),
"libhermit.a".as_ref(),
]
.iter()
.collect::<PathBuf>()
.into()
}
}

0 comments on commit 293fb15

Please sign in to comment.