Sublime Forum

Combine variants and platforms in a single build system

#1

Hello!
I’ve got multiple build systems which are meant to be variants of building process for a single Markdown document. For example, one build system converts the document via pandoc to Docx, another to HTML etc. Every build system file contains “osx” and “windows” elements as described in Unofficial documentation, because pandoc path on OS X and Win differs.

To ease maintaining of all the conversion cases, I decided to create a single build system file with help of ‘variants’ (described in the same section of ST Unofficial documentation). I created a keybinding following this recommendation to show the menu of all the variants of current build system. This works perfectly, until you don’t add platforms into the mixture.

Here’s how my build system looks now:

{
	"working_dir": "$file_path",
	"osx": {
		"shell_cmd": "...",
		"path": "/usr/local/bin:$PATH",
		"variants": 
			{
				"shell_cmd": "...",
				"name": "From offline"
			},
			{
				"shell_cmd": "...",
				"name": "To standalone file"
			}
		]
	},
	"windows": {
		"shell_cmd": "...",
		"path": "/usr/local/bin:$PATH",
		"variants": 
			{
				"shell_cmd": "...",
				"name": "From offline"
			},
			{
				"shell_cmd": "...",
				"name": "To standalone file"
			},
			{
				"shell_cmd": "...",
				"name": "To standalone folder (not ready)"
			}
		]
	}
}

This does not appear to work at all - no variants are given in the Build variants menu. Could you please help me with that?

0 Likes