|
I recently got an assignment where I needed to run all of my build scripts from Ant. The reason was simply that the ALM solution that I was implementing could only accept build status return codes from an Ant directive. Since the project involved C/C++ all of the build scripts were written using GNU Make. My goal was to be able to execute the Makefile from within an Ant build.xml and receive the return code back in the Ant script. Here is how I approached the solution.running an executable from Ant Ant has an exec core task that can easily run any command at the operating level including make. The tricky part is capturing the return code from make.
When I run the ant script, the Makefile is called and the hello.c program is built successfully.
The Makefile Build status above is equal to "0" because the build was successful. Next I will make a mistake in the C program which will cause the Makefile build to fail.
Set as favorite
Bookmark
Email this
Hits: 7076 Trackback(0)Comments (4)
|
|
... As noted, the output of "cat ..." is not rendered correctly in the box, I suspect the real xml tags are not being escaped for viewing by the html rendering agent which doesn't know what to do with and ? ... failonerror="false" failifexecutionfails="false" resultproperty="myStatus" errorproperty="/tmp/error.out" outputproperty="/tmp/foo.out" error="/tmp/error.txt" output="/tmp/output.txt"> |
|
Bob Aiello
said:
|
... oh my - that is awful. I wish that I could say that I did that on purpose to see if anyone was reading it :-) We will get that fixed asap and THANK YOU! Hey how about sharing YOUR example :-) |
|
JulieAnnaB
said:
|
... Hi Bob, thanks for posting this. I think there is some great information here, but it isn't being displayed properly. The cat of "runMakefile.xml" isn't complete: no target or exec is displayed. Also, in the section "Ant references", there is nothing displayed after "..as follows:". I had to view the source to get more info. I got the exec of make to work, now I need to get the status of the make propagated. Thanks. |
|


I recently got an assignment where I needed to run all of my build scripts from Ant. The reason was simply that the ALM solution that I was implementing could only accept build status return codes from an Ant directive. Since the project involved C/C++ all of the build scripts were written using GNU Make. My goal was to be able to execute the Makefile from within an Ant build.xml and receive the return code back in the Ant script. Here is how I approached the solution.
