e grubbs

Greenhorn
+ Follow
since Jun 30, 2006
Merit badge: grant badges
For More
Cows and Likes
Cows
Total received
In last 30 days
0
Forums and Threads

Recent posts by e grubbs

It is annoying that you can only specify a different inputhandler on the ant command line, .antrc, .ant/ant.conf, or /etc/antrc, but you can override it in the build.xml, which means you have to configure every person's workstation separately, and they can just check out the repository and go.

Here is a workaround that works in Linux and presumably any other *nix.


<project name="blah">
<target name="get-login">
<input message="Enter Username:" addproperty="login-props.username"/>

<!-- get the password if it wasn't defined in the login properties file -->
<!-- Turn off echoing of password to terminal.
"-isig" is necessary to prevent you from hitting control-C to
kill ant, and then you are stuck in your terminal which doesn't echo
any of the commands you type.
-->
<exec executable="sh">
<arg line="-c 'stty -echo -isig < /dev/tty'"/>
</exec>
<input message="Enter Password:" addproperty="login-props.password"/>
<exec executable="sh">
<arg line="-c 'stty echo isig < /dev/tty'"/>
</exec>

<echo message="Username: ${login-props.username}" />
<echo message="Password: ${login-props.password}" />
</target>
</project>

I found out how to turn off the echoing of the password by looking at the source code for jline.
http://jline.sourceforge.net/
18 years ago