2

My sublime project looks like this:

{
    "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"]
        }
    ]
}

When I save a file the console says:

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

I know that I need to put something before dev.xml but I don't know what.

I found some possibilities here: http://sublimetext.info/docs/en/reference/build_systems.html#variables

But What I need is the folder path "/home/charles/project/Editor/trunk" in my case...

Any idea how I can achieve this?

2
  • Have you tried to replace "dev.xml" by "/path/to/dev.xml"? Commented Feb 3, 2013 at 8:40
  • Yes it work but I want to use the command for many folders. Commented Feb 3, 2013 at 14:54

1 Answer 1

1

You are missing "working_dir" in your "build_systems" setup. The example below will use the directory that holds the sublime project file as the build starting directory.

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

More information can be found at: http://www.sublimetext.com/docs/2/projects.html

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.