From 8bd0054ccedcc9052f6918bcbd4628b662c8523f Mon Sep 17 00:00:00 2001 From: elijah629 <62805599+elijah629@users.noreply.github.com> Date: Sat, 4 Nov 2023 13:31:00 -0700 Subject: [PATCH 1/3] fix: classpath separator on linux is a : instead of a ; --- src/classpath.rs | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/src/classpath.rs b/src/classpath.rs index fd75e0d..aa19470 100644 --- a/src/classpath.rs +++ b/src/classpath.rs @@ -12,6 +12,12 @@ pub fn should_use_library(lib: &Library) -> bool { return is_all_rules_satisfied(rules); } + +#[cfg(target_family = "unix")] +pub const CLASSPATH_SEP: char = ':'; +#[cfg(target_famliy = "windows")] +pub const CLASSPATH_SEP: char = ';'; + pub fn create_classpath( jar_file: PathBuf, libraries_path: PathBuf, @@ -25,7 +31,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()); } } From 04f8e2d64af563bbecaf8814a15f06734d89e7f4 Mon Sep 17 00:00:00 2001 From: elijah629 <62805599+elijah629@users.noreply.github.com> Date: Sat, 4 Nov 2023 14:19:14 -0700 Subject: [PATCH 2/3] fix: platform detection --- src/classpath.rs | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/classpath.rs b/src/classpath.rs index aa19470..966d8d3 100644 --- a/src/classpath.rs +++ b/src/classpath.rs @@ -13,10 +13,11 @@ pub fn should_use_library(lib: &Library) -> bool { } -#[cfg(target_family = "unix")] +#[cfg(target_os = "linux")] pub const CLASSPATH_SEP: char = ':'; -#[cfg(target_famliy = "windows")] -pub const CLASSPATH_SEP: char = ';'; + +#[cfg(not(target_os = "linux"))] +pub const CLASSPATH_SEP: char = ';'; pub fn create_classpath( jar_file: PathBuf, From 8a8777701697b780154d549e58a5a370185e5558 Mon Sep 17 00:00:00 2001 From: elijah629 <62805599+elijah629@users.noreply.github.com> Date: Tue, 7 Nov 2023 15:12:47 -0800 Subject: [PATCH 3/3] fix: platform detection --- src/classpath.rs | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/src/classpath.rs b/src/classpath.rs index 966d8d3..18baa32 100644 --- a/src/classpath.rs +++ b/src/classpath.rs @@ -12,11 +12,10 @@ pub fn should_use_library(lib: &Library) -> bool { return is_all_rules_satisfied(rules); } - -#[cfg(target_os = "linux")] +#[cfg(not(target_os = "windows"))] // Linux and MacOS pub const CLASSPATH_SEP: char = ':'; -#[cfg(not(target_os = "linux"))] +#[cfg(target_os = "windows")] // Windows pub const CLASSPATH_SEP: char = ';'; pub fn create_classpath(