1

我的崇高项目如下所示:

{
    "folders":
    [
        {
            "folder_exclude_patterns":
            [
                ".bzr",
                "build",
                "webapps",
                "work",
                ".settings"
            ],
            "path": "/home/charles/project/Editor/trunk"
        }
    ],
    "settings":
    {
        "build_on_save": true,
        "filename_filter": "\\.(java)$",
        "tab_size": 4,
        "translate_tabs_to_spaces": false
    },
    "build_systems":
    [
        {
            "name": "compile",
            "cmd": ["ant", "-f", "dev.xml", "compile"]
        }
    ]
}

当我保存文件时,控制台说:

Buildfile: dev.xml does not exist!
Build failed
[Finished in 0.2s with exit code 1]

我知道我需要在 dev.xml 之前放一些东西,但我不知道是什么。

我在这里找到了一些可能性:http: //sublimetext.info/docs/en/reference/build_systems.html#variables

但在我的情况下,我需要的是文件夹路径“/home/charles/project/Editor/trunk”...

知道如何实现这一目标吗?

4

1 回答 1

1

您在“build_systems”设置中缺少“working_dir”。下面的示例将使用包含 sublime 项目文件的目录作为构建起始目录。

"build_systems":
[
    {
        "name": "compile",
        "working_dir": "${project_path}",
        "cmd": ["ant", "-f", "dev.xml", "compile"]
    }
]

更多信息请访问:http ://www.sublimetext.com/docs/2/projects.html

于 2014-06-19T07:08:56.300 回答