Skip to content
Open
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 8 additions & 1 deletion src/classpath.rs
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,13 @@ pub fn should_use_library(lib: &Library) -> bool {
return is_all_rules_satisfied(rules);
}


#[cfg(target_os = "linux")]
pub const CLASSPATH_SEP: char = ':';

#[cfg(not(target_os = "linux"))]
pub const CLASSPATH_SEP: char = ';';

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Classpath separator for Windows is ;, for Linux and MacOS :

You should use :

#[cfg(not(target_os = "windows"))] // Linux and MacOS
pub const CLASSPATH_SEP: char = ':';

#[cfg(target_os = "windows")] // Windows
pub const CLASSPATH_SEP: char = ';';


pub fn create_classpath(
jar_file: PathBuf,
libraries_path: PathBuf,
Expand All @@ -25,7 +32,7 @@ pub fn create_classpath(
let artifact = &lib.downloads.artifact;
let lib_path = artifact.path.clone();
let fixed_lib_path = Path::new(&libraries_path).join(lib_path.replace("/", "\\"));
classpath = format!("{};{}", classpath, fixed_lib_path.to_str().unwrap());
classpath = format!("{}{}{}", classpath, CLASSPATH_SEP, fixed_lib_path.to_str().unwrap());
}
}

Expand Down