Skip to content

Instantly share code, notes, and snippets.

@kdabir
Last active May 22, 2019 09:24
Show Gist options
  • Select an option

  • Save kdabir/2203530 to your computer and use it in GitHub Desktop.

Select an option

Save kdabir/2203530 to your computer and use it in GitHub Desktop.
Run groovy scripts from sublime-text
{
"cmd": ["groovy", "$file"],
"selector": "source.groovy",
"file_regex": "[ ]*at .+[(](.+):([0-9]+)[)]",
"windows": {
"shell": "cmd.exe"
}
}
@kdabir

kdabir commented May 7, 2012

Copy link
Copy Markdown
Author

If groovy is not found on PATH, check out here to set groovy on path for non terminal apps, or give complete path to groovy executable

@leonidasos

Copy link
Copy Markdown

Add selector for 'Automatic' build system:

"selector": "source.groovy",

@kdabir

kdabir commented Aug 26, 2013

Copy link
Copy Markdown
Author

Thanks for the "selector" tip @leonidasos

@whgreate

Copy link
Copy Markdown

it works!

@jhntrifork

Copy link
Copy Markdown

If you add the line below, you will be able to use F4 to skip to next build error:
"file_regex": "[ ]*at .+((.+):([0-9]+))",

@seanf

seanf commented Feb 7, 2014

Copy link
Copy Markdown

@jhntrifork, thanks for that. Sublime 3 gave an error about an escape character, so I went with this:

"file_regex": "[ ]*at .+[(](.+):([0-9]+)[)]",

@vherasme

vherasme commented May 22, 2019

Copy link
Copy Markdown

Hi. I am facing this issue on Ubuntu 18.04 with sublime text 3. Can anyone help?

This is my Groovy.sublime-build file:

{
    "cmd": ["groovy","$file_name"],
    "selector": "source.groovy",
    "file_regex": "[ ]*at .+[(](.+):([0-9]+)[)]",
    "shell": true
}

UPDATE:
I have solved by using the env option as incribed in this link. Now my *.build-system file looks like this:

{
    "cmd": ["/home/victor/.sdkman/candidates/groovy/2.5.7/bin/groovy $file_name"],
    "selector": "source.groovy",
    "file_regex": "[ ]*at .+[(](.+):([0-9]+)[)]",
    "shell": true,
    "env": {
    	"JAVA_HOME": "/home/victor/.sdkman/candidates/java/current"
    }
}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment