关于的问题任务和failonerror属性‏

发布于 2024-09-02 21:10:28 字数 1003 浏览 7 评论 0原文

我制作了一个用于自动编译 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 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

审判长 2024-09-09 21:10:28

抱歉,该问题现已解决。问题是您需要在任务中设置“failonerror”。

Apologies, this has now been solved. The problem is that the you need to set “failonerror” in the task instead.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文