Hiding password input in Ant
When writting Ant scripts I always have Ant prompt for passwords be it for SVN, SFTP, or anything else that needs to be logged into. Typically would have the following:
<input message="Please enter SVN password:" addproperty="svn.password" />
The only problem is that it echos the password back at you, there has to be a better way. So of to Google I went and found this with an interesting Ant script fragment:
<input message="secure-input:" addproperty="the.password">
<handler classname="org.apache.tools.ant.input.SecureInputHandler" />
</input>
I did not know there could be nested elements in <input>. Apparently Ant 1.7 added <handler> nested element for <input>. But nowhere is there any documentation on "SecureInputHandler".
So I tried out the fragment and as the post noted there are a few requirements to get it to work:
- Ant 1.7.1
- Java 6, if it is run on Java 5 it will fallback to a "normal" <input>
One downside, I have not been able to get it to work from within Eclipse 3.5 (since Ant 1.7.1 is bundled with it) and using Java 6 runtime. Eclipse will just hang when it gets to the "SecureInputHandler" and you have to stop the build script. It does work great from command line which is how I run all my Ant scripts anyway so it is not a real issue for me, but might be for others.
CFML Admin API Project
Well, this isn't exactly a new project. I actually started it back in 2005 when I wrote an Admin API for BlueDragon 6.2 and had a compatibility layer to map cfide.adminapi calls back to the BlueDragon Admin API.
For the past several years the code has been available on various locations. Ultimately, the Admin API for BlueDragon 6.2 that I wrote became the basis for the Open BlueDragon Admin API, but the compatiblity layer was not used. The direction of building a compatibility layer to match ColdFusion MX 7 (or later) didn't seem to be a sustainable idea, since I'd always have to chase how the ColdFusion Admin API was implemented for calls and returns.
I don't know why it didn't occur to me earlier, but it became clear while sitting in the The CFML Advisory Committee - Happy First Birthday! BOF. Forget making all the other CFML engine Admin API interfaces match ColdFusion Admin API, but make a single common Admin API interface. That is exactly what CFML Admin API is. Its goal is to provide a common Admin API methods for dealing with datasources and mappings that work on any CFML engine, particularly when creating/installing CFML applications.
The code is still very alpha and hopefully will get comments for improvements.
Subversion Auto Properties
At cf.Objective() I attended "Subversion for Smarties - Do More With Subversion" given by Cameron Childress and it was a good presentation. I picked up a few things that I didn't know before like changelists which were added in Subversion 1.5. The presentation did cover other things like svn properties on files like svn:keywords and how to add them with svn propset. While svn propset works, it is possible to set svn properties on files globally on the create of the file without having to manually setting them. This is done my modifying the subversion client configuration.
On Mac or Linux the subversion client configuration file is:
~/.subversion/config
On Windows the subversion configuration file is:
C:\Documents and Settings\{username}\Application Data\Subversion\config
Or using TortoiseSVN on Windows:
- Right click on any Windows folder
- Select TortoiseSVN -> Setting
- Click on "Edit" for Subversion configuration file
The config file is used by all subversion clients, so that once you make the change it will be used by Subclipse, TortiiseSVN, svnX, etc. The config file is nothing more than a text file with name value pairs. The file uses "#" to denote comments, remove the "#" to uncomment the line.
The first thing you need to do is find the [miscellany] section of the config file to uncomment and modify the line as shown below:
enable-auto-props = yes
Next in the [auto-props] section, remove everything below [auto-props] and replace it with below:
# Code formats
*.as = svn:eol-style=native; svn:keywords="Author Date Id Rev URL"; svn:mime-type=text/plain
*.bat = svn:eol-style=CRLF; svn:keywords="Author Date Id Rev URL"; svn:mime-type=text/plain; svn:executable
*.cmd = svn:eol-style=CRLF; svn:keywords="Author Date Id Rev URL"; svn:mime-type=text/plain; svn:executable
*.c = svn:eol-style=native; svn:keywords="Author Date Id Rev URL"; svn:mime-type=text/plain
*.cfc = svn:eol-style=native; svn:keywords="Author Date Id Rev URL"; svn:mime-type=text/plain
*.cfm = svn:eol-style=native; svn:keywords="Author Date Id Rev URL"; svn:mime-type=text/plain
*.cgi = svn:eol-style=native; svn:keywords="Author Date Id Rev URL"; svn-mine-type=text/plain
*.cpp = svn:eol-style=native; svn:keywords="Author Date Id Rev URL"; svn:mime-type=text/plain
*.groovy = svn:eol-style=native; svn:keywords="Author Date Id Rev URL"; svn:mime-type=text/plain
*.gsp = svn:eol-style=native; svn:keywords="Author Date Id Rev URL"; svn:mime-type=text/plain
*.h = svn:eol-style=native; svn:keywords="Author Date Id Rev URL"; svn:mime-type=text/plain
*.java = svn:eol-style=native; svn:keywords="Author Date Id Rev URL"; svn:mime-type=text/plain
*.js = svn:eol-style=native; svn:keywords="Author Date Id Rev URL"; svn:mime-type=text/javascript
*.jsp = svn:eol-style=native; svn:keywords="Author Date Id Rev URL"; svn:mime-type=text/plain
*.m = svn:eol-style=native; svn:keywords="Author Date Id Rev URL"; svn:mime-type=text/plain
*.php = svn:eol-style=native; svn:keywords="Author Date Id Rev URL"; svn:mime-type=text/x-php
*.pl = svn:eol-style=native; svn:keywords="Author Date Id Rev URL"; svn:mime-type=text/x-perl; svn:executable
*.pm = svn:eol-style=native; svn:keywords="Author Date Id Rev URL"; svn:mime-type=text/x-perl
*.py = svn:eol-style=native; svn:keywords="Author Date Id Rev URL"; svn:mime-type=text/x-python; svn:executable
*.sh = svn:eol-style=native; svn:keywords="Author Date Id Rev URL"; svn:mime-type=text/x-sh; svn:executable
# Image formats
*.bmp = svn:mime-type=image/bmp
*.gif = svn:mime-type=image/gif
*.ico = svn:mime-type=image/ico
*.jpeg = svn:mime-type=image/jpeg
*.jpg = svn:mime-type=image/jpeg
*.png = svn:mime-type=image/png
*.tif = svn:mime-type=image/tiff
*.tiff = svn:mime-type=image/tiff
# Data formats
*.avi = svn:mime-type=video/avi
*.doc = svn:mime-type=application/msword
*.eps = svn:mime-type=application/postscript
*.gz = svn:mime-type=application/gzip
*.jar = svn:mime-type=application/java-archive
*.mov = svn:mime-type=video/quicktime
*.mp3 = svn:mime-type=audio/mpeg
*.pdf = svn:mime-type=application/pdf
*.ppt = svn:mime-type=application/vnd.ms-powerpoint
*.ps = svn:mime-type=application/postscript
*.psd = svn:mime-type=application/photoshop
*.rtf = svn:mime-type=text/rtf
*.swf = svn:mime-type=application/x-shockwave-flash
*.tar = svn:mime-type=application/x-tar
*.tgz = svn:mime-type=application/gzip
*.wav = svn:mime-type=audio/wav
*.xls = svn:mime-type=application/vnd.ms-excel
*.zip = svn:mime-type=application/zip
# Text formats
.htaccess = svn:eol-style=native; svn:keywords="Author Date Id Rev URL"; svn:mime-type=text/plain
*.cfg = svn:eol-style=native; svn:keywords="Author Date Id Rev URL"; svn:mime-type=text/plain
*.css = svn:eol-style=native; svn:keywords="Author Date Id Rev URL"; svn:mime-type=text/css
*.csv = svn:eol-style=native; svn:keywords="Author Date Id Rev URL"; svn:mime-type=text/plain
*.dtd = svn:eol-style=native; svn:keywords="Author Date Id Rev URL"; svn:mime-type=text/xml
*.htm = svn:eol-style=native; svn:keywords="Author Date Id Rev URL"; svn:mime-type=text/html
*.html = svn:eol-style=native; svn:keywords="Author Date Id Rev URL"; svn:mime-type=text/html
*.ini = svn:eol-style=native; svn:keywords="Author Date Id Rev URL"; svn:mime-type=text/plain
*.properties = svn:eol-style=native; svn:keywords="Author Date Id Rev URL"; svn:mime-type=text/plain
*.sql = svn:eol-style=native; svn:keywords="Author Date Id Rev URL"; svn:mime-type=text/x-sql
*.txt = svn:eol-style=native; svn:keywords="Author Date Id Rev URL"; svn:mime-type=text/plain
*.xhtml = svn:eol-style=native; svn:keywords="Author Date Id Rev URL"; svn:mime-type=text/xhtml+xml
*.xml = svn:eol-style=native; svn:keywords="Author Date Id Rev URL"; svn:mime-type=text/xml
*.xsd = svn:eol-style=native; svn:keywords="Author Date Id Rev URL"; svn:mime-type=text/xml
*.xsl = svn:eol-style=native; svn:keywords="Author Date Id Rev URL"; svn:mime-type=text/xml
*.xslt = svn:eol-style=native; svn:keywords="Author Date Id Rev URL"; svn:mime-type=text/xml
*.xul = svn:eol-style=native; svn:keywords="Author Date Id Rev URL"; svn:mime-type=text/xul
*.yml = svn:eol-style=native; svn:keywords="Author Date Id Rev URL"; svn:mime-type=text/plain
AUTHORS = svn:eol-style=native; svn:keywords="Author Date Id Rev URL"; svn:mime-type=text/plain
BUGS = svn:eol-style=native; svn:keywords="Author Date Id Rev URL"; svn:mime-type=text/plain
CHANGES = svn:eol-style=native; svn:keywords="Author Date Id Rev URL"; svn:mime-type=text/plain
COPYING* = svn:eol-style=native; svn:keywords="Author Date Id Rev URL"; svn:mime-type=text/plain
DEPENDENCIES = svn:eol-style=native; svn:keywords="Author Date Id Rev URL"; svn:mime-type=text/plain
DEPRECATED = svn:eol-style=native; svn:keywords="Author Date Id Rev URL"; svn:mime-type=text/plain
INSTALL* = svn:eol-style=native; svn:keywords="Author Date Id Rev URL"; svn:mime-type=text/plain
LICENSE = svn:eol-style=native; svn:keywords="Author Date Id Rev URL"; svn:mime-type=text/plain
Makefile* = svn:eol-style=native; svn:keywords="Author Date Id Rev URL"; svn:mime-type=text/plain
MANIFEST* = svn:eol-style=native; svn:keywords="Author Date Id Rev URL"; svn:mime-type=text/plain
PLATFORMS = svn:eol-style=native; svn:keywords="Author Date Id Rev URL"; svn:mime-type=text/plain
README = svn:eol-style=native; svn:keywords="Author Date Id Rev URL"; svn:mime-type=text/plain
TODO = svn:eol-style=native; svn:keywords="Author Date Id Rev URL"; svn:mime-type=text/plain
Make sure none of the lines start with spaces, or you will get an error message. The list above is not complete, but pretty much covers all the file types I have run into. For more information on svn properties the best source is the online book, Version Control with Subversion, in particular chapter 3.