While I'm at it, I wonder if we should put a "pattern" attribute on the <includesList> element of a FileSet. I'm using these to separate some lists of files from the build scripts themselves, but it's nice to have some documentation in the file list:

-------
# This is the list of projects to build
folder/x/x.csproj
folder/y/y.csproj

# Throw in all these files for good measure
folder2/**/*.csproj
-----

Right now, this adds each of the lines "asis". I would then create a fileset like so:

<!-- Include the lines from foo.txt, skipping any that look like a comment -->
<includesList name="foo.txt" pattern="$[^#].*" />


Any comments?

Matthew Mastracci wrote:

Should we change the following lines in the LoopTask? Currently, the string is split based on a single delimiter. Since String.Split() supports a character array, we can remove the char array [0] indexer and have it split on any character in the "delim" property. I can fix this and check it in, if noone objects:

case ItemTypes.String: {
if(Delimiter != null && Delimiter.Length > 0) {
string[] items = _source.Split(Delimiter.ToCharArray()[0]);
foreach(string s in items)
DoWork(s);
}
else
throw new BuildException("Invalid delim: " + _delim, Location);
break;
}


becomes:

case ItemTypes.String: {
if(Delimiter != null && Delimiter.Length > 0) {
string[] items = _source.Split(Delimiter.ToCharArray());
foreach(string s in items)
DoWork(s);
}
else
throw new BuildException("Invalid delim: " + _delim, Location);
break;
}


It would also be nice if we could support delim and multiple properties for the foreach item="line" task to parse a file with (potentially) multiple items per line. Something along the lines of:

<foreach item="Line" in="C:\foo.txt" delim="," property="x" property="y">
 <echo message="copying ${x} to ${y}"/>
 ...
</foreach>

How does this sound?




------------------------------------------------------- This sf.net email is sponsored by:ThinkGeek Welcome to geek heaven. http://thinkgeek.com/sf _______________________________________________ Nant-developers mailing list [EMAIL PROTECTED] https://lists.sourceforge.net/lists/listinfo/nant-developers





-------------------------------------------------------
This sf.net email is sponsored by:ThinkGeek
Welcome to geek heaven.
http://thinkgeek.com/sf
_______________________________________________
Nant-developers mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/nant-developers

Reply via email to