我正在从其他目标(targetCaller)调用一个目标(targetCalled),如下所示:
<target depends="local.init"
description="creating application jar file of the classes dir"
name="run_check_server_client_jar_gen">
<antcall target="run_check_server_client_jar_callExec"/>
<if>
<isset property="result"/>
<then>
<echo>Result: ${result}</echo>
</then>
<else>
<echo>Propert result is not set yet !! </echo>
</else>
</if>
</target>
现在我从 targetCalled 调用一个 exec,如下所示:
<target depends="local.init"
description="Running check for all classes in
client jar should also be present in server jar"
name="run_check_server_client_jar_callExec">
<exec executable="/bin/bash" resultproperty="${result}" failonerror="false">
<arg value="count_client_server_inner_classes.sh"/>
<arg value="gjf1common_client_classes.jar"/>
<arg value="gjf1common_classes.jar"/>
</exec>
<if>
<isset property="result"/>
<then>
<echo>Inside::Result: ${result}</echo>
</then>
<else>
<echo>Inside::Property result is not set yet !!!! </echo>
</else>
</if>
</target>
在我的 count_client_server_inner_classes.sh 中,我退出状态为:退出“$result”它给了我“:需要数字参数”
我希望那个可执行文件应该返回一个字符串,这可能吗?
我想在我的 targetCalled 和 targetCaller 中使用这个返回值。但是当我呼应结果属性时..它给了我255。有人能指出我哪里出错了吗?