This is how I do it. I created a separate batch script that configures environment for VisualStudio.Net and starts ANT (the script allows local setpath.bat, if local environment is different):

if not "%MSVCDir%" == "" goto build

call "%VS71COMNTOOLS%vsvars32.bat"

:build
call %~dp0ant.bat %*

Unfortunately it does not work with VisualStudio 2005. So there is another trick. This script allows local setpath.bat script to setup configuration. If setpath.bat does not exist, default script (setpath.bat.orig - it should be in your version control) is used. Please substitute MSVCDir environment variable with any other variable to check, if setpath.bat was already executed.

if not "%MSVCDir%" == "" goto build

if exist %~dp0setpath.bat goto runsetpath
copy setpath.bat.orig setpath.bat

:runsetpath
echo Executing setpath.bat
call %~dp0setpath.bat

:build
call %~dp0ant.bat %*

- Alexey.

shreedhar natarajan wrote:
hi guys,

Have anybody used cl/msvc compiler in their build. Visual Studio .Net 2003 internally 
executes vsvars.bat that set a different env. variables. Only then it is possible to use 
"cl" from command prompt. The task cc requires compiler to be run from the 
command prompt. Not sure what is the best way to do that. Any examples wud be helpful.

Best rgds
Shreedhar


-----Original Message-----
From: Wascally Wabbit [mailto:[EMAIL PROTECTED]
Sent: Wednesday, December 28, 2005 11:48 AM
To: Ant Users List
Cc: [EMAIL PROTECTED]
Subject: Re: running mutliple ant files


If you can use AntXtras (http://jware.info/) extensions, you could
do something like:

Example 1:
<foreach i="test-file" list="${list-of-test-files}" mode="local"
          haltiferror="no" tryeach="yes" failproperty="not.clean">
   <ant antfile="${test-file}"/>
</foreach>
<fail if="not.clean" message="Something barfed"/>


Example 2 (to capture logs per test iff it fails):
<property name="LOGS" value="...."/>
<foreach i="test-file" list="${list-of-test-files" mode="local"
          haltiferror="no" tryeach="yes" failproperty="not.clean">
   <capturelogs>
      <protect>
         <ant antfile="${test-file}"/>
         <iferror quiet="yes">
          <copylogged tofile="${LOGS}/log-${antfile}" important="no"/>
        </iferror>
      </protect>
   </capturelogs>
</foreach>
<fail if="not.clean" message="Something barfed"/>


At 01:51 PM 12/27/2005, you wrote:
i'm trying to find a function/loop that will run all ant test files in a directory that will just run one file after another even if there are errors i've tried a few things that haven't worked, any ideas or snips of code that will put me on the right path?

Steven Rogers
Developer at NumberSix, Asheville
XXX-XXX-XXXX XXX
email: srogers at numbersix dot com


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

The Wabbit


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to