Author Topic: concur_command  (Read 6162 times)

murali

  • Community Member
  • Posts: 31
  • Hero Points: 0
concur_command
« on: February 19, 2010, 07:45:37 AM »
Hi all,

How can I find out when the cmd issue via concur_command actually finished? I am trying to setup error markers to be set, once my build completes. But I dont want to hack my build script to add the set-error-markers macro.

I saw that there is an API _postbuild_build_set_error_markers that seem to be doing the same thing I want, but I dont see how that would get triggered.

Any pointers?

thanks
Murali

shadowbane

  • Community Member
  • Posts: 85
  • Hero Points: 4
Re: concur_command
« Reply #1 on: February 19, 2010, 06:47:06 PM »
Looks like _postbuild_ is called via call_list().  Look at the help for call_list. If you create your own function named _postbuild_blahblahblah where blahblahblah is whatever you want.  That rountine should get called when the build completes. Its passed args, but I haven't researched what the args are.

- Tyler

murali

  • Community Member
  • Posts: 31
  • Hero Points: 0
Re: concur_command
« Reply #2 on: February 19, 2010, 07:43:25 PM »
I saw that it is called from _vsbuild_socket_recv but I am not able to use the vsbuild system, as the apis to setup vsbuild with this command are all static in compile.e. Any reason why we can't use vsbuild to execute our custom cmds? It would be nice to have a simple way of creating a build command programmatically and use vsbuild to run the build command.

Lee

  • SlickEdit Team Member
  • Senior Community Member
  • *
  • Posts: 1299
  • Hero Points: 130
Re: concur_command
« Reply #3 on: February 19, 2010, 08:10:27 PM »
_postbuild_ callbacks are triggered specifically by a signal sent from vsbuild to slickedit via socket.  In theory, it should be possible to shell out vsbuild and use the -execute option to pass in a command for vsbuild to execute.  You would need to ensure that SlickEdit was listening for the signal (done in _vsbuild_signal_init()) and you would need to include the -signal switch to vsbuild to pass in the listening socket port number.  Of course, all _postbuild_ callbacks get called, there is no way to just call any specific one. 

If your build is an external script or executable, you should be able to just set your Build command to that, or create a new Build tool in Project Properties.  In most cases, it should by default use vsbuild to shell out your build command.  That way you get the error markers triggered without any extra hassle.  There are some cases where vsbuild is explicitly not used to do the builds, but it can be passed generic command-line to be processed.  It should be possible to do what you want.

shadowbane

  • Community Member
  • Posts: 85
  • Hero Points: 4
Re: concur_command
« Reply #4 on: February 19, 2010, 08:20:41 PM »
Doh! After re-reading your initial post, it struck me that I'm doing this same thing with one of my builds.  The build command is basically this:
D:\...\JamRefreshSolution.bat && vs -#doRefreshProjectTree

where I have a command called doRefreshProjectTree that reloads the workspace (this particular build command regenerates the vpj and vpw files).

This only works if you only have a single instance of vs running, since otherwise the command may be run on the other instance.

-Tyler

murali

  • Community Member
  • Posts: 31
  • Hero Points: 0
Re: concur_command
« Reply #5 on: February 20, 2010, 05:02:34 PM »
That worked!! The only thing is that the build might fail and we need this macro to get executed especially for that. So I modified the command line as 

build.bat all && vs "-#build_done 1" || vs "-#build_done 0"

as && block is executed if build succeeds and || block gets executed when build fails.

Awesome tip!! thanks again