Debugging Groovy scripts running in a ScriptEngine from IDEA -


in app, load script file classpath string, pass scriptengine. howerver, breakpoint set in script file doesn't trigger. how can make work? use intellij idea.

scriptengine engine = ...; string script = fileutils.readfiletostring(file); bindings bindings = engine.createbindings(); object result = engine.eval(script, bindings); 

since scriptengine.eval() method takes script string or generic reader, don't think possible achieve this. groovyscriptengineimpl class generate script name , compile class @ runtime, make hard (impossible?) debugger know breakpoint(s) associated running script.

it might not solution you, if instead invoke script using groovyshell, pretty works out of box.

example:

file file = new file(scriptdir, "scripttorun.groovy"); binding binding = new binding(); object result = new groovyshell(binding).evaluate(file); 

just remember set correct package in script if not located @ root.


Comments

Popular posts from this blog

blackberry 10 - how to add multiple markers on the google map just by url? -

php - guestbook returning database data to flash -

delphi - Dynamic file type icon -