|
I've been looking over the implementation and use
of DataTypeBase; while I've been making changes to the documentation
and metedata utils.
It seems like the following is how things work
now.
-- Anything derived from DataTypeBase (with an
ElementNameAttribute) can be given an id and referenced later in the
build file.
-- These types include FileSet, Argument,
Credential, FilterSet (not in use yet), NamespaceImport, and Proxy (and all
derived classes).
The current implementation is not very useful, IMO
(with the exception of the FileSet). It seems like what a user would want
to do is not define single elements like an argument (ex. 1) but an
argument collection/array (some kind of set; see ex.1a). This is how Ant works
(by only allowing you to reference sets and complex types), and it seems to be
what I would expect for us too.
Also, I would say that static references (ex. 2)
are useful but have limited value. It seems like the real value comes when you
can do some type of merging. Even a simple xml merge would help; where you take
the data type with the id and drop the xml of the refid type onto it. Take
example 3, this xml merging would allow you to really re-use that Fileset data
type.
Our goal should be to support examples 1a and 3
before our next release. Also, we should document "Data Type" behavior and
use.
Does anyone have any comments about this
plan?
Patches to support this would great! :) C'mon who
likes to write code?
Examples:
1.)
<arg value="arg1" id="a1" />
<exec>
<arg
refid="a1"/>
</exec>
1a.)
<args id="a1" >
<arg
value="arg1"/>
<arg
value="arg2"/> </args><exec>
<args
refid="a1"/>
</exec>
2.)
<fileset id="htmlfiles">
<include
name="**/*.html"/>
</fileset>
<copy todir="somedir">
<fileset
refid="htmlfiles"/>
</copy>
3.)
<fileset id="htmlfiles">
<include
name="**/*.html"/>
</fileset>
<copy todir="somedir">
<fileset
basedir="dir1" refid="htmlfiles"/>
</copy>
|
- Re: [nant-dev] Data Types Scott Hernandez
- Re: [nant-dev] Data Types Ian MacLean
