ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Jeremy Weber <jeremy.we...@activevos.com>
Subject Re: Programmatically create a fileset and reference
Date Mon, 05 May 2008 15:09:48 GMT
Seems like the most simple approach.  Transforming the csv file to be 
line delimited is not an issue, however something else seems to be amiss.

CSV file after transform:

C:\Documents and Settings\jweber\Desktop\db2_test\db2jcc_license_cu.jar
C:\Documents and Settings\jweber\Desktop\db2_test\db2jcc.jar

Copy Test:

      <copy toDir="./destination">
         <files includesfile="file.csv"/>
      </copy>

Yields the following weirdness:

     [copy] C:\Documents and Settings\jweber\Desktop\db2_test\db2jcc.jar 
omitted
 as C:\Documents and Settings\jweber\Desktop\db2_test\db2jcc.jar is up 
to date.
     [copy] C:\Documents and 
Settings\jweber\Desktop\db2_test\db2jcc_license_cu.
jar omitted as C:\Documents and 
Settings\jweber\Desktop\db2_test\db2jcc_license_
cu.jar is up to date.
     [copy] No sources found.

Its Monday, am I missing something here?


Matt Benson wrote:
> --- Wascally Wabbit <wascallywabbit@earthling.net>
> wrote:
>
>   
>> If you're not averse to creating a little helper
>> class, why not
>> just write a custom file selector that can read your
>> delimited
>> file. Then you can just leverage the built in
>> resource collection
>> mechanisms like:
>>
>> <files id="myfiles">
>>    <custom
>> classname="your.new.custom.csvfile.reader.Selector">
>>      <param name="file"
>> value="/your/files/location"/>
>>    </custom>
>> </files>
>>     
>
> Actually, I've been watching this thread but did -not-
> suggest <files> because of the embedded spaces.  I
> -certainly- would warn against using <files> without
> include patterns as this would, I believe, scan the
> entire filesystem!  But, the Wabbit's post made me
> think--the includesfile attribute would work around
> the embedded space issue.  So you could use Ant's
> filtering mechanisms to transform your comma-delimited
> string into a line-delimited includesfile, then use
> that with <files>.  This -should- work.  Thanks
> Wabbit!
>
> -Matt
>
>
>   
>> As of 1.7 this <files> item can be used just about
>> wherever the
>> older <fileset> type was allowed...
>>
>> WARNING: I have not worked with the new resource
>> collections in
>> 1.7 extensively; so not sure *exactly* how this
>> might work.
>>
>> -The Wabbit
>>
>> Jeremy Weber wrote:
>>     
>>> Hi All,
>>>
>>> I have created dozen of custom tasks before, but
>>>       
>> find myself struggling 
>>     
>>> with this one. I wish to create a task that does
>>>       
>> the following:
>>     
>>> 1.  Accepts a file attribute to represent the
>>>       
>> absolute path of a file 
>>     
>>> contains comma separated absolute paths.
>>>    a.  this file name will be read in, parsed and
>>>       
>> each file found will 
>>     
>>> be added to a fileset object, which in term is
>>>       
>> added to a resources object.
>>     
>>> 2.  Accepts a id property
>>>    a.  this id will be the id of the resource
>>>       
>> created in step 1a.
>>     
>>> So essentially I want...
>>>
>>>    <csvtofileset file="csv.file.name"
>>>       
>> id="some.id.name">
>>     
>>> I am unclear on how to add the fileset i create in
>>>       
>> my code to the 
>>     
>>> project.  Additionally I am unsure of how to
>>>       
>> assign this an 'id' that I 
>>     
>>> can reference elsewhere.  Basically what I want to
>>>       
>> be able to do is 
>>     
>>> create a collection of files on the fly which I
>>>       
>> can reference on the 
>>     
>>> fly.   Essentially in the following snippet, the
>>>       
>> resources element would 
>>     
>>> be replaced by my new task element
>>>
>>> <project name="test" basedir="." default="test">
>>>
>>>   <!-- old -->
>>>    <resources id="fsd">
>>>         <fileset
>>>       
>> file="c:\temp\db2_test\db2jcc.jar" />           
>>     
>>> <fileset
>>>       
>> file="c:\temp\db2_test\db2jcc_license_cu.jar" />    
>>   
>>     
>>> </resources>
>>>    <!-- old -->
>>>
>>>    <!-- new -->
>>>           <csvtofileset file="csv.file.name"
>>>       
>> id="fsd">
>>     
>>>    <!-- new -->
>>>
>>>   <target name="test">
>>>          <copy toDir="c:\temp\ failonerror="true">
>>>             <resources refid="fsd"/>
>>>          </copy>
>>>   </target>
>>> </project>
>>>
>>>
>>> Any help at all would be appreciated.
>>>
>>>
>>>
>>>       
> ---------------------------------------------------------------------
>   
>>> To unsubscribe, e-mail:
>>>       
>> user-unsubscribe@ant.apache.org
>>     
>>> For additional commands, e-mail:
>>>       
>> user-help@ant.apache.org
>>     
>>>       
>>
>>     
> ---------------------------------------------------------------------
>   
>> To unsubscribe, e-mail:
>> user-unsubscribe@ant.apache.org
>> For additional commands, e-mail:
>> user-help@ant.apache.org
>>
>>
>>     
>
>
>
>       ____________________________________________________________________________________
> Be a better friend, newshound, and 
> know-it-all with Yahoo! Mobile.  Try it now.  http://mobile.yahoo.com/;_ylt=Ahu06i62sR8HDtDypao8Wcj9tAcJ
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@ant.apache.org
> For additional commands, e-mail: user-help@ant.apache.org
>
>
>   

-- 
Jeremy Weber
Quality Assurance Manager
Active Endpoints, Inc.
(203)929-9400
jeremy.weber@activevos.com 
http://www.active-endpoints.com
"Smart SOA Orchestration Powered by ActiveBPEL"


---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@ant.apache.org
For additional commands, e-mail: user-help@ant.apache.org


Mime
View raw message