Bugs item #1405061, was opened at 2006-01-13 12:23 Message generated for change (Tracker Item Submitted) made by Item Submitter You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=402868&aid=1405061&group_id=31650
Please note that this message will contain a full copy of the comment thread, including the initial issue submission, for this request, not just the latest update. Category: Tasks Group: 0.85 Status: Open Resolution: None Priority: 5 Submitted By: Jordan Samuels (jordansamuels) Assigned to: Nobody/Anonymous (nobody) Summary: FileSet and DirSet / BuildElement initialization broken Initial Comment: ======= The bug ======= FileSet and DirSet initialization appears to depend on the path to the nant file itself, and not the current working directory. In particular, if the nant file is in a different directory, and FileSet and DirSet elements are specified in the nant script using relative paths, then they are incorrectly initialized based on the relative path of the nant file, not the current working directory. Due to the (bug/feature?) that FileSet and DirSet creation silently masks file-not-found errors, it's virtually impossible to determine the cause of empty file/dir sets without intimate knowledge of this initialization flaw. ============ The platform ============ Windows XP Professional, NAnt 0.85 (Build 0.85.1932.0; rc3; 4/16/2005). Reproduction The attached file "FileAndDirTask.cs" defines a subclass of Nant.Core.Task task in C#. This task contains BuildElement's FileSet and DirSet, and it display the size of each set based on the initialized performed automatically by nant. The nant file used for testing is: <?xml version='1.0'?> <project name="Bug"> <target name='test'> <loadtasks assembly='C:\FileAndDir.dll' /> <FileAndDir> <Files> <include name='file1.txt' /> </Files> <Dirs> <include name='dir1' /> </Dirs> </FileAndDir> </target> </project> If file1.txt and dir1 are in the current directory, and I run nant like this: nant -buildfile:FileAndDir.nant test The task outputs "I have 1 files and 1 dirs ." If, however, I move the nant file up one directory, and run nant like this: nant -buildfile:..\FileAndDir.nant test The task outputs "I have 0 files and 0 dirs ." ---------------------------------------------------------------------- You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=402868&aid=1405061&group_id=31650 ------------------------------------------------------- This SF.net email is sponsored by: Splunk Inc. Do you grep through log files for problems? Stop! Download the new AJAX search engine that makes searching your log files as easy as surfing the web. DOWNLOAD SPLUNK! http://ads.osdn.com/?ad_id=7637&alloc_id=16865&op=click _______________________________________________ nant-developers mailing list nant-developers@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/nant-developers