File Path Separators: You use os.path.join to construct file paths, which is good practice. However, in some places, you manually replace backslashes with forward slashes:
file_relative_path = file_relative_path.replace('\', '/')
This can cause issues on Windows systems. Instead, use os.path.normpath or handle paths consistently with os.path functions.
Classpath Separators: When specifying the classpath in Java commands, you use semicolons (;):
compile_test_command = ['javac', '-cp', f'{repo_path};{junit_jar};{hamcrest_jar}', unit_test_path, '-d', repo_path]
Semicolons are used as classpath separators on Windows, but on Unix-based systems (Linux, macOS), you should use colons (:). To make your script cross-platform, you can use os.pathsep:
File Path Separators: You use os.path.join to construct file paths, which is good practice. However, in some places, you manually replace backslashes with forward slashes:
file_relative_path = file_relative_path.replace('\', '/') This can cause issues on Windows systems. Instead, use os.path.normpath or handle paths consistently with os.path functions.
Classpath Separators: When specifying the classpath in Java commands, you use semicolons (;):
compile_test_command = ['javac', '-cp', f'{repo_path};{junit_jar};{hamcrest_jar}', unit_test_path, '-d', repo_path] Semicolons are used as classpath separators on Windows, but on Unix-based systems (Linux, macOS), you should use colons (:). To make your script cross-platform, you can use os.pathsep:
classpath = os.pathsep.join([repo_path, junit_jar, hamcrest_jar])