some way to debug a script :)
This is an excellent idea. Have to think a little bit more of how this could be accomplished.
@patriksvensson Project scriptcs has a -debug commandline option that allows just that (see documentation here). I gave it a try and it works. The documentation does not refer to it but it is also possible to attach to an existing scriptcs.exe process that is running a .csx script. Might be worth checking how they achieved it technically.
Edit: The trick is probably here in CSharpScriptInMemoryEngine.cs (see LoadAssembly).
Alright, I've completed a pretty major unit of work using Cake and the lack of breakpoint debugging, REPL was a definite source of friction as it resulted in many "printf statements and observe outcomes" cycles. Overall, really happy with Cake and would definitely use/recommend others to use it.
Now as for the way forward, I think the right approach would be to take some cues from Python.
http://stackoverflow.com/questions/6980749/simpler-way-to-put-pdb-breakpoints-in-python-code
https://docs.python.org/2/library/pdb.html
cake --debug build.cake
When --debug is set the script will break on the first line of execution and expose a debugger interface that will allow you to progress to the next line of execution and/or poke with roslyn/intermediate window/the stack. If the --debug command line option is not set then Cake execution will progress as expected unless a Breakpoint method which would provide the previously discussed behavior.
@ttollemer @ghuntley great ideas! I also would love to have this, isn't the core priority currently though, that said would fully back and help test such a contribution to Cake:+1:
Here is some interesting read on how this was accomplished in Scriptcs.
@devlead Noticed that this feature have been requested several times in the Gitter chat room. I'm also interested in this feature and interested in implementing it (if it's not already taken). I'll investigate, create a PoC and open a PR when I have something working.
@mholo65 cool 👍
@mholo65 so that we can track this, I have added you as an outside collaborator to this repository, and I have assigned this issue to you. If you end up not being able to look at this, let me know, and I will remove the assign. Thanks!!
@gep13 great! I started looking into this yesterday, still not much, but some basics can be found here https://github.com/mholo65/cake/tree/debug-support
Resolved by #858
Holy shitballs. <3
On Fri, 13 May 2016, 5:50 PM Mattias Karlsson [email protected]
wrote:
Closed #114 https://github.com/cake-build/cake/issues/114.
—
You are receiving this because you were mentioned.
Reply to this email directly or view it on GitHub
https://github.com/cake-build/cake/issues/114#event-659580601
Most helpful comment
@gep13 great! I started looking into this yesterday, still not much, but some basics can be found here https://github.com/mholo65/cake/tree/debug-support