我正在使用Ant exec任务调用批处理文件并将结果设置为resultpropery.但返回值永远不会来到Ant.以下是我的代码
<property name="BuildErrorCode" value="abc"/>
<exec executable="cmd" resultproperty="BuildErrorCode" failonerror="false"
dir="C:\workspace\build\">
<arg value="/c"/>
<arg value="cmake_cross_compile.bat"/>
</exec>
<echo message="Error Code:=${BuildErrorCode}" />
Run Code Online (Sandbox Code Playgroud)
我退出我的批处理脚本:
if %errorlevel% neq 0 exit /b %errorlevel%
Run Code Online (Sandbox Code Playgroud)
当脚本运行时,我总是得到abc值而不是批处理文件的返回值.我的批处理文件2现在返回,我必须停止构建
我想做以下事情:
知道如何让他返回价值并让蚂蚁构建失败吗?