关于的问题任务和failonerror属性
我制作了一个用于自动编译 Oracle Forms 文件的构建文件。代码摘录如下:
<target name="build" description="compiles the source code">
...
<foreach item="File" property="filename" failonerror="false" >
<in>
<items basedir="${source.directory}\${project.type}\Forms">
<include name="*.fmb" />
</items>
</in>
<do>
<exec program="${forms.path}" workingdir="${source.directory}\${project.type}\Forms" commandline="module=${filename} userid=${username}/${password}@${database} batch=yes module_type=form compile_all=yes window_state=minimize" />
</do>
</foreach>
...
</target>
构建文件导航到包含用户希望编译的表单的目录,并尝试编译每个表单。 failonerror 属性设置为 false,以便在发生编译错误时构建文件不会退出。然而不幸的是,虽然这会阻止构建文件在发生编译错误时退出,但它似乎也会使构建文件退出任务。这是一个问题,因为除非未成功编译的表单是最后一个被测试的表单(基于表单的文件名,按字母数字降序排列),否则构建文件将不会尝试编译一个或多个表单。因此,例如,如果包含需要编译的表单的文件夹包含 10 个表单,并且第一个表单未成功编译,则构建文件将不会尝试编译其余 9 个表单(即退出任务)。有没有办法让构建文件在遇到编译表单失败后尝试编译剩余的表单?提前致谢!
I have made a build file for the automated compilation of Oracle Forms files. An excerpt of the code is as follows:
<target name="build" description="compiles the source code">
...
<foreach item="File" property="filename" failonerror="false" >
<in>
<items basedir="${source.directory}\${project.type}\Forms">
<include name="*.fmb" />
</items>
</in>
<do>
<exec program="${forms.path}" workingdir="${source.directory}\${project.type}\Forms" commandline="module=${filename} userid=${username}/${password}@${database} batch=yes module_type=form compile_all=yes window_state=minimize" />
</do>
</foreach>
...
</target>
The build file navigates to the directory containing the forms that the user desires fo compile and attempts to compile each form. The failonerror attribute is set to false so that the build file does not exit if a compilation error occurs. Unfortunately, however, though this prevents the build file from exiting when a compilation error occurs, it also appears to make the build file exit the task. This is a problem because, unless the form that does not compile successfully is the last to be tested (based on the filename of the form in alphanumerical decsending order), there will be one or more forms that the build file does not attempt to compile. So, for example, if the folder containing the forms that are desired to be compiled contains 10 forms and the first form does not compile successfully, the build file will not attempt to compile the remaining 9 forms (ie exit the task). Is there a way to make the build file attempt to compile remaining forms after encountering after failing to compile a form? Thanks in advance!
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
抱歉,该问题现已解决。问题是您需要在任务中设置“failonerror”。
Apologies, this has now been solved. The problem is that the you need to set “failonerror” in the task instead.