Ant获取在运行时获取的参数的值
我有一个Ant构建任务,在这个任务中,我需要根据运行时获得的值查找属性文件。例如,我在属性文件中有以下信息Ant获取在运行时获取的参数的值,ant,Ant,我有一个Ant构建任务,在这个任务中,我需要根据运行时获得的值查找属性文件。例如,我在属性文件中有以下信息 COMPLETE_LIST=TEST1,TEST2,TEST3 TEST1=val1 TEST2=val2 TEST3=val3 在我的Ant目标中,我有以下任务 <target name="target_main"> <foreach param="profile_name" list="${COMPLETE_LIST}" target="target_chi
COMPLETE_LIST=TEST1,TEST2,TEST3
TEST1=val1
TEST2=val2
TEST3=val3
在我的Ant目标中,我有以下任务
<target name="target_main">
<foreach param="profile_name" list="${COMPLETE_LIST}" target="target_child">
</foreach>
</target>
<target name="target_child">
<echo>Printing the value of the param passed ${${profile_name}}</echo>
</target>
打印传递的参数值${${profile_name}
但这是行不通的。有没有办法获取作为参数传递的
TEST1
的值?由于您已经在使用,该任务将帮助您完成所需的操作。以下是根据您的目的修改的target\u child
的主体:
<target name="target_child">
<propertycopy name="value" from="${profile_name}"/>
<echo>Printing the value of the param passed ${${profile_name}}</echo>
</target>
由于您已经在使用,该任务将帮助您完成所需的操作。以下是根据您的目的修改的
target\u child
的主体:
<target name="target_child">
<propertycopy name="value" from="${profile_name}"/>
<echo>Printing the value of the param passed ${${profile_name}}</echo>
</target>