Reputation:
I'm trying to exec a VS build using incredibuild within my ANT script, but For some reason the exec task fails with the following error:
'Win32' is not recognized as an internal or external command
when I use the following code:
<arg line='buildconsole solution.sln /rebuild /cfg="Release|Win32"' />
I think the ant script may be treating the '|' as a delimter or something...
Any ideas how I could get this to work?
I've also tried the following, but nothing gets me closer:
<arg line='buildconsole solution.sln /rebuild /cfg="Release|Win32"' />
<arg value="buildconsole solution.sln /rebuild /cfg="Release|Win32"" />
<arg value="buildconsole solution.sln /rebuild /cfg="Release|Win32"" />
Upvotes: 1
Views: 2298
Reputation:
Hmm... I just tried it again and it worked, but only after I changed to
<arg value="buildconsole solution.sln /rebuild /cfg=Release^|Win32" />
so I guess the quotes around Release^|Win32 wasn't necessary if I use value.
Thanks a bunch!
Upvotes: 1
Reputation: 30449
You need to escape the pipe symbol by preceding it with ^. So:
<arg line='buildconsole solution.sln /rebuild /cfg="Release^|Win32"' />
EDIT:
Are you sure the caret doesn't work? It seems to in this sample ant file:
<?xml version="1.0" encoding="UTF-8"?>
<project name="Test" default="build" basedir=".">
<target name="build">
<exec executable="cmd">
<arg line="/k echo cfg="Release^|Win32""/>
</exec>
</target>
</project>
Upvotes: 3
Reputation: 2015
I think the problem is that the Windows command prompt sees the | and treats it as a "pipe" operator. Perhaps escape the pipe by using:
<arg line='buildconsole solution.sln /rebuild /cfg="Release\|Win32"' />
Upvotes: 0