Community
Participate
Working Groups
After correcting the permgen execution problem by making sub-projects run under a new shell (using <exec .."ant">) we changed this under windows to run "ant.bat". This works fine, except that, under Windows, the ERRORLEVEL appears to be lost -- so we cannot abort the build if a step fails (normal practice).
Lots of tests tried here: 1) Fixed problem with failonerror set to true (it should be set to false and the returncode checked explicitly. -- BUT WINDOWS ant.bat returns 0 :-( when it should return 1 on failure. 2) Tried calling ant.bat via cmd.exe /c (advice from ant website/blogs) -- WINDOWS gives return code 0. 3) Investigated using <ant> task instead of <subant> but cannot iterate through projects easily, and it probably suffers from the same problem as direct <subant> (viz. permgen problems caused by ivy). 4) Tried various options on cmd.exe to get ERRORLEVEL back (ERRORLEVEL is properly set, I think). -- exec seems incapable of getting the value back. I'm leaving this problem open and asking any interested parties to see if they can find a solution.
Committed changes to virgo-build at version 1.34: SHA: 676173b3a40ddbe0de4820ea1653b4e1fd181287 Author: Steve Powell <spowell@vmware.com> Date: Wed Oct 20 2010 17:13:16 GMT+0100 (BST) Subject: Tidy up exec-ant target to diagnose return codes.
Pushed virgo-build 1.34 to all master repositories.
Pushed virgo-build 1.34 to 2.1.x branches (and connected). This change does not affect shipped code.
The search returned a proposal for wrapping the execution in batch file(s). This is proposed here: http://stackoverflow.com/questions/1456979/why-does-ant-bat-not-return-an-error-status-when-run-programmatically However this workaround looks quite ugly...
(In reply to comment #5) Hristo, I had already seen that solution, thank you, and rejected it for ugly reasons and since it required us to supply two bat files to the build. However, after exhausting many other solutions I returned to this one and determined to find out why it might work. I found out that a single bat file works well. This means that my solution is now going in to virgo-build 1.35. Thanks for the work.
SHA: a88282f1b0fddde381c33ed4866648cc9ef33b57 Author: Steve Powell <spowell@vmware.com> Date: Thu Oct 21 2010 12:15:32 GMT+0100 (BST) Subject: Solves Bug 328246 - Windows ant builds do not stop when jar or test.do fails in subproject. Refs: master; origin/HEAD; origin/master; 1.35
Updated all 2.1.x repo branches (and gemini-web-container 1.1.x) to use virgo-build 1.35.
Updated all master repo branches to use virgo-build 1.35.