EXEC task with '|' in arguments
I'm trying to do a VS build using the hyperibuild method in 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 ANT script can handle '|' as a separator or something ...
Any ideas how I can get this to work?
I've also tried the following, but nothing helps me:
<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"" />
+1
a source to share
3 answers
You need to escape the pipe character by preceding it with the ^ character. So:
<arg line='buildconsole solution.sln /rebuild /cfg="Release^|Win32"' />
EDIT:
Are you sure the carriage isn't working? It seems that in this example 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>
+3
a source to share