Sublime Forum

Buildsystem: file_regex and target

#1

Hi,

I have a build system where the command is actually a “target”. I need that because i handle parameters and such in the build system. Also i need to show option dialog
All that works great. Now my question is about the “file_regex”
I can’t get sublime text to actually see my build log, it seems
in my plugin, when running my target , i use

self.window.run_command("exec", {"cmd": cmd})

to actually run the command.
I seems to be written in the “Build console” as i see the result there.
But when building and getting an error it does not get taken by ST
This is my build system

{
    "selector": "source.javascript",
    // "working_dir": "$project_path",
    "target":"titanium",
    "file_regex": "Script\\sError\\sat\\s+(?:file:\/\/)?(^:]+):(\\d+)(?:\")?(.*?)\"?$",
}

and this is a sample error

[ERROR] Script Error at file:///Volumes/data/mguillon/Library/Application%20Support/iPhone%20Simulator/7.1/Applications/1508B233-F88D-4983-974E-F083AE948DFE/Suggest%20A%20Move%20VTT.app/lib/OfflineTraceManager.js:189:"Can't find variable: updateTracsFromPrefs"

Any idea?

Thanks

0 Likes

#2

I found my answer!
You can give the regex in the “run_command”

self.window.run_command("exec", {"cmd": cmd, "file_regex":"^(?:.*?Script\\sError\\sat\\s+(?:file:\/\/)?)(^:]+):(\\d+)(?::\"(.*?)\")?.*$"})
0 Likes

#3

For more insight on why it behaved like this, refer to docs.sublimetext.info/en/sublime … stems.html

1 Like