A sublime-build
file represents instructions for Sublime that ostensibly is for building your program by way of executing some external program(s) or taking some other action.
In a regular build system, you specify either a cmd
or a shell_cmd
to specify the external program to run, and Sublime uses the built in exec
command to run that program, using the other information in the sublime-build
file to either tell the exec
command how to proceed (e.g. by changing the environment) or to determine what build to use (e.g. by selecting based on the current file type).
The advanced example of a build does two things:
-
It defines a custom WindowCommand
subclass, which creates a new Sublime command in the same way that other plugins are created; this is the Python script.
-
It includes a key named target
in the sublime-build
file that instructs Sublime that when this build is selected and used, the custom command should be used to carry out the build instead of the exec
command; this is the sublime-build
file.
An advanced build is generally only needed when your build needs to do something instead of or in addition to just running an external program of some sort, which includes if you need to provide more information to the build than the defaults allow.
The example you linked to is still executing an external program, it’s just using custom code to do it. It’s also selecting on its own the command to execute by way of custom arguments in the sublime-build
file.
I’m currently working on a series of videos that goes through the creation of a custom build system and target that goes into this in more detail, though it will be a little while still before it’s completed,