Reputation: 61
<?xml version="1.0"?>
<project name="Project" default="build">
<property name="program" value="C:\Program Files (x86)\Microsoft Visual Studio 9.0\VC\vcvarsall.bat" />
<property name="name.proj" value="C:\project\proj.csproj" />
<target name="build">
<exec program="${program}"commandline="\devenv.exe ${name.proj}" />
</target>
</project>
Its output is....
Error in Script usage:The Correct usage is:C:\Program Files (x86)\Microsoft Visual
Studio 9.0\VC\vcvarsall.bat" [Option], where option= x86,ia64,or x86_ia64.
But when i gives the x86 option ,it again comes with error.."/ is an unexpected token"
Please suggest what to do.
Upvotes: 0
Views: 523
Reputation: 5815
Here is a sample EXEC for get latest from VSS
<target name="getlatest" >
<property name="path.cmd.exe" value="C:\WINDOWS\system32\CMD.EXE"/>
<property name="path.vss.bat" value="C:\Work\build\DailyBuild\nAnt\VSSGET.bat"/>
<echo>
-----------------------------------------------------------------------------------------------------------------
-----------------------------------------------------------------------------------------------------------------
TASK : GET LATEST FROM VSS
-----------------------------------------------------------------------------------------------------------------
-----------------------------------------------------------------------------------------------------------------
</echo>
<echo message="Task Start at: ${datetime::now()}" />
<loadtasks assembly="nantcontrib-0.85/bin/NAnt.Contrib.Tasks.dll" />
<exec program="${path.cmd.exe}">
<arg value="/C" />
<arg value="${path.vss.bat}" />
</exec>
</target>
Upvotes: 0
Reputation: 301387
You should be doing:
<exec program="${program}" commandline="x86" />
I am not sure why you are passing devenv.exe as commandline. You probably want to do that in a separate exec task
Upvotes: 1
Reputation: 2139
have you tried this:
<exec program="${program}">
<arg value="x86" />
</exec>
Upvotes: 1