ant-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From bugzi...@apache.org
Subject [Bug 1681] New - FileSet doesn't work with absolute pathnames
Date Wed, 09 May 2001 16:57:11 GMT
http://nagoya.apache.org/bugzilla/show_bug.cgi?id=1681

*** shadow/1681	Wed May  9 09:57:10 2001
--- shadow/1681.tmp.10992	Wed May  9 09:57:10 2001
***************
*** 0 ****
--- 1,65 ----
+ +============================================================================+
+ | FileSet doesn't work with absolute pathnames                               |
+ +----------------------------------------------------------------------------+
+ |        Bug #: 1681                        Product: Ant                     |
+ |       Status: NEW                         Version: 1.3                     |
+ |   Resolution:                            Platform: PC                      |
+ |     Severity: Normal                   OS/Version:                         |
+ |     Priority:                           Component: Core                    |
+ +----------------------------------------------------------------------------+
+ |  Assigned To: ant-dev@jakarta.apache.org                                   |
+ |  Reported By: Daniel.Barclay@digitalfocus.com                              |
+ |      CC list: Cc:                                                          |
+ +----------------------------------------------------------------------------+
+ |          URL:                                                              |
+ +============================================================================+
+ |                              DESCRIPTION                                   |
+ The FileSet mechanism may need a way to specify files that accepts full file
+ pathnames (not just file pathname patterns that must be relative to a root
+ directory).
+ 
+ The problem seems to be that an absolute filename does not work as a file 
+ name pattern in an "includes" attribute.
+ 
+ (I say "may" above because maybe there's another solution to my problem.)
+ 
+ I encountered the problem trying to refer to a file by absolute pathname 
+ for an "uptodate" task:
+ 
+     <uptodate property="isUpToDate" targetfile="build/.flag_file" >
+       <srcfiles dir=".">
+         <include name="${xxx.fileLocation}" />
+       </srcfiles>
+     </uptodate>
+ 
+ The value of property xxx.fileLocation is an absolute pathname (a
+ Windows filename starting with "C:/...").
+ 
+ The above snippet does not work.  It acts as if it can't find the file, 
+ that is, as if the given absolute pathname does not identify the file.
+ 
+ If I change the include element's name attribute value to a relative 
+ pathname, it works.
+ 
+ However, that does not seem to be an acceptable solution.  Either you'd
+ have to maintain separate properties to hold relative vs. absolute names,
+ or you couldn't use absolute pathnames.  (Note that I'm not talking about
+ hard-coded absolute pathnames, but absolute pathnames in properties built
+ up relatively, based on the project's base directory.)
+ 
+ It should be possible to use absolute pathnames.
+ 
+ Some possible solutions are:
+ 
+ - have pattern matching compare a given pattern to the whole absolute 
+   pathname of a candidate file (not just to the relative pathname after 
+   the base directory)
+ - (if pattern matching is intended to work that way but just doesn't on
+   Windows, try to fix handling of Windows pathnames)
+ - add additional attibutes to take file names that are not patterns 
+ 
+ (Note that the last option also provides an escape mechanism for
+ files whose names contains characters normally interpreted as wildcards.
+ I don't recall whether Ant provides an escape mechanism for referring
+ to such files, but it should, and if it doesn't, that last option is one 
+ way to do it.)

Mime
View raw message