Folder Selection in Ant

As part of the assembly, I copy the files to a user-specified folder. 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}"/> 

Thus, the user selects the drive letter, then enters the folder path, for example: "workspaces / myworkspace"

What trainer.dir sets for: "c: / workspaces / myworkspace"

Is there a better way to do this?

For example, is there a way to invoke such a dialog in ant?

alt text

+4
source share
2 answers

It looks like you want to create a custom InputHandler .

+1
source

Maybe AntForm is what you are looking for :)

This is a Java tool designed to add interaction with Ant scripts through graphical forms.

From your site:

Why use AntForm?

Since automation can be pushed until user input is required, the Ant developer resorts to asking the user for specific property values ​​at run time. When the number of these properties increases, and some property values ​​become dependent on others, it makes sense to split the input into a stream of forms. AntForm allows you to do this.

In short, in accordance with the natural evolution of console-to-gui at the language level, AntForm launches the paradigm of the existing form, where the view of the representation of values ​​was previously viewed.

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

  • Input forms for changing properties

  • Button-Based Menu Launching Ant Target

+1
source

Source: https://habr.com/ru/post/1332234/


All Articles