在 Sublime Text 2 中使用 Ant

发布于 2024-12-26 11:09:35 字数 294 浏览 2 评论 0原文

我在 Sublime Text 2 中与 Ant 一起使用 Build 命令时遇到问题。我定义了一个项目,在项目的根目录中有一个build.xml文件。然后在 Sublime Text 2 中,打开项目,选择“工具”->“工具”。构建系统->蚂蚁。然后,如果我尝试运行工具 ->构建,我得到以下输出:

Buildfile: build.xml does not exist!
Build failed
[Finished]

我确信我缺少一些简单的东西。我用的是Windows XP。谢谢。

I am having trouble getting the Build command in Sublime Text 2 working with Ant. I have defined a project, and in the root of the project is a build.xml file. Then in Sublime Text 2, with the project open, I choose Tools -> Build System -> Ant. Then if I try to run Tools -> Build, I get the following output:

Buildfile: build.xml does not exist!
Build failed
[Finished]

I'm sure there's something simple I'm missing. I'm on Windows XP. Thanks.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(3

默认情况下,Sublime Text 2 在项目文件夹的根目录中查找 build.xml。最简单的事情可能是将你的 build.xml 移到那里。

否则,您可以通过修改 Ant.sublime-build 来更改working_dir(不确定它在 Windows 中的位置,请在您的系统中搜索它)。或者,您可以复制该文件的内容并创建一个新的构建系统(工具 -> 构建系统 -> 新构建系统)。

查看此线程以了解更多详细信息: http ://www.sublimetext.com/forum/viewtopic.php?f=2&t=1444&start=20

By default Sublime Text 2 looks for the build.xml in the root of your project folder. The easiest thing might be moving your build.xml there.

Otherwise, you can change the working_dir by modifying the Ant.sublime-build (not sure where this lives in Windows, search your system for it). Alternately, you can copy the contents of that file and make a new build system (Tools -> Build System -> New Build System).

Take a look at this thread for more details: http://www.sublimetext.com/forum/viewtopic.php?f=2&t=1444&start=20

緦唸λ蓇 2025-01-02 11:09:35

用户“-s”或“-find”开关。这将在当前文件的项目根目录中搜索“build.xml”。如果你

{
    "cmd": ["ant", "-s"],
    "file_regex": "^ *\\[javac\\] (.+):([0-9]+):() (.*)$",
    "selector": "source.java",
    "working_dir": "${file_path}",
    "windows":
    {
        "cmd": ["ant.bat", "-s"]
    }
}

User "-s" or "-find" switch. This will search for "build.xml" towards the root of the project w.r.t. current file. If you

{
    "cmd": ["ant", "-s"],
    "file_regex": "^ *\\[javac\\] (.+):([0-9]+):() (.*)$",
    "selector": "source.java",
    "working_dir": "${file_path}",
    "windows":
    {
        "cmd": ["ant.bat", "-s"]
    }
}
情深如许 2025-01-02 11:09:35

我也遇到过同样的问题,但我已经建立了自己的 Ant 构建;
代码是

{
    "cmd": ["ant"],
    "file_regex": "^ *\\[javac\\] (.+):([0-9]+):() (.*)$",
    "working_dir": "${file_path}",
    "selector": "source.java",

    "windows":
    {
        "cmd": ["ant.bat"]
    }
}

我已将 "working_dir": "${project_path:${folder}}" 更改为 "working_dir": "${file_path}"。因为,我不喜欢将 st2 生成的东西放在项目目录中。

I have occurred the same problems, but I have set up my own Ant build;
the code is

{
    "cmd": ["ant"],
    "file_regex": "^ *\\[javac\\] (.+):([0-9]+):() (.*)$",
    "working_dir": "${file_path}",
    "selector": "source.java",

    "windows":
    {
        "cmd": ["ant.bat"]
    }
}

I've changed the "working_dir": "${project_path:${folder}}" to "working_dir": "${file_path}". Because, I do not like to put the very things generate by st2 in the project dir.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文