Home Download Buy Blog Forum Support

ST3 build systems with variants in project

ST3 build systems with variants in project

Postby mlepage on Mon Sep 30, 2013 9:06 pm

I have been following the docs here http://docs.sublimetext.info/en/latest/ ... stems.html

and managed to produce a build system that works well, from within my project. I tried to add a variant as described. I am finding that neither command-shift-B nor ctrl-shift-B execute the variant, as I expected.

I am on a Mac and the build system (with variant) is in my project file. Are variants not supported there? Should this work? Is it a bug?

The variant works fine when I make it a completely separate build system (in the project). I wanted to use a variant so I could easily switch between the two. (One compiles an app, the variant runs the app.)
mlepage
 
Posts: 31
Joined: Tue Sep 03, 2013 2:30 pm

Re: ST3 build systems with variants in project

Postby bizoo on Tue Oct 01, 2013 7:09 am

Variants must be displayed in the Command Palette, open it and type:
Code: Select all
Build:

If the keybinding doesn't work, it could be because another package steal it.
Open the console and type:
Code: Select all
sublime.log_commands(True)

Execute the keybinding and look at the console if it's the correct command that is executed.
bizoo
 
Posts: 919
Joined: Wed Dec 08, 2010 6:53 am
Location: Switzerland

Re: ST3 build systems with variants in project

Postby deesnider on Wed Oct 15, 2014 5:37 pm

I'm having a somewhat similar issue. I am on Windows. Using latest ST3 build 3064. I've defined a build variant but Ctrl + Shift + B runs the main build exe, not the variant.

Code: Select all
{
   "selector": "source.js",
   "cmd": ["D:\\Bundler1.bat"],
   "working_dir": "D:\\",
   "variants": [{
      "name": "Bundler2",
      "cmd": ["D:\\Bundler2.bat"],
      "working_dir": "D:\"
   }]
}


Note the variant does show up in the command palette, but I'm trying to use the shortcut keys.

Ctrl + B => runs Bundler1.bat as expected
Ctrl + Shift + B => runs Bundler1.bat (not expected)

I've run

Code: Select all
sublime.log_commands(True)

and it shows that it should be triggering the variant:

Code: Select all
command: build {"variant": "Run"}
Running D:\\Bundler1.bat
deesnider
 
Posts: 1
Joined: Wed Oct 15, 2014 5:32 pm

Re: ST3 build systems with variants in project

Postby squishleheimer on Tue Jan 06, 2015 7:56 am

I am getting the same issue on Win7x64 ST3 build 3065. The variant is not running. This used to work for me but I can't recall what build. Obviously pre-3064.

Code: Select all
{
   "cmd": ["EncryptionTool.exe", "-e", "$file", "%USERPROFILE%/Desktop/Filter.xmle"],
   "path": "C:\PathToTool",
   "shell": true,

   "variants": [
      {
         "name": "To Thumb Drive",
         "cmd": ["EncryptionTool.exe", "-e", "$file", "G:/Filter.xmle"],
         "path": "C:\PathToTool"
      }
   ]
}


The console reports:

Running EncryptionTool.exe -e C:\SomePath\InputFile.xml %USERPROFILE%/Desktop/Filter.xmle
command: build {"variant": "Run"}

[EDIT]: I also recall there being an additional menu item in the Tools menu to invoke the variant (if I'm not mistaken) but now it's gone.
squishleheimer
 
Posts: 1
Joined: Tue Jan 06, 2015 7:50 am


Return to Technical Support

Who is online

Users browsing this forum: Google [Bot] and 33 guests