I like to have an API method that expand the Build System Variables what happened when used in the “cmd” tag in the .sublime-build:
$file_path The directory of the current file, e. g., C:\Files.
$file The full path to the current file, e. g., C:\Files\Chapter1.txt.
$file_name The name portion of the current file, e. g., Chapter1.txt.
$file_extension The extension portion of the current file, e. g., txt.
$file_base_name The name only portion of the current file, e. g., Document.
$packages The full path to the Packages folder.
$project The full path to the current project file.
$project_path The directory of the current project file.
$project_name The name portion of the current project file.
$project_extension The extension portion of the current project file.
$project_base_name The name only portion of the current project file.
A method in the View class look the right place to do this.
Some plugins use some kind of “cmd” too and need this kind of vars.
If the internal method is exposed, we don’t need to do it by ourself for each plugins.