This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

CCS v4 Headless mode and error status

Other Parts Discussed in Thread: CCSTUDIO

When I execute my build using the command-line instead of the GUI interface, I'm noticing that errors are not stopping the build nor is any system error status being returned.  This is causing problems with my continuous integration tool, Hudson (http://hudson-ci.org/).  I'm invoking the compilation as a Windows Batch command and Hudson is looking for a %ERRORLEVEL% != 0 to indicate a failure.  Unfortunately, the command line always returns a '0' for this and Hudson thinks the build was successful...when it wasn't.

I'm following the instructions located here for invoking the build: http://processors.wiki.ti.com/index.php/Projects_-_Command_Line_Build/Create

  1. Is there any way to force the build to abort and return a system error status in the event of a failed build?
  2. I know that part of the build process creates some makefiles (these disappear when a project is cleaned and re-appear when a project is built.)  Is there a way to invoke the creation of these using the command-line without the project actually being built?  I'm thinking I could implement a workaround, if the above is not possible, by calling gmake on the makefile files directly. The problem is that these are auto-generated by invoking the build itself.

Any other hints or tips to get around this will be appreciated.

Thanks!

--tim

 

  • Tim,

    I couldn't find a way to generate a proper errorlevel for the command prompt, and I think the main reason is because the executable is actually Java and not gmake.

    However, there is a way to "touch" all the targets and create the makefile without rebuilding everyting.

    Add a new Active Build Configuration to your project called Touch: right-click on the project --> Build Properties --> and select C/C++ Build in the left tree. Click on the button Manage close to the Configurations drop-down box and create a New configuration with the name Touch.

    Make sure that the configuration Touch is selected in the drop-down menu. Then click on the tab Build Settings --> deselect Use default command and replace the -k with the -t option from the command line. Save everything and run the command-line build with the option -ccs.configuration Touch at the end.

    The makefile will be generated in the subdirectory <project_dir>\Touch and can be used to build the code using gmake clean followed by gmake all.

    Hope this helps,

    Rafael

  • Rafael,

    Thanks for the quick response.  It looks like your solution should work.

    FWIW, I ended up implementing the following workaround.  Since the build command in Hudson is a Windows batch command, I took advantage of that and used grep to query the build log for the existence of "gmake" and "Error" existing on the same line (ie. that's what you see when compilation or linking or whatever fails).  Here's what I did:

    java -jar "c:\Program Files\Texas Instruments\ccsv4\eclipse\startup.jar" -data "c:\projects\hudson" -application com.ti.ccstudio.apps.projectBuild -ccs.projects SensorProcessorMain -ccs.configuration Release
    @echo off
    "c:\program files\gnuwin32\bin\grep" -iEs "gmake.*Error" %WORKSPACE%\..\builds\%BUILD_ID%\log
    if ERRORLEVEL 1 goto passed
    exit 1
    :passed
    exit 0

    Cheers,

    --tim