I´m using Sublime Text 2 together with the ant build system. CTRL+B works perfectly fine to start the build with the default target. However my question is, is there a ways to define different ant build targets and have a mechanism to switch between them easily?
I thought about creating additional custom build commands for each target - for example like "clean". It works, but that is not the best approach in my eyes because you have to go to "Tools > Build System > Ant (clean)" and hit CTRL+B afterwards.
Save this build file as *.sublime-build file in the Packages/User folder
{
"selector": "source.java",
"cmd": ["ant"],
"variants": [
{ "cmd": ["solve_world_hunger"],
"name": "Solve World Hunger"
},
{ "cmd": ["ant", "clean"],
"name": "Run"
}
]
}
ctrl+b
Run
in the variants
array will run on ctrl+shift+b
name
. i.e. hit ctrl+shift+p
and type Solve World Hunger
to run the solve world hunger command.