Sublime Forum

Confused about build systems

#1

When I have a single build system matching the file, you can cancel it irregardless of what file is focused. With multiple build systems, you apparently have to switch to the file it was launched from, which makes no sense given only a single build system can run at a time anyway. The stuff seems inconsistent, at least given what I know about ST.

So:

  1. With multiple build systems configured, how do I cancel the current build without having to switch to the file I started it from?
  2. Is there actually a way to run multiple build systems in parallel, without resorting to dedicated plugins?
Project builds.
[
		{
			"name": "GMC: npm i (clean)",
			"target": "terminus_exec",
			"cancel": "terminus_cancel_build",
			"shell_cmd": "C:\\dev\\ggstuff\\gmc-npm-install-clean.bat",
			"auto_close": "false",
			"title": "GMC: npm i (clean)",
		},
		{
			"name": "GMC: npm i (dirty)",
			"target": "terminus_exec",
			"cancel": "terminus_cancel_build",
			"shell_cmd": "C:\\dev\\ggstuff\\gmc-npm-install.bat",
			"auto_close": "false",
			"title": "GMC: npm i (dirty)",
		},
		{
			"name": "GMC: unit tests",
			"target": "terminus_exec",
			"cancel": "terminus_cancel_build",
			"selector": "source.ts.unittest",
			"working_dir": "$file_path",
			"auto_close": "true",
			"file_patterns": [
				"*.spec.ts"
			],
			"variants": [
				{
					"name": "1 browser",
					"shell_cmd": "ng test --browsers=ChromeHeadless --include=**/$file_name",
					"env": {
						"TIMEOUT_INTERVAL": 5000,
					},
				},
				{
					"name": "8 browsers",
					"shell_cmd": "ng test --karma-config=karma.parallel.conf.js --browsers=ChromeHeadless --include=**/$file_name",
					"env": {
						"CONCURRENCY": 8,
					},
				},
			],
		}
	]
0 Likes

#2

While ST’s default build runner is designed to execute a single task only, I don’t see reasons for for custom build targets not to be able to run multiple tasks at a time. The only thing they need to do is to create dedicated output panels and manage tasks somehow.

ST’s build system just invokes configured build and cancel build commands based on the given selectors or keyfiles. As selectors are related with active views’ syntax, it is not surprising those need to be active for cancel_build to work.

0 Likes