salesforce / bazel-java-sdk

Apache License 2.0
26 stars 2 forks source link

Create strong types for any path variables #4

Closed plaird closed 3 years ago

plaird commented 3 years ago

When porting Bazel Eclipse to Windows, I had to spend a lot of time tracking down String variables that contained paths. I had to discern if the paths were Bazel label paths (//projects/libs/apple) or relative file system paths (projects/libs/apple, that needed to be switched to projects\libs\apple) or even jar relative paths (com/xyz/foo.class that should not be switched).

On *nix, the delimiter is the same '/' so we could be vague and it worked. But to prevent Windows bugs from being introduced into the code we need to strongly type any variable that is holding a path. Something like BazelLabel (already have this) and BazelFilesystemPath (relative paths in the workspace but in FS delimiter form).

plaird commented 3 years ago

This was implemented across the listed PRs.