sublime文本构建系统中的文件夹路径

时间:2013-01-31 13:51:54

标签: sublimetext2

我的崇高项目如下:

{
    "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”在我的情况下......

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

1 个答案:

答案 0 :(得分:1)

你缺少" working_dir"在你的" build_systems"建立。下面的示例将使用包含sublime项目文件的目录作为构建起始目录。

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

可在以下网址找到更多信息:http://www.sublimetext.com/docs/2/projects.html