From: Gert D. <ger...@pa...> - 2005-01-27 19:58:11
|
Hi, I've added a possible implementation to CVS that allows us to support global collections. To summarize implementation : - modify the collection class to derive from a new DataTypeCollectionBase - have it implement Ilist - add an ElementName attribute (with the name of the global type) - add a BuildElement attribute to the Add method Classes that use the collection should have both a getter and a setter for the collection to allow the referenced type to be set. That last part is what I have a problem with: I'd really like to have an implementation that avoids the need for having setters on collection based properties. Anyone have any bright ideas on this or does anyone have time to give this some thought ? How exactly has support for referencable types been implemented in Ant ? Any lessons we can learn from them ? As a example / proof of concept, I've transformed the <imports> child element that is used in <vbc>, <script> and <asminfo> into a global type called <namespaceimports>. This allows the following build fragment to be used: <project name="whatever" default="build"> <namespaceimports id="test.imports"> <import namespace="System" /> <import namespace="System.Data" /> <import namespace="System.Windows.Forms" /> </namespaceimports> <target name="build"> <vbc ...> <imports refid="test.imports" /> ... </vbc> </target> </project> Any feedback on the implementation is greatly appreciated ! Gert |