Really would like pre-build step implementation

Sysprogs forums Forums VisualGDB Really would like pre-build step implementation

Viewing 3 posts - 1 through 3 (of 3 total)
  • Author
    Posts
  • #30856
    jafeucht
    Participant

    For years, our company has been using VisualGDB, but it has one flaw which makes many things difficult for us. It does not have a way of adding a pre-build step. Most environments provide a way of doing this. We see that with the Custom or Ultimate editions, Custom Build steps are provided, however reading about them, they are a lot more powerful than we really need.

    It does appear in the Visual Studio settings, there are already custom steps for post-compile (after generation of every object file, so this is not what we want) and post-link (after everything has already been compiled, so at this point it’s too late). We need a feature like these, but they occur pre-build.

    What we really need is some way of running a single command line to run software which pretty much embeds the current SVN revision number and saves it into an *.h file. That way, the software knows what the current SVN revision number is for every new version we produce (for traceability purposes).

    Has anybody figured out a work-around for this? I’m using 5.5R5 build 4124. We are compiling using MSBuild for STM32F405RG.

    #30857
    support
    Keymaster

    Hi,

    You can always achieve this by creating custom MSBuild targets via editing the .vcxproj file. It is much less straight-forward than the custom steps provided by the VisualGDB Custom Edition, but will work just fine once you get familiar with the MSBuild internals.

    #30860
    jafeucht
    Participant

    I spent some time figuring this out. I found that what worked for me was adding the following anywhere in the *.vcxproj file under the main Project XML section:

    <Target Name="BeforeBuild" BeforeTargets="PrepareForBuild">
      <Exec Command="<<Exe call with command line>>" />
    </Target>

    What’s important with the Exec command is that all XML unsafe characters are escaped (< becomes “&gt;”, ” becomes “&quot;”, & becomes “&amp;”, etc.)

Viewing 3 posts - 1 through 3 (of 3 total)
  • You must be logged in to reply to this topic.