Ant 中的文件夹选择

发布于 2024-10-08 06:03:47 字数 615 浏览 0 评论 0原文

作为构建的一部分,我将文件复制到用户指定的文件夹中。现在我正在这样做:

    <input message="Select Drive to Install Trainer" 
        addproperty="trainer.drive" validargs="c:/,d:/,q:/,z:/" />

    <input message="Enter Directory to Install Trainer" 
        addproperty="trainer.user.dir"/>


    <property name="trainer.dir" value="${trainer.drive}${trainer.user.dir}"/>

因此,用户选择驱动器号,然后输入文件夹的路径,例如:“workspaces/myworkspace”,

这将设置trainer.dir 到:“c:/workspaces/myworkspace”

有更好的方法吗?

例如,有没有办法在 ant 中调出这样的对话框?

替代文字

As part of a build I am copying files to a user specified folder.. Right now I am doing it like this:

    <input message="Select Drive to Install Trainer" 
        addproperty="trainer.drive" validargs="c:/,d:/,q:/,z:/" />

    <input message="Enter Directory to Install Trainer" 
        addproperty="trainer.user.dir"/>


    <property name="trainer.dir" value="${trainer.drive}${trainer.user.dir}"/>

So a user selects the drive letter, then enters the path to the folder like: "workspaces/myworkspace"

Which sets the trainer.dir to: "c:/workspaces/myworkspace"

Is there a better way to do this?

For instance, is there a way to bring up a dialog like this in ant?

alt text

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

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

发布评论

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

评论(2

迷爱 2024-10-15 06:03:47

听起来您想创建一个自定义 InputHandler

Sounds like you want to create a custom InputHandler.

執念 2024-10-15 06:03:47

也许AntForm就是您正在寻找的:)

它是一个java工具,旨在为Ant添加交互通过图形形式编写脚本。

来自他们的网站:

为什么使用 AntForm?

由于自动化只能推进到需要用户输入为止,因此 Ant 开发人员将在运行时提示用户输入某些属性值。当这些属性的数量增加并且某些属性值变得依赖于其他属性值时,将输入划分为表单流是有意义的。 AntForm 使您能够做到这一点。

简而言之,为了与语言级别上控制台到 GUI 的自然演变保持一致,AntForm 引入了以前存在阅读值视图的现在形式范式。

AntForm 项目的目标是提供一个简单的 GUI,它提供以下功能:

  • 用于修改属性的输入表单

  • 启动 ant 目标的基于按钮的菜单

Maybe AntForm is what you are looking for :)

It is a java tool designed to add interaction to Ant scripts through graphical forms.

From their site :

Why use AntForm?

Because automation can only be pushed so far until user input is required, the Ant developper will resort to prompting the user for certain property values at runtime. When the number of these properties increases and certain property values become dependant on others, it makes sense to divide the input into a flow of forms. AntForm enables you to do this.

In short, in keeping with the natural evolution of console-to-gui at the language level, AntForm ushers in the present-form paradigm where a read value view existed before.

The goal of the AntForm project is to provide a simple GUI that provides the following:

  • Input forms for modifying properties

  • Button-based menus that launch ant targets

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