From: Ian M. <ianm@ActiveState.com> - 2003-07-14 02:09:41
|
Brenton House wrote: > As a former Jakarta Ant user, I am always migrating scripts from Ant=20 > to NAnt as I am porting code from Java to C#. I am curious why the=20 > Property Task does not have the attribute =93File=94 for loading=20 > properties from a text file.=20 > (http://ant.apache.org/manual/CoreTasks/property.html) I know that=20 > NAnt is based on Jakarta Ant and I thought that most of the=20 > functionality was brought over as well. If the reason is simply that=20 > no one has done it, I will contribute and add that to it. If there is=20 > another reason, I am just curious what it is. > With NAnt the <import> task is the preferred means to import a large set=20 of properties. The import task pulls in an included build file where you=20 can define common properties using the <property name=3D"foo" value=3D"ba= r=20 /> syntax. The reasons for not adding the ability to load a properties from the=20 property task are: 1) the use .properties files containing name, value pairs is not a .net=20 idiom the way it is in java and: 2) having a task thats named <property> also meaning loadproperties in=20 some circumstances is a little confusing 3) the import task gives you the same functionality and more and ensures=20 that all property definitions take the form : <property name=3D"foo" value=3D"bar /> This should probably be added to the FAQ. Ian |