refactor: reorganize source and tests
This commit is contained in:
1 parent
15d76c18a0
commit
c6205a337c
139 files changed
+5532
-5548
No files matched your search
@@ -0,0 +1,27 @@
|
||||
// maven coordinate handling shared by loader installation and launch profiles.
|
||||
|
||||
#[must_use]
|
||||
pub fn maven_coord_to_path(coord: &str) -> Option<String> {
|
||||
let parts: Vec<&str> = coord.split(':').collect();
|
||||
match parts.as_slice() {
|
||||
[group, artifact, version] => {
|
||||
let group_path = group.replace('.', "/");
|
||||
Some(format!(
|
||||
"{}/{}/{}/{}-{}.jar",
|
||||
group_path, artifact, version, artifact, version
|
||||
))
|
||||
}
|
||||
[group, artifact, version, classifier] => {
|
||||
let group_path = group.replace('.', "/");
|
||||
Some(format!(
|
||||
"{}/{}/{}/{}-{}-{}.jar",
|
||||
group_path, artifact, version, artifact, version, classifier
|
||||
))
|
||||
}
|
||||
_ => None,
|
||||
}
|
||||
}
|
||||
|
||||
#[cfg(test)]
|
||||
#[path = "../tests/loader/maven.rs"]
|
||||
mod tests;
|
||||
Reference in new issue
Block a user