public static void copyProperties(Hashtable props,
Project project) {
Enumeration e = props.keys();
while ( e.hasMoreElements() )
{
String key = e.nextElement().toString();
if ( "basedir".equals( key ) || "ant.file".equals( key ) )
{
// basedir and ant.file get special treatment in execute()
continue;
}
String value = props.get( key ).toString();
// don't re-set user properties, avoid the warning message
if ( project.getProperty( key ) == null )
{
// no user property
project.setNewProperty( key, value );
}
}
}
Copies all properties from the given table to the new project - omitting those that have already been set in the
new project as well as properties named basedir or ant.file. |