问题
When I run the basic Ant Build from Sublime Text 2 (Ctrl+B), it works, but it runs all targets. I want to specify/override the default build target. I added a new build system like:
{
"cmd": ["ant", "my_target"]
}
But it fails with:
[Error 2] The system cannot find the file specified
[Finished]
Whats wrong?
回答1:
The sublimetext buildsystems documentation page show how you can make a special case to execute "ant.bat" instead of "ant" on Windows. See the section "Platform-specific Options":
The windows, osx and linux elements let you provide platform-specific data in the build system. Here’s an example:
{ "cmd": ["ant"], "file_regex": "^ *\\[javac\\] (.+):([0-9]+):() (.*)$", "working_dir": "${project_path:${folder}}", "selector": "source.java", "windows": { "cmd": ["ant.bat"] } }
In this case, ant will be executed for every platform except Windows, where ant.bat will be used instead.
Does that help?
来源:https://stackoverflow.com/questions/10925547/sublime-text-2-ant-build-target-error-2-the-system-cannot-find-the-file-speci